From 14cd8a861efe666ab1d8fab44327b38a67fbd162 Mon Sep 17 00:00:00 2001
From: Florian Larysch
Date: Thu, 29 Dec 2016 02:04:25 +0100
Subject: add clappr
---
.../clapprio/38861cba61c66739c1452c3a71e39852.ttf | Bin 0 -> 32652 bytes
.../clapprio/4b76590b32dab62bc95c1b7951efae78.swf | Bin 0 -> 3204 bytes
.../clapprio/809981e5b09d5336c45d72d0869ada2a.swf | Bin 0 -> 63602 bytes
.../clapprio/a8c874b93b3d848f39a71260c57e3863.cur | Bin 0 -> 326 bytes
assets/clapprio/clappr.js | 31516 +++++++++++++++++++
assets/clapprio/clappr.min.js | 16 +
assets/clapprio/clappr.min.js.map | 1 +
7 files changed, 31533 insertions(+)
create mode 100644 assets/clapprio/38861cba61c66739c1452c3a71e39852.ttf
create mode 100644 assets/clapprio/4b76590b32dab62bc95c1b7951efae78.swf
create mode 100644 assets/clapprio/809981e5b09d5336c45d72d0869ada2a.swf
create mode 100644 assets/clapprio/a8c874b93b3d848f39a71260c57e3863.cur
create mode 100644 assets/clapprio/clappr.js
create mode 100644 assets/clapprio/clappr.min.js
create mode 100644 assets/clapprio/clappr.min.js.map
(limited to 'assets')
diff --git a/assets/clapprio/38861cba61c66739c1452c3a71e39852.ttf b/assets/clapprio/38861cba61c66739c1452c3a71e39852.ttf
new file mode 100644
index 0000000..7b25f3c
Binary files /dev/null and b/assets/clapprio/38861cba61c66739c1452c3a71e39852.ttf differ
diff --git a/assets/clapprio/4b76590b32dab62bc95c1b7951efae78.swf b/assets/clapprio/4b76590b32dab62bc95c1b7951efae78.swf
new file mode 100644
index 0000000..30bdf3d
Binary files /dev/null and b/assets/clapprio/4b76590b32dab62bc95c1b7951efae78.swf differ
diff --git a/assets/clapprio/809981e5b09d5336c45d72d0869ada2a.swf b/assets/clapprio/809981e5b09d5336c45d72d0869ada2a.swf
new file mode 100644
index 0000000..68619a7
Binary files /dev/null and b/assets/clapprio/809981e5b09d5336c45d72d0869ada2a.swf differ
diff --git a/assets/clapprio/a8c874b93b3d848f39a71260c57e3863.cur b/assets/clapprio/a8c874b93b3d848f39a71260c57e3863.cur
new file mode 100644
index 0000000..41aaa62
Binary files /dev/null and b/assets/clapprio/a8c874b93b3d848f39a71260c57e3863.cur differ
diff --git a/assets/clapprio/clappr.js b/assets/clapprio/clappr.js
new file mode 100644
index 0000000..1ee0b0a
--- /dev/null
+++ b/assets/clapprio/clappr.js
@@ -0,0 +1,31516 @@
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else if(typeof exports === 'object')
+ exports["Clappr"] = factory();
+ else
+ root["Clappr"] = factory();
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "<%=baseUrl%>/";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _player = __webpack_require__(1);
+
+ var _player2 = _interopRequireDefault(_player);
+
+ var _utils = __webpack_require__(2);
+
+ var _utils2 = _interopRequireDefault(_utils);
+
+ var _events = __webpack_require__(5);
+
+ var _events2 = _interopRequireDefault(_events);
+
+ var _playback = __webpack_require__(31);
+
+ var _playback2 = _interopRequireDefault(_playback);
+
+ var _container_plugin = __webpack_require__(85);
+
+ var _container_plugin2 = _interopRequireDefault(_container_plugin);
+
+ var _core_plugin = __webpack_require__(105);
+
+ var _core_plugin2 = _interopRequireDefault(_core_plugin);
+
+ var _ui_core_plugin = __webpack_require__(100);
+
+ var _ui_core_plugin2 = _interopRequireDefault(_ui_core_plugin);
+
+ var _ui_container_plugin = __webpack_require__(80);
+
+ var _ui_container_plugin2 = _interopRequireDefault(_ui_container_plugin);
+
+ var _base_object = __webpack_require__(4);
+
+ var _base_object2 = _interopRequireDefault(_base_object);
+
+ var _ui_object = __webpack_require__(18);
+
+ var _ui_object2 = _interopRequireDefault(_ui_object);
+
+ var _browser = __webpack_require__(3);
+
+ var _browser2 = _interopRequireDefault(_browser);
+
+ var _container = __webpack_require__(22);
+
+ var _container2 = _interopRequireDefault(_container);
+
+ var _core = __webpack_require__(13);
+
+ var _core2 = _interopRequireDefault(_core);
+
+ var _loader = __webpack_require__(48);
+
+ var _loader2 = _interopRequireDefault(_loader);
+
+ var _mediator = __webpack_require__(30);
+
+ var _mediator2 = _interopRequireDefault(_mediator);
+
+ var _media_control = __webpack_require__(27);
+
+ var _media_control2 = _interopRequireDefault(_media_control);
+
+ var _player_info = __webpack_require__(45);
+
+ var _player_info2 = _interopRequireDefault(_player_info);
+
+ var _base_flash_playback = __webpack_require__(56);
+
+ var _base_flash_playback2 = _interopRequireDefault(_base_flash_playback);
+
+ var _flash = __webpack_require__(54);
+
+ var _flash2 = _interopRequireDefault(_flash);
+
+ var _flashls = __webpack_require__(63);
+
+ var _flashls2 = _interopRequireDefault(_flashls);
+
+ var _hls = __webpack_require__(67);
+
+ var _hls2 = _interopRequireDefault(_hls);
+
+ var _html5_audio = __webpack_require__(61);
+
+ var _html5_audio2 = _interopRequireDefault(_html5_audio);
+
+ var _html5_video = __webpack_require__(51);
+
+ var _html5_video2 = _interopRequireDefault(_html5_video);
+
+ var _html_img = __webpack_require__(71);
+
+ var _html_img2 = _interopRequireDefault(_html_img);
+
+ var _no_op = __webpack_require__(74);
+
+ var _no_op2 = _interopRequireDefault(_no_op);
+
+ var _poster = __webpack_require__(90);
+
+ var _poster2 = _interopRequireDefault(_poster);
+
+ var _log = __webpack_require__(6);
+
+ var _log2 = _interopRequireDefault(_log);
+
+ var _styler = __webpack_require__(15);
+
+ var _styler2 = _interopRequireDefault(_styler);
+
+ var _vendor = __webpack_require__(8);
+
+ var _vendor2 = _interopRequireDefault(_vendor);
+
+ var _template = __webpack_require__(17);
+
+ var _template2 = _interopRequireDefault(_template);
+
+ var _clapprZepto = __webpack_require__(16);
+
+ var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ var version = ("0.2.64"); // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ exports.default = {
+ Player: _player2.default,
+ Mediator: _mediator2.default,
+ Events: _events2.default,
+ Browser: _browser2.default,
+ PlayerInfo: _player_info2.default,
+ MediaControl: _media_control2.default,
+ ContainerPlugin: _container_plugin2.default,
+ UIContainerPlugin: _ui_container_plugin2.default,
+ CorePlugin: _core_plugin2.default,
+ UICorePlugin: _ui_core_plugin2.default,
+ Playback: _playback2.default,
+ Container: _container2.default,
+ Core: _core2.default,
+ Loader: _loader2.default,
+ BaseObject: _base_object2.default,
+ UIObject: _ui_object2.default,
+ Utils: _utils2.default,
+ BaseFlashPlayback: _base_flash_playback2.default,
+ Flash: _flash2.default,
+ FlasHLS: _flashls2.default,
+ HLS: _hls2.default,
+ HTML5Audio: _html5_audio2.default,
+ HTML5Video: _html5_video2.default,
+ HTMLImg: _html_img2.default,
+ NoOp: _no_op2.default,
+ Poster: _poster2.default,
+ Log: _log2.default,
+ Styler: _styler2.default,
+ Vendor: _vendor2.default,
+ version: version,
+ template: _template2.default,
+ $: _clapprZepto2.default
+ };
+ module.exports = exports['default'];
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _utils = __webpack_require__(2);
+
+ var _base_object = __webpack_require__(4);
+
+ var _base_object2 = _interopRequireDefault(_base_object);
+
+ var _events = __webpack_require__(5);
+
+ var _events2 = _interopRequireDefault(_events);
+
+ var _browser = __webpack_require__(3);
+
+ var _browser2 = _interopRequireDefault(_browser);
+
+ var _core_factory = __webpack_require__(11);
+
+ var _core_factory2 = _interopRequireDefault(_core_factory);
+
+ var _loader = __webpack_require__(48);
+
+ var _loader2 = _interopRequireDefault(_loader);
+
+ var _player_info = __webpack_require__(45);
+
+ var _player_info2 = _interopRequireDefault(_player_info);
+
+ var _clapprZepto = __webpack_require__(16);
+
+ var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ var baseUrl = (0, _utils.currentScriptUrl)().replace(/\/[^\/]+$/, '');
+
+ /**
+ * @class Player
+ * @constructor
+ * @extends BaseObject
+ * @module components
+ * @example
+ * ### Using the Player
+ *
+ * Add the following script on your HTML:
+ * ```html
+ *
+ *
+ *
+ * ```
+ * Now, create the player:
+ * ```html
+ *
+ *
+ *
+ *
+ * ```
+ */
+
+ var Player = function (_BaseObject) {
+ _inherits(Player, _BaseObject);
+
+ _createClass(Player, [{
+ key: 'loader',
+ set: function set(loader) {
+ this._loader = loader;
+ },
+ get: function get() {
+ if (!this._loader) {
+ this._loader = new _loader2.default(this.options.plugins || {}, this.options.playerId);
+ }
+ return this._loader;
+ }
+
+ /**
+ * Determine if the playback has ended.
+ * @property ended
+ * @type Boolean
+ */
+
+ }, {
+ key: 'ended',
+ get: function get() {
+ return this.core.mediaControl.container.ended;
+ }
+
+ /**
+ * Determine if the playback is having to buffer in order for
+ * playback to be smooth.
+ * (i.e if a live stream is playing smoothly, this will be false)
+ * @property buffering
+ * @type Boolean
+ */
+
+ }, {
+ key: 'buffering',
+ get: function get() {
+ return this.core.mediaControl.container.buffering;
+ }
+
+ /*
+ * determine if the player is ready.
+ * @property isReady
+ * @type {Boolean} `true` if the player is ready. ie PLAYER_READY event has fired
+ */
+
+ }, {
+ key: 'isReady',
+ get: function get() {
+ return !!this._ready;
+ }
+
+ /**
+ * An events map that allows the user to add custom callbacks in player's options.
+ * @property eventsMapping
+ * @type {Object}
+ */
+
+ }, {
+ key: 'eventsMapping',
+ get: function get() {
+ return {
+ onReady: _events2.default.PLAYER_READY,
+ onResize: _events2.default.PLAYER_RESIZE,
+ onPlay: _events2.default.PLAYER_PLAY,
+ onPause: _events2.default.PLAYER_PAUSE,
+ onStop: _events2.default.PLAYER_STOP,
+ onEnded: _events2.default.PLAYER_ENDED,
+ onSeek: _events2.default.PLAYER_SEEK,
+ onError: _events2.default.PLAYER_ERROR,
+ onTimeUpdate: _events2.default.PLAYER_TIMEUPDATE,
+ onVolumeUpdate: _events2.default.PLAYER_VOLUMEUPDATE
+ };
+ }
+
+ /**
+ * ## Player's constructor
+ *
+ * You might pass the options object to build the player.
+ * ```javascript
+ * var options = {source: "http://example.com/video.mp4", param1: "val1"};
+ * var player = new Clappr.Player(options);
+ * ```
+ *
+ * @method constructor
+ * @param {Object} options Data
+ * options to build a player instance
+ * @param {Number} [options.width]
+ * player's width **default**: `640`
+ * @param {Number} [options.height]
+ * player's height **default**: `360`
+ * @param {String} [options.parentId]
+ * the id of the element on the page that the player should be inserted into
+ * @param {Object} [options.parent]
+ * a reference to a dom element that the player should be inserted into
+ * @param {String} [options.source]
+ * The media source URL, or {source: <>, mimeType: <>}
+ * @param {Object} [options.sources]
+ * An array of media source URL's, or an array of {source: <>, mimeType: <>}
+ * @param {Boolean} [options.autoPlay]
+ * automatically play after page load **default**: `false`
+ * @param {Boolean} [options.loop]
+ * automatically replay after it ends **default**: `false`
+ * @param {Boolean} [options.chromeless]
+ * player acts in chromeless mode **default**: `false`
+ * @param {Boolean} [options.allowUserInteraction]
+ * whether or not the player should handle click events when in chromeless mode **default**: `false` on desktops browsers, `true` on mobile.
+ * @param {Boolean} [options.disableKeyboardShortcuts]
+ * disable keyboard shortcuts. **default**: `false`. `true` if `allowUserInteraction` is `false`.
+ * @param {Boolean} [options.muted]
+ * start the video muted **default**: `false`
+ * @param {String} [options.mimeType]
+ * add `mimeType: "application/vnd.apple.mpegurl"` if you need to use a url without extension.
+ * @param {String} [options.actualLiveTime]
+ * show duration and seek time relative to actual time.
+ * @param {String} [options.actualLiveServerTime]
+ * specify server time as a string, format: "2015/11/26 06:01:03". This option is meant to be used with actualLiveTime.
+ * @param {Boolean} [options.persistConfig]
+ * persist player's settings (volume) through the same domain **default**: `true`
+ * @param {String} [options.preload]
+ * video will be preloaded according to `preload` attribute options **default**: `'metadata'`
+ * @param {Number} [options.maxBufferLength]
+ * the default behavior for the **HLS playback** is to keep buffering indefinitely, even on VoD.
+ * This replicates the behavior for progressive download, which continues buffering when pausing the video, thus making the video available for playback even on slow networks.
+ * To change this behavior use `maxBufferLength` where **value is in seconds**.
+ * @param {String} [options.gaAccount]
+ * enable Google Analytics events dispatch **(play/pause/stop/buffering/etc)** by adding your `gaAccount`
+ * @param {String} [options.gaTrackerName]
+ * besides `gaAccount` you can optionally, pass your favorite trackerName as `gaTrackerName`
+ * @param {Object} [options.mediacontrol]
+ * customize control bar colors, example: `mediacontrol: {seekbar: "#E113D3", buttons: "#66B2FF"}`
+ * @param {Boolean} [options.hideMediaControl]
+ * control media control auto hide **default**: `true`
+ * @param {Boolean} [options.hideVolumeBar]
+ * when embedded with width less than 320, volume bar will hide. You can force this behavior for all sizes by adding `true` **default**: `false`
+ * @param {String} [options.watermark]
+ * put `watermark: 'http://url/img.png'` on your embed parameters to automatically add watermark on your video.
+ * You can customize corner position by defining position parameter. Positions can be `bottom-left`, `bottom-right`, `top-left` and `top-right`.
+ * @param {String} [options.watermarkLink]
+ * `watermarkLink: 'http://example.net/'` - define URL to open when the watermark is clicked. If not provided watermark will not be clickable.
+ * @param {Boolean} [options.disableVideoTagContextMenu]
+ * disables the context menu (right click) on the video element if a HTML5Video playback is used.
+ * @param {Boolean} [options.autoSeekFromUrl]
+ * Automatically seek to the seconds provided in the url (e.g example.com?t=100) **default**: `true`
+ * @param {Boolean} [options.exitFullscreenOnEnd]
+ * Automatically exit full screen when the media finishes. **default**: `true`
+ * @param {String} [options.poster]
+ * define a poster by adding its address `poster: 'http://url/img.png'`. It will appear after video embed, disappear on play and go back when user stops the video.
+ * @param {String} [options.playbackNotSupportedMessage]
+ * define a custom message to be displayed when a playback is not supported.
+ * @param {Object} [options.events]
+ * Specify listeners which will be registered with their corresponding player events.
+ * E.g. onReady -> "PLAYER_READY", onTimeUpdate -> "PLAYER_TIMEUPDATE"
+ */
+
+ }]);
+
+ function Player(options) {
+ _classCallCheck(this, Player);
+
+ var _this = _possibleConstructorReturn(this, _BaseObject.call(this, options));
+
+ var defaultOptions = { playerId: (0, _utils.uniqueId)(''), persistConfig: true, width: 640, height: 360, baseUrl: baseUrl, allowUserInteraction: _browser2.default.isMobile };
+ _this._options = _clapprZepto2.default.extend(defaultOptions, options);
+ _this.options.sources = _this._normalizeSources(options);
+ if (!_this.options.chromeless) {
+ // "allowUserInteraction" cannot be false if not in chromeless mode.
+ _this.options.allowUserInteraction = true;
+ }
+ if (!_this.options.allowUserInteraction) {
+ // if user iteraction is not allowed ensure keyboard shortcuts are disabled
+ _this.options.disableKeyboardShortcuts = true;
+ }
+ _this._registerOptionEventListeners();
+ _this._coreFactory = new _core_factory2.default(_this);
+ _this.playerInfo = _player_info2.default.getInstance(_this.options.playerId);
+ _this.playerInfo.currentSize = { width: options.width, height: options.height };
+ _this.playerInfo.options = _this.options;
+ if (_this.options.parentId) {
+ _this.setParentId(_this.options.parentId);
+ } else if (_this.options.parent) {
+ _this.attachTo(_this.options.parent);
+ }
+ return _this;
+ }
+
+ /**
+ * Specify a `parentId` to the player.
+ * @method setParentId
+ * @param {String} parentId the element parent id.
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.setParentId = function setParentId(parentId) {
+ var el = document.querySelector(parentId);
+ if (el) {
+ this.attachTo(el);
+ }
+ return this;
+ };
+
+ /**
+ * You can use this method to attach the player to a given element. You don't need to do this when you specify it during the player instantiation passing the `parentId` param.
+ * @method attachTo
+ * @param {Object} element a given element.
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.attachTo = function attachTo(element) {
+ this.options.parentElement = element;
+ this.core = this._coreFactory.create();
+ this._addEventListeners();
+ return this;
+ };
+
+ Player.prototype._addEventListeners = function _addEventListeners() {
+ if (!this.core.isReady) {
+ this.listenToOnce(this.core, _events2.default.CORE_READY, this._onReady);
+ } else {
+ this._onReady();
+ }
+ this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this._containerChanged);
+ this.listenTo(this.core, _events2.default.CORE_FULLSCREEN, this._onFullscreenChange);
+ return this;
+ };
+
+ Player.prototype._addContainerEventListeners = function _addContainerEventListeners() {
+ var container = this.core.mediaControl.container;
+ if (container) {
+ this.listenTo(container, _events2.default.CONTAINER_PLAY, this._onPlay);
+ this.listenTo(container, _events2.default.CONTAINER_PAUSE, this._onPause);
+ this.listenTo(container, _events2.default.CONTAINER_STOP, this._onStop);
+ this.listenTo(container, _events2.default.CONTAINER_ENDED, this._onEnded);
+ this.listenTo(container, _events2.default.CONTAINER_SEEK, this._onSeek);
+ this.listenTo(container, _events2.default.CONTAINER_ERROR, this._onError);
+ this.listenTo(container, _events2.default.CONTAINER_TIMEUPDATE, this._onTimeUpdate);
+ this.listenTo(container, _events2.default.CONTAINER_VOLUME, this._onVolumeUpdate);
+ }
+ return this;
+ };
+
+ Player.prototype._registerOptionEventListeners = function _registerOptionEventListeners() {
+ var _this2 = this;
+
+ var userEvents = this.options.events || {};
+ Object.keys(userEvents).forEach(function (userEvent) {
+ var eventType = _this2.eventsMapping[userEvent];
+ if (eventType) {
+ var eventFunction = userEvents[userEvent];
+ eventFunction = typeof eventFunction === 'function' && eventFunction;
+ eventFunction && _this2.on(eventType, eventFunction);
+ }
+ });
+ return this;
+ };
+
+ Player.prototype._containerChanged = function _containerChanged() {
+ this.stopListening();
+ this._addEventListeners();
+ };
+
+ Player.prototype._onReady = function _onReady() {
+ this._ready = true;
+ this._addContainerEventListeners();
+ this.trigger(_events2.default.PLAYER_READY);
+ };
+
+ Player.prototype._onFullscreenChange = function _onFullscreenChange(fullscreen) {
+ this.trigger(_events2.default.PLAYER_FULLSCREEN, fullscreen);
+ };
+
+ Player.prototype._onVolumeUpdate = function _onVolumeUpdate(volume) {
+ this.trigger(_events2.default.PLAYER_VOLUMEUPDATE, volume);
+ };
+
+ Player.prototype._onPlay = function _onPlay() {
+ this.trigger(_events2.default.PLAYER_PLAY);
+ };
+
+ Player.prototype._onPause = function _onPause() {
+ this.trigger(_events2.default.PLAYER_PAUSE);
+ };
+
+ Player.prototype._onStop = function _onStop() {
+ this.trigger(_events2.default.PLAYER_STOP, this.getCurrentTime());
+ };
+
+ Player.prototype._onEnded = function _onEnded() {
+ this.trigger(_events2.default.PLAYER_ENDED);
+ };
+
+ Player.prototype._onSeek = function _onSeek(time) {
+ this.trigger(_events2.default.PLAYER_SEEK, time);
+ };
+
+ Player.prototype._onTimeUpdate = function _onTimeUpdate(timeProgress) {
+ this.trigger(_events2.default.PLAYER_TIMEUPDATE, timeProgress);
+ };
+
+ Player.prototype._onError = function _onError(error) {
+ this.trigger(_events2.default.PLAYER_ERROR, error);
+ };
+
+ Player.prototype._normalizeSources = function _normalizeSources(options) {
+ var sources = options.sources || (options.source !== undefined ? [options.source] : []);
+ return sources.length === 0 ? [{ source: '', mimeType: '' }] : sources;
+ };
+
+ /**
+ * resizes the current player canvas.
+ * @method resize
+ * @param {Object} size should be a literal object with `height` and `width`.
+ * @return {Player} itself
+ * @example
+ * ```javascript
+ * player.resize({height: 360, width: 640})
+ * ```
+ */
+
+
+ Player.prototype.resize = function resize(size) {
+ this.core.resize(size);
+ return this;
+ };
+
+ /**
+ * loads a new source.
+ * @method load
+ * @param {Array|String} sources source or sources of video.
+ * An array item can be a string or {source: <>, mimeType: <>}
+ * @param {String} mimeType a mime type, example: `'application/vnd.apple.mpegurl'`
+ * @param {Boolean} [autoPlay=false] whether playing should be started immediately
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.load = function load(sources, mimeType, autoPlay) {
+ if (autoPlay !== undefined) {
+ this.configure({ autoPlay: !!autoPlay });
+ }
+ this.core.load(sources, mimeType);
+ return this;
+ };
+
+ /**
+ * destroys the current player and removes it from the DOM.
+ * @method destroy
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.destroy = function destroy() {
+ this.core.destroy();
+ return this;
+ };
+
+ /**
+ * plays the current video (`source`).
+ * @method play
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.play = function play() {
+ this.core.mediaControl.container.play();
+ return this;
+ };
+
+ /**
+ * pauses the current video (`source`).
+ * @method pause
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.pause = function pause() {
+ this.core.mediaControl.container.pause();
+ return this;
+ };
+
+ /**
+ * stops the current video (`source`).
+ * @method stop
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.stop = function stop() {
+ this.core.mediaControl.container.stop();
+ return this;
+ };
+
+ /**
+ * seeks the current video (`source`). For example, `player.seek(120)` will seek to second 120 (2minutes) of the current video.
+ * @method seek
+ * @param {Number} time should be a number between 0 and the video duration.
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.seek = function seek(time) {
+ this.core.mediaControl.container.seek(time);
+ return this;
+ };
+
+ /**
+ * seeks the current video (`source`). For example, `player.seek(50)` will seek to the middle of the current video.
+ * @method seekPercentage
+ * @param {Number} time should be a number between 0 and 100.
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.seekPercentage = function seekPercentage(percentage) {
+ this.core.mediaControl.container.seekPercentage(percentage);
+ return this;
+ };
+
+ /**
+ * Set the volume for the current video (`source`).
+ * @method setVolume
+ * @param {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.setVolume = function setVolume(volume) {
+ if (this.core && this.core.mediaControl) {
+ this.core.mediaControl.setVolume(volume);
+ }
+ return this;
+ };
+
+ /**
+ * Get the volume for the current video
+ * @method getVolume
+ * @return {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.
+ */
+
+
+ Player.prototype.getVolume = function getVolume() {
+ return this.core && this.core.mediaControl ? this.core.mediaControl.volume : 0;
+ };
+
+ /**
+ * mutes the current video (`source`).
+ * @method mute
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.mute = function mute() {
+ this._mutedVolume = this.getVolume();
+ this.setVolume(0);
+ return this;
+ };
+
+ /**
+ * unmutes the current video (`source`).
+ * @method unmute
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.unmute = function unmute() {
+ this.setVolume(typeof this._mutedVolume === 'number' ? this._mutedVolume : 100);
+ this._mutedVolume = null;
+ return this;
+ };
+
+ /**
+ * checks if the player is playing.
+ * @method isPlaying
+ * @return {Boolean} `true` if the current source is playing, otherwise `false`
+ */
+
+
+ Player.prototype.isPlaying = function isPlaying() {
+ return this.core.mediaControl.container.isPlaying();
+ };
+
+ /**
+ * returns `true` if DVR is enable otherwise `false`.
+ * @method isDvrEnabled
+ * @return {Boolean}
+ */
+
+
+ Player.prototype.isDvrEnabled = function isDvrEnabled() {
+ return this.core.mediaControl.container.isDvrEnabled();
+ };
+
+ /**
+ * returns `true` if DVR is in use otherwise `false`.
+ * @method isDvrInUse
+ * @return {Boolean}
+ */
+
+
+ Player.prototype.isDvrInUse = function isDvrInUse() {
+ return this.core.mediaControl.container.isDvrInUse();
+ };
+
+ /**
+ * enables to configure a player after its creation
+ * @method configure
+ * @param {Object} options all the options to change in form of a javascript object
+ * @return {Player} itself
+ */
+
+
+ Player.prototype.configure = function configure(options) {
+ this.core.configure(options);
+ return this;
+ };
+
+ /**
+ * get a plugin by its name.
+ * @method getPlugin
+ * @param {String} name of the plugin.
+ * @return {Object} the plugin instance
+ * @example
+ * ```javascript
+ * var poster = player.getPlugin('poster');
+ * poster.hidePlayButton();
+ * ```
+ */
+
+
+ Player.prototype.getPlugin = function getPlugin(name) {
+ var plugins = this.core.plugins.concat(this.core.mediaControl.container.plugins);
+ return plugins.filter(function (plugin) {
+ return plugin.name === name;
+ })[0];
+ };
+
+ /**
+ * the current time in seconds.
+ * @method getCurrentTime
+ * @return {Number} current time (in seconds) of the current source
+ */
+
+
+ Player.prototype.getCurrentTime = function getCurrentTime() {
+ return this.core.mediaControl.container.getCurrentTime();
+ };
+
+ /**
+ * The time that "0" now represents relative to when playback started.
+ * For a stream with a sliding window this will increase as content is
+ * removed from the beginning.
+ * @method getStartTimeOffset
+ * @return {Number} time (in seconds) that time "0" represents.
+ */
+
+
+ Player.prototype.getStartTimeOffset = function getStartTimeOffset() {
+ return this.core.mediaControl.container.getStartTimeOffset();
+ };
+
+ /**
+ * the duration time in seconds.
+ * @method getDuration
+ * @return {Number} duration time (in seconds) of the current source
+ */
+
+
+ Player.prototype.getDuration = function getDuration() {
+ return this.core.mediaControl.container.getDuration();
+ };
+
+ return Player;
+ }(_base_object2.default);
+
+ exports.default = Player;
+ module.exports = exports['default'];
+
+/***/ },
+/* 2 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.cancelAnimationFrame = exports.requestAnimationFrame = exports.QueryString = exports.Config = exports.Fullscreen = undefined;
+
+ 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; }; }();
+
+ exports.extend = extend;
+ exports.formatTime = formatTime;
+ exports.seekStringToSeconds = seekStringToSeconds;
+ exports.uniqueId = uniqueId;
+ exports.isNumber = isNumber;
+ exports.currentScriptUrl = currentScriptUrl;
+ exports.getBrowserLanguage = getBrowserLanguage;
+ exports.now = now;
+ exports.removeArrayItem = removeArrayItem;
+
+ var _browser = __webpack_require__(3);
+
+ var _browser2 = _interopRequireDefault(_browser);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+ /*jshint -W079 */
+
+ function assign(obj, source) {
+ if (source) {
+ for (var prop in source) {
+ var propDescriptor = Object.getOwnPropertyDescriptor(source, prop);
+ propDescriptor ? Object.defineProperty(obj, prop, propDescriptor) : obj[prop] = source[prop];
+ }
+ }
+ return obj;
+ }
+
+ function extend(parent, properties) {
+ var Surrogate = function (_parent) {
+ _inherits(Surrogate, _parent);
+
+ function Surrogate() {
+ _classCallCheck(this, Surrogate);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ var _this = _possibleConstructorReturn(this, _parent.call.apply(_parent, [this].concat(args)));
+
+ if (properties.initialize) {
+ properties.initialize.apply(_this, args);
+ }
+ return _this;
+ }
+
+ return Surrogate;
+ }(parent);
+
+ assign(Surrogate.prototype, properties);
+ return Surrogate;
+ }
+
+ function formatTime(time, paddedHours) {
+ if (!isFinite(time)) {
+ return '--:--';
+ }
+ time = time * 1000;
+ time = parseInt(time / 1000);
+ var seconds = time % 60;
+ time = parseInt(time / 60);
+ var minutes = time % 60;
+ time = parseInt(time / 60);
+ var hours = time % 24;
+ var days = parseInt(time / 24);
+ var out = '';
+ if (days && days > 0) {
+ out += days + ':';
+ if (hours < 1) {
+ out += '00:';
+ }
+ }
+ if (hours && hours > 0 || paddedHours) {
+ out += ('0' + hours).slice(-2) + ':';
+ }
+ out += ('0' + minutes).slice(-2) + ':';
+ out += ('0' + seconds).slice(-2);
+ return out.trim();
+ }
+
+ var Fullscreen = exports.Fullscreen = {
+ isFullscreen: function isFullscreen() {
+ return !!(document.webkitFullscreenElement || document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement);
+ },
+ requestFullscreen: function requestFullscreen(el) {
+ if (el.requestFullscreen) {
+ el.requestFullscreen();
+ } else if (el.webkitRequestFullscreen) {
+ el.webkitRequestFullscreen();
+ } else if (el.mozRequestFullScreen) {
+ el.mozRequestFullScreen();
+ } else if (el.msRequestFullscreen) {
+ el.msRequestFullscreen();
+ } else if (el.querySelector && el.querySelector('video') && el.querySelector('video').webkitEnterFullScreen) {
+ el.querySelector('video').webkitEnterFullScreen();
+ }
+ },
+ cancelFullscreen: function cancelFullscreen() {
+ if (document.exitFullscreen) {
+ document.exitFullscreen();
+ } else if (document.webkitCancelFullScreen) {
+ document.webkitCancelFullScreen();
+ } else if (document.webkitExitFullscreen) {
+ document.webkitExitFullscreen();
+ } else if (document.mozCancelFullScreen) {
+ document.mozCancelFullScreen();
+ } else if (document.msExitFullscreen) {
+ document.msExitFullscreen();
+ }
+ },
+ fullscreenEnabled: function fullscreenEnabled() {
+ return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);
+ }
+ };
+
+ var Config = exports.Config = function () {
+ function Config() {
+ _classCallCheck(this, Config);
+ }
+
+ Config._defaultConfig = function _defaultConfig() {
+ return {
+ volume: {
+ value: 100,
+ parse: parseInt
+ }
+ };
+ };
+
+ Config._defaultValueFor = function _defaultValueFor(key) {
+ try {
+ return this._defaultConfig()[key].parse(this._defaultConfig()[key].value);
+ } catch (e) {
+ return undefined;
+ }
+ };
+
+ Config._createKeyspace = function _createKeyspace(key) {
+ return 'clappr.' + document.domain + '.' + key;
+ };
+
+ Config.restore = function restore(key) {
+ if (_browser2.default.hasLocalstorage && localStorage[this._createKeyspace(key)]) {
+ return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)]);
+ }
+ return this._defaultValueFor(key);
+ };
+
+ Config.persist = function persist(key, value) {
+ if (_browser2.default.hasLocalstorage) {
+ try {
+ localStorage[this._createKeyspace(key)] = value;
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }
+ };
+
+ return Config;
+ }();
+
+ var QueryString = exports.QueryString = function () {
+ function QueryString() {
+ _classCallCheck(this, QueryString);
+ }
+
+ QueryString.parse = function parse(paramsString) {
+ var match = void 0;
+ var pl = /\+/g,
+ // Regex for replacing addition symbol with a space
+ search = /([^&=]+)=?([^&]*)/g,
+ decode = function decode(s) {
+ return decodeURIComponent(s.replace(pl, ' '));
+ },
+ params = {};
+ while (match = search.exec(paramsString)) {
+ // eslint-disable-line no-cond-assign
+ params[decode(match[1]).toLowerCase()] = decode(match[2]);
+ }
+ return params;
+ };
+
+ _createClass(QueryString, null, [{
+ key: 'params',
+ get: function get() {
+ var query = window.location.search.substring(1);
+ if (query !== this.query) {
+ this._urlParams = this.parse(query);
+ this.query = query;
+ }
+ return this._urlParams;
+ }
+ }, {
+ key: 'hashParams',
+ get: function get() {
+ var hash = window.location.hash.substring(1);
+ if (hash !== this.hash) {
+ this._hashParams = this.parse(hash);
+ this.hash = hash;
+ }
+ return this._hashParams;
+ }
+ }]);
+
+ return QueryString;
+ }();
+
+ function seekStringToSeconds() {
+ var paramName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 't';
+
+ var seconds = 0;
+ var seekString = QueryString.params[paramName] || QueryString.hashParams[paramName] || '';
+ var parts = seekString.match(/[0-9]+[hms]+/g) || [];
+ if (parts.length > 0) {
+ (function () {
+ var factor = { 'h': 3600, 'm': 60, 's': 1 };
+ parts.forEach(function (el) {
+ if (el) {
+ var suffix = el[el.length - 1];
+ var time = parseInt(el.slice(0, el.length - 1), 10);
+ seconds += time * factor[suffix];
+ }
+ });
+ })();
+ } else if (seekString) {
+ seconds = parseInt(seekString, 10);
+ }
+ return seconds;
+ }
+
+ var idsCounter = {};
+
+ function uniqueId(prefix) {
+ idsCounter[prefix] || (idsCounter[prefix] = 0);
+ var id = ++idsCounter[prefix];
+ return prefix + id;
+ }
+
+ function isNumber(value) {
+ return value - parseFloat(value) + 1 >= 0;
+ }
+
+ function currentScriptUrl() {
+ var scripts = document.getElementsByTagName('script');
+ return scripts.length ? scripts[scripts.length - 1].src : '';
+ }
+
+ var requestAnimationFrame = exports.requestAnimationFrame = (window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) {
+ window.setTimeout(fn, 1000 / 60);
+ }).bind(window);
+
+ var cancelAnimationFrame = exports.cancelAnimationFrame = (window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout).bind(window);
+
+ function getBrowserLanguage() {
+ return window.navigator && window.navigator.language;
+ }
+
+ function now() {
+ if (window.performance && window.performance.now) {
+ return performance.now();
+ }
+ return Date.now();
+ }
+
+ // remove the item from the array if it exists in the array
+ function removeArrayItem(arr, item) {
+ var i = arr.indexOf(item);
+ if (i >= 0) {
+ arr.splice(i, 1);
+ }
+ }
+
+ exports.default = {
+ Config: Config,
+ Fullscreen: Fullscreen,
+ QueryString: QueryString,
+ extend: extend,
+ formatTime: formatTime,
+ seekStringToSeconds: seekStringToSeconds,
+ uniqueId: uniqueId,
+ currentScriptUrl: currentScriptUrl,
+ isNumber: isNumber,
+ requestAnimationFrame: requestAnimationFrame,
+ cancelAnimationFrame: cancelAnimationFrame,
+ getBrowserLanguage: getBrowserLanguage,
+ now: now,
+ removeArrayItem: removeArrayItem
+ };
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ var Browser = {};
+
+ var hasLocalstorage = function hasLocalstorage() {
+ try {
+ localStorage.setItem('clappr', 'clappr');
+ localStorage.removeItem('clappr');
+ return true;
+ } catch (e) {
+ return false;
+ }
+ };
+
+ var hasFlash = function hasFlash() {
+ try {
+ var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
+ return !!fo;
+ } catch (e) {
+ return !!(navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] !== undefined && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin);
+ }
+ };
+
+ var getBrowserInfo = function getBrowserInfo() {
+ var ua = navigator.userAgent;
+ var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [],
+ extra = void 0;
+ if (/trident/i.test(parts[1])) {
+ extra = /\brv[ :]+(\d+)/g.exec(ua) || [];
+ return { name: 'IE', version: parseInt(extra[1] || '') };
+ } else if (parts[1] === 'Chrome') {
+ extra = ua.match(/\bOPR\/(\d+)/);
+ if (extra != null) {
+ return { name: 'Opera', version: parseInt(extra[1]) };
+ }
+ }
+ parts = parts[2] ? [parts[1], parts[2]] : [navigator.appName, navigator.appVersion, '-?'];
+
+ if (extra = ua.match(/version\/(\d+)/i)) {
+ parts.splice(1, 1, extra[1]);
+ }
+ return { name: parts[0], version: parseInt(parts[1]) };
+ };
+
+ var browserInfo = getBrowserInfo();
+
+ Browser.isSafari = /safari/i.test(navigator.userAgent) && navigator.userAgent.indexOf('Chrome') === -1;
+ Browser.isChrome = /chrome/i.test(navigator.userAgent);
+ Browser.isFirefox = /firefox/i.test(navigator.userAgent);
+ Browser.isLegacyIE = !!window.ActiveXObject;
+ Browser.isIE = Browser.isLegacyIE || /trident.*rv:1\d/i.test(navigator.userAgent);
+ Browser.isIE11 = /trident.*rv:11/i.test(navigator.userAgent);
+ Browser.isChromecast = Browser.isChrome && /CrKey/i.test(navigator.userAgent);
+ Browser.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Opera Mini/i.test(navigator.userAgent);
+ Browser.isiOS = /iPad|iPhone|iPod/i.test(navigator.userAgent);
+ Browser.isAndroid = /Android/i.test(navigator.userAgent);
+ Browser.isWindowsPhone = /Windows Phone/i.test(navigator.userAgent);
+ Browser.isWin8App = /MSAppHost/i.test(navigator.userAgent);
+ Browser.isWiiU = /WiiU/i.test(navigator.userAgent);
+ Browser.isPS4 = /PlayStation 4/i.test(navigator.userAgent);
+ Browser.hasLocalstorage = hasLocalstorage();
+ Browser.hasFlash = hasFlash();
+
+ Browser.name = browserInfo.name;
+ Browser.version = browserInfo.version;
+
+ exports.default = Browser;
+ module.exports = exports['default'];
+
+/***/ },
+/* 4 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _utils = __webpack_require__(2);
+
+ var _events = __webpack_require__(5);
+
+ var _events2 = _interopRequireDefault(_events);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ 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; } // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ /**
+ * @class BaseObject
+ * @constructor
+ * @extends Events
+ * @module base
+ */
+ var BaseObject = function (_Events) {
+ _inherits(BaseObject, _Events);
+
+ _createClass(BaseObject, [{
+ key: 'options',
+
+ /**
+ * returns the object options
+ * @property options
+ * @type Object
+ */
+ get: function get() {
+ return this._options;
+ }
+
+ /**
+ * @method constructor
+ * @param {Object} options
+ */
+
+ }]);
+
+ function BaseObject() {
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ _classCallCheck(this, BaseObject);
+
+ var _this = _possibleConstructorReturn(this, _Events.call(this, options));
+
+ _this._options = options;
+ _this.uniqueId = (0, _utils.uniqueId)('o');
+ return _this;
+ }
+ /**
+ * a unique id prefixed with `'o'`, `o1, o232`
+ *
+ * @property uniqueId
+ * @type String
+ */
+
+
+ return BaseObject;
+ }(_events2.default);
+
+ exports.default = BaseObject;
+ module.exports = exports['default'];
+
+/***/ },
+/* 5 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ var _log = __webpack_require__(6);
+
+ var _log2 = _interopRequireDefault(_log);
+
+ var _utils = __webpack_require__(2);
+
+ var _lodash = __webpack_require__(10);
+
+ var _lodash2 = _interopRequireDefault(_lodash);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var slice = Array.prototype.slice;
+
+ var eventSplitter = /\s+/;
+
+ var eventsApi = function eventsApi(obj, action, name, rest) {
+ if (!name) {
+ return true;
+ }
+
+ // Handle event maps.
+ if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
+ for (var key in name) {
+ obj[action].apply(obj, [key, name[key]].concat(rest));
+ }
+ return false;
+ }
+
+ // Handle space separated event names.
+ if (eventSplitter.test(name)) {
+ var names = name.split(eventSplitter);
+ for (var i = 0, l = names.length; i < l; i++) {
+ obj[action].apply(obj, [names[i]].concat(rest));
+ }
+ return false;
+ }
+
+ return true;
+ };
+
+ var triggerEvents = function triggerEvents(events, args, klass, name) {
+ var ev = void 0,
+ i = -1;
+ var l = events.length,
+ a1 = args[0],
+ a2 = args[1],
+ a3 = args[2];
+ run();
+
+ function run() {
+ try {
+ switch (args.length) {
+ case 0:
+ while (++i < l) {
+ (ev = events[i]).callback.call(ev.ctx);
+ }return;
+ case 1:
+ while (++i < l) {
+ (ev = events[i]).callback.call(ev.ctx, a1);
+ }return;
+ case 2:
+ while (++i < l) {
+ (ev = events[i]).callback.call(ev.ctx, a1, a2);
+ }return;
+ case 3:
+ while (++i < l) {
+ (ev = events[i]).callback.call(ev.ctx, a1, a2, a3);
+ }return;
+ default:
+ while (++i < l) {
+ (ev = events[i]).callback.apply(ev.ctx, args);
+ }return;
+ }
+ } catch (exception) {
+ _log2.default.error.apply(_log2.default, [klass, 'error on event', name, 'trigger', '-', exception]);
+ run();
+ }
+ }
+ };
+
+ /**
+ * @class Events
+ * @constructor
+ * @module base
+ */
+
+ var Events = function () {
+ function Events() {
+ _classCallCheck(this, Events);
+ }
+
+ /**
+ * listen to an event indefinitely, if you want to stop you need to call `off`
+ * @method on
+ * @param {String} name
+ * @param {Function} callback
+ * @param {Object} context
+ */
+ Events.prototype.on = function on(name, callback, context) {
+ if (!eventsApi(this, 'on', name, [callback, context]) || !callback) {
+ return this;
+ }
+ this._events || (this._events = {});
+ var events = this._events[name] || (this._events[name] = []);
+ events.push({ callback: callback, context: context, ctx: context || this });
+ return this;
+ };
+
+ /**
+ * listen to an event only once
+ * @method once
+ * @param {String} name
+ * @param {Function} callback
+ * @param {Object} context
+ */
+
+
+ Events.prototype.once = function once(name, callback, context) {
+ if (!eventsApi(this, 'once', name, [callback, context]) || !callback) {
+ return this;
+ }
+ var self = this;
+ var once = (0, _lodash2.default)(function () {
+ self.off(name, once);
+ callback.apply(this, arguments);
+ });
+ once._callback = callback;
+ return this.on(name, once, context);
+ };
+
+ /**
+ * stop listening to an event
+ * @method off
+ * @param {String} name
+ * @param {Function} callback
+ * @param {Object} context
+ */
+
+
+ Events.prototype.off = function off(name, callback, context) {
+ var retain = void 0,
+ ev = void 0,
+ events = void 0,
+ names = void 0,
+ i = void 0,
+ l = void 0,
+ j = void 0,
+ k = void 0;
+ if (!this._events || !eventsApi(this, 'off', name, [callback, context])) {
+ return this;
+ }
+ if (!name && !callback && !context) {
+ this._events = void 0;
+ return this;
+ }
+ names = name ? [name] : Object.keys(this._events);
+ // jshint maxdepth:5
+ for (i = 0, l = names.length; i < l; i++) {
+ name = names[i];
+ events = this._events[name];
+ if (events) {
+ this._events[name] = retain = [];
+ if (callback || context) {
+ for (j = 0, k = events.length; j < k; j++) {
+ ev = events[j];
+ if (callback && callback !== ev.callback && callback !== ev.callback._callback || context && context !== ev.context) {
+ retain.push(ev);
+ }
+ }
+ }
+ if (!retain.length) {
+ delete this._events[name];
+ }
+ }
+ }
+ return this;
+ };
+
+ /**
+ * triggers an event given its `name`
+ * @method trigger
+ * @param {String} name
+ */
+
+
+ Events.prototype.trigger = function trigger(name) {
+ var klass = this.name || this.constructor.name;
+ _log2.default.debug.apply(_log2.default, [klass].concat(Array.prototype.slice.call(arguments)));
+ if (!this._events) {
+ return this;
+ }
+ var args = slice.call(arguments, 1);
+ if (!eventsApi(this, 'trigger', name, args)) {
+ return this;
+ }
+ var events = this._events[name];
+ var allEvents = this._events.all;
+ if (events) {
+ triggerEvents(events, args, klass, name);
+ }
+ if (allEvents) {
+ triggerEvents(allEvents, arguments, klass, name);
+ }
+ return this;
+ };
+
+ /**
+ * stop listening an event for a given object
+ * @method stopListening
+ * @param {Object} obj
+ * @param {String} name
+ * @param {Function} callback
+ */
+
+
+ Events.prototype.stopListening = function stopListening(obj, name, callback) {
+ var listeningTo = this._listeningTo;
+ if (!listeningTo) {
+ return this;
+ }
+ var remove = !name && !callback;
+ if (!callback && (typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
+ callback = this;
+ }
+ if (obj) {
+ (listeningTo = {})[obj._listenId] = obj;
+ }
+ for (var id in listeningTo) {
+ obj = listeningTo[id];
+ obj.off(name, callback, this);
+ if (remove || Object.keys(obj._events).length === 0) {
+ delete this._listeningTo[id];
+ }
+ }
+ return this;
+ };
+
+ return Events;
+ }();
+
+ /**
+ * listen to an event indefinitely for a given `obj`
+ * @method listenTo
+ * @param {Object} obj
+ * @param {String} name
+ * @param {Function} callback
+ * @param {Object} context
+ * @example
+ * ```javascript
+ * this.listenTo(this.core.playback, Events.PLAYBACK_PAUSE, this.callback)
+ * ```
+ */
+ /**
+ * listen to an event once for a given `obj`
+ * @method listenToOnce
+ * @param {Object} obj
+ * @param {String} name
+ * @param {Function} callback
+ * @param {Object} context
+ * @example
+ * ```javascript
+ * this.listenToOnce(this.core.playback, Events.PLAYBACK_PAUSE, this.callback)
+ * ```
+ */
+
+
+ exports.default = Events;
+ var listenMethods = { listenTo: 'on', listenToOnce: 'once' };
+
+ Object.keys(listenMethods).forEach(function (method) {
+ Events.prototype[method] = function (obj, name, callback) {
+ var listeningTo = this._listeningTo || (this._listeningTo = {});
+ var id = obj._listenId || (obj._listenId = (0, _utils.uniqueId)('l'));
+ listeningTo[id] = obj;
+ if (!callback && (typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
+ callback = this;
+ }
+ obj[listenMethods[method]](name, callback, this);
+ return this;
+ };
+ });
+
+ // PLAYER EVENTS
+ /**
+ * Fired when the player is ready on startup
+ *
+ * @event PLAYER_READY
+ */
+ Events.PLAYER_READY = 'ready';
+ /**
+ * Fired when player resizes
+ *
+ * @event PLAYER_RESIZE
+ * @param {Object} currentSize an object with the current size
+ */
+ Events.PLAYER_RESIZE = 'resize';
+ /**
+ * Fired when player changes its fullscreen state
+ *
+ * @event PLAYER_FULLSCREEN
+ * @param {Boolean} whether or not the player is on fullscreen mode
+ */
+ Events.PLAYER_FULLSCREEN = 'fullscreen';
+ /**
+ * Fired when player starts to play
+ *
+ * @event PLAYER_PLAY
+ */
+ Events.PLAYER_PLAY = 'play';
+ /**
+ * Fired when player pauses
+ *
+ * @event PLAYER_PAUSE
+ */
+ Events.PLAYER_PAUSE = 'pause';
+ /**
+ * Fired when player stops
+ *
+ * @event PLAYER_STOP
+ */
+ Events.PLAYER_STOP = 'stop';
+ /**
+ * Fired when player ends the video
+ *
+ * @event PLAYER_ENDED
+ */
+ Events.PLAYER_ENDED = 'ended';
+ /**
+ * Fired when player seeks the video
+ *
+ * @event PLAYER_SEEK
+ * @param {Number} time the current time in seconds
+ */
+ Events.PLAYER_SEEK = 'seek';
+ /**
+ * Fired when player receives an error
+ *
+ * @event PLAYER_ERROR
+ * @param {Object} error the error
+ */
+ Events.PLAYER_ERROR = 'error';
+ /**
+ * Fired when the time is updated on player
+ *
+ * @event PLAYER_TIMEUPDATE
+ * @param {Object} progress Data
+ * progress object
+ * @param {Number} [progress.current]
+ * current time
+ * @param {Number} [progress.total]
+ * total time
+ */
+ Events.PLAYER_TIMEUPDATE = 'timeupdate';
+ /**
+ * Fired when player updates its volume
+ *
+ * @event PLAYER_VOLUMEUPDATE
+ * @param {Number} volume the current volume
+ */
+ Events.PLAYER_VOLUMEUPDATE = 'volumeupdate';
+
+ // Playback Events
+ /**
+ * Fired when the playback is downloading the media
+ *
+ * @event PLAYBACK_PROGRESS
+ * @param progress {Object}
+ * Data progress object
+ * @param [progress.start] {Number}
+ * start position of buffered content at current position
+ * @param [progress.current] {Number}
+ * end position of buffered content at current position
+ * @param [progress.total] {Number}
+ * total content to be downloaded
+ * @param buffered {Array}
+ * array of buffered segments ({start, end}). [Only for supported playbacks]
+ */
+ Events.PLAYBACK_PROGRESS = 'playback:progress';
+ /**
+ * Fired when the time is updated on playback
+ *
+ * @event PLAYBACK_TIMEUPDATE
+ * @param {Object} progress Data
+ * progress object
+ * @param {Number} [progress.current]
+ * current time
+ * @param {Number} [progress.total]
+ * total time
+ */
+ Events.PLAYBACK_TIMEUPDATE = 'playback:timeupdate';
+ /**
+ * Fired when playback is ready
+ *
+ * @event PLAYBACK_READY
+ */
+ Events.PLAYBACK_READY = 'playback:ready';
+ /**
+ * Fired when the playback starts having to buffer because
+ * playback can currently not be smooth.
+ *
+ * This corresponds to the playback `buffering` property being
+ * `true`.
+ *
+ * @event PLAYBACK_BUFFERING
+ */
+ Events.PLAYBACK_BUFFERING = 'playback:buffering';
+ /**
+ * Fired when the playback has enough in the buffer to be
+ * able to play smoothly, after previously being unable to
+ * do this.
+ *
+ * This corresponds to the playback `buffering` property being
+ * `false`.
+ *
+ * @event PLAYBACK_BUFFERFULL
+ */
+ Events.PLAYBACK_BUFFERFULL = 'playback:bufferfull';
+ /**
+ * Fired when playback changes any settings (volume, seek and etc)
+ *
+ * @event PLAYBACK_SETTINGSUPDATE
+ */
+ Events.PLAYBACK_SETTINGSUPDATE = 'playback:settingsupdate';
+ /**
+ * Fired when playback loaded its metadata
+ *
+ * @event PLAYBACK_LOADEDMETADATA
+ * @param {Object} metadata Data
+ * settings object
+ * @param {Number} [metadata.duration]
+ * the playback duration
+ * @param {Object} [metadata.data]
+ * extra meta data
+ */
+ Events.PLAYBACK_LOADEDMETADATA = 'playback:loadedmetadata';
+ /**
+ * Fired when playback updates its video quality
+ *
+ * @event PLAYBACK_HIGHDEFINITIONUPDATE
+ * @param {Boolean} isHD
+ * true when is on HD, false otherwise
+ */
+ Events.PLAYBACK_HIGHDEFINITIONUPDATE = 'playback:highdefinitionupdate';
+ /**
+ * Fired when playback updates its bitrate
+ *
+ * @event PLAYBACK_BITRATE
+ * @param {Object} bitrate Data
+ * bitrate object
+ * @param {Number} [bitrate.bandwidth]
+ * bitrate bandwidth when it's available
+ * @param {Number} [bitrate.width]
+ * playback width (ex: 720, 640, 1080)
+ * @param {Number} [bitrate.height]
+ * playback height (ex: 240, 480, 720)
+ * @param {Number} [bitrate.level]
+ * playback level when it's available, it could be just a map for width (0 => 240, 1 => 480, 2 => 720)
+ */
+ Events.PLAYBACK_BITRATE = 'playback:bitrate';
+ /**
+ * Fired when the playback has its levels
+ *
+ * @event PLAYBACK_LEVELS_AVAILABLE
+ * @param {Array} levels
+ * the ordered levels, each one with the following format `{id: 1, label: '500kbps'}` ps: id should be a number >= 0
+ * @param {Number} initial
+ * the initial level otherwise -1 (AUTO)
+ */
+ Events.PLAYBACK_LEVELS_AVAILABLE = 'playback:levels:available';
+ /**
+ * Fired when the playback starts to switch level
+ *
+ * @event PLAYBACK_LEVEL_SWITCH_START
+ *
+ */
+ Events.PLAYBACK_LEVEL_SWITCH_START = 'playback:levels:switch:start';
+ /**
+ * Fired when the playback ends the level switch
+ *
+ * @event PLAYBACK_LEVEL_SWITCH_END
+ *
+ */
+ Events.PLAYBACK_LEVEL_SWITCH_END = 'playback:levels:switch:end';
+
+ /**
+ * Fired when playback internal state changes
+ *
+ * @event PLAYBACK_PLAYBACKSTATE
+ * @param {Object} state Data
+ * state object
+ * @param {String} [state.type]
+ * the playback type
+ */
+ Events.PLAYBACK_PLAYBACKSTATE = 'playback:playbackstate';
+ /**
+ * Fired when DVR becomes enabled/disabled.
+ *
+ * @event PLAYBACK_DVR
+ * @param {boolean} state true if dvr enabled
+ */
+ Events.PLAYBACK_DVR = 'playback:dvr';
+ // TODO doc
+ Events.PLAYBACK_MEDIACONTROL_DISABLE = 'playback:mediacontrol:disable';
+ // TODO doc
+ Events.PLAYBACK_MEDIACONTROL_ENABLE = 'playback:mediacontrol:enable';
+ /**
+ * Fired when the media for a playback ends.
+ *
+ * @event PLAYBACK_ENDED
+ * @param {String} name the name of the playback
+ */
+ Events.PLAYBACK_ENDED = 'playback:ended';
+ /**
+ * Fired when user requests `play()`
+ *
+ * @event PLAYBACK_PLAY_INTENT
+ */
+ Events.PLAYBACK_PLAY_INTENT = 'playback:play:intent';
+ /**
+ * Fired when the media for a playback starts playing.
+ * This is not necessarily when the user requests `play()`
+ * The media may have to buffer first.
+ * I.e. `isPlaying()` might return `true` before this event is fired,
+ * because `isPlaying()` represents the intended state.
+ *
+ * @event PLAYBACK_PLAY
+ */
+ Events.PLAYBACK_PLAY = 'playback:play';
+ /**
+ * Fired when the media for a playback pauses.
+ *
+ * @event PLAYBACK_PAUSE
+ */
+ Events.PLAYBACK_PAUSE = 'playback:pause';
+ /**
+ * Fired when the media for a playback is stopped.
+ *
+ * @event PLAYBACK_STOP
+ */
+ Events.PLAYBACK_STOP = 'playback:stop';
+ /**
+ * Fired if an error occurs in the playback.
+ *
+ * @event PLAYBACK_ERROR
+ * @param {Object} error An object containing the error details
+ * @param {String} name Playback name
+ */
+ Events.PLAYBACK_ERROR = 'playback:error';
+ // TODO doc
+ Events.PLAYBACK_STATS_ADD = 'playback:stats:add';
+ // TODO doc
+ Events.PLAYBACK_FRAGMENT_LOADED = 'playback:fragment:loaded';
+ // TODO doc
+ Events.PLAYBACK_LEVEL_SWITCH = 'playback:level:switch';
+
+ /**
+ * Fired when the options were changed for the core
+ *
+ * @event CORE_OPTIONS_CHANGE
+ */
+ Events.CORE_OPTIONS_CHANGE = 'core:options:change';
+ /**
+ * Fired after creating containers, when the core is ready
+ *
+ * @event CORE_READY
+ */
+ Events.CORE_READY = 'core:ready';
+ /**
+ * Fired when the fullscreen state change
+ *
+ * @param {Boolean} whether or not the player is on fullscreen mode
+ * @event CORE_READY
+ */
+ Events.CORE_FULLSCREEN = 'core:fullscreen';
+
+ // Container Events
+ /**
+ * Fired when the container internal state changes
+ *
+ * @event CONTAINER_PLAYBACKSTATE
+ * @param {Object} state Data
+ * state object
+ * @param {String} [state.type]
+ * the playback type
+ */
+ Events.CONTAINER_PLAYBACKSTATE = 'container:playbackstate';
+ Events.CONTAINER_PLAYBACKDVRSTATECHANGED = 'container:dvr';
+ /**
+ * Fired when the container updates its bitrate
+ *
+ * @event CONTAINER_BITRATE
+ * @param {Object} bitrate Data
+ * bitrate object
+ * @param {Number} [bitrate.bandwidth]
+ * bitrate bandwidth when it's available
+ * @param {Number} [bitrate.width]
+ * playback width (ex: 720, 640, 1080)
+ * @param {Number} [bitrate.height]
+ * playback height (ex: 240, 480, 720)
+ * @param {Number} [bitrate.level]
+ * playback level when it's available, it could be just a map for width (0 => 240, 1 => 480, 2 => 720)
+ */
+ Events.CONTAINER_BITRATE = 'container:bitrate';
+ Events.CONTAINER_STATS_REPORT = 'container:stats:report';
+ Events.CONTAINER_DESTROYED = 'container:destroyed';
+ /**
+ * Fired when the container is ready
+ *
+ * @event CONTAINER_READY
+ */
+ Events.CONTAINER_READY = 'container:ready';
+ Events.CONTAINER_ERROR = 'container:error';
+ /**
+ * Fired when the container loaded its metadata
+ *
+ * @event CONTAINER_LOADEDMETADATA
+ * @param {Object} metadata Data
+ * settings object
+ * @param {Number} [metadata.duration]
+ * the playback duration
+ * @param {Object} [metadata.data]
+ * extra meta data
+ */
+ Events.CONTAINER_LOADEDMETADATA = 'container:loadedmetadata';
+ /**
+ * Fired when the time is updated on container
+ *
+ * @event CONTAINER_TIMEUPDATE
+ * @param {Object} progress Data
+ * progress object
+ * @param {Number} [progress.current]
+ * current time
+ * @param {Number} [progress.total]
+ * total time
+ */
+ Events.CONTAINER_TIMEUPDATE = 'container:timeupdate';
+ /**
+ * Fired when the container is downloading the media
+ *
+ * @event CONTAINER_PROGRESS
+ * @param {Object} progress Data
+ * progress object
+ * @param {Number} [progress.start]
+ * initial downloaded content
+ * @param {Number} [progress.current]
+ * current dowloaded content
+ * @param {Number} [progress.total]
+ * total content to be downloaded
+ */
+ Events.CONTAINER_PROGRESS = 'container:progress';
+ Events.CONTAINER_PLAY = 'container:play';
+ Events.CONTAINER_STOP = 'container:stop';
+ Events.CONTAINER_PAUSE = 'container:pause';
+ Events.CONTAINER_ENDED = 'container:ended';
+ Events.CONTAINER_CLICK = 'container:click';
+ Events.CONTAINER_DBLCLICK = 'container:dblclick';
+ Events.CONTAINER_CONTEXTMENU = 'container:contextmenu';
+ Events.CONTAINER_MOUSE_ENTER = 'container:mouseenter';
+ Events.CONTAINER_MOUSE_LEAVE = 'container:mouseleave';
+ /**
+ * Fired when the container seeks the video
+ *
+ * @event CONTAINER_SEEK
+ * @param {Number} time the current time in seconds
+ */
+ Events.CONTAINER_SEEK = 'container:seek';
+ Events.CONTAINER_VOLUME = 'container:volume';
+ Events.CONTAINER_FULLSCREEN = 'container:fullscreen';
+ /**
+ * Fired when container is buffering
+ *
+ * @event CONTAINER_STATE_BUFFERING
+ */
+ Events.CONTAINER_STATE_BUFFERING = 'container:state:buffering';
+ /**
+ * Fired when the container filled the buffer
+ *
+ * @event CONTAINER_STATE_BUFFERFULL
+ */
+ Events.CONTAINER_STATE_BUFFERFULL = 'container:state:bufferfull';
+ /**
+ * Fired when the container changes any settings (volume, seek and etc)
+ *
+ * @event CONTAINER_SETTINGSUPDATE
+ */
+ Events.CONTAINER_SETTINGSUPDATE = 'container:settingsupdate';
+ /**
+ * Fired when container updates its video quality
+ *
+ * @event CONTAINER_HIGHDEFINITIONUPDATE
+ * @param {Boolean} isHD
+ * true when is on HD, false otherwise
+ */
+ Events.CONTAINER_HIGHDEFINITIONUPDATE = 'container:highdefinitionupdate';
+
+ /**
+ * Fired when the media control shows
+ *
+ * @event CONTAINER_MEDIACONTROL_SHOW
+ */
+ Events.CONTAINER_MEDIACONTROL_SHOW = 'container:mediacontrol:show';
+ /**
+ * Fired when the media control hides
+ *
+ * @event CONTAINER_MEDIACONTROL_HIDE
+ */
+ Events.CONTAINER_MEDIACONTROL_HIDE = 'container:mediacontrol:hide';
+
+ Events.CONTAINER_MEDIACONTROL_DISABLE = 'container:mediacontrol:disable';
+ Events.CONTAINER_MEDIACONTROL_ENABLE = 'container:mediacontrol:enable';
+ Events.CONTAINER_STATS_ADD = 'container:stats:add';
+ /**
+ * Fired when the options were changed for the container
+ *
+ * @event CONTAINER_OPTIONS_CHANGE
+ */
+ Events.CONTAINER_OPTIONS_CHANGE = 'container:options:change';
+
+ // MediaControl Events
+ Events.MEDIACONTROL_RENDERED = 'mediacontrol:rendered';
+ /**
+ * Fired when the player enters/exit on fullscreen
+ *
+ * @event MEDIACONTROL_FULLSCREEN
+ */
+ Events.MEDIACONTROL_FULLSCREEN = 'mediacontrol:fullscreen';
+ /**
+ * Fired when the media control shows
+ *
+ * @event MEDIACONTROL_SHOW
+ */
+ Events.MEDIACONTROL_SHOW = 'mediacontrol:show';
+ /**
+ * Fired when the media control hides
+ *
+ * @event MEDIACONTROL_HIDE
+ */
+ Events.MEDIACONTROL_HIDE = 'mediacontrol:hide';
+ /**
+ * Fired when mouse enters on the seekbar
+ *
+ * @event MEDIACONTROL_MOUSEMOVE_SEEKBAR
+ * @param {Object} event
+ * the javascript event
+ */
+ Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR = 'mediacontrol:mousemove:seekbar';
+ /**
+ * Fired when mouse leaves the seekbar
+ *
+ * @event MEDIACONTROL_MOUSELEAVE_SEEKBAR
+ * @param {Object} event
+ * the javascript event
+ */
+ Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR = 'mediacontrol:mouseleave:seekbar';
+ /**
+ * Fired when the media is being played
+ *
+ * @event MEDIACONTROL_PLAYING
+ */
+ Events.MEDIACONTROL_PLAYING = 'mediacontrol:playing';
+ /**
+ * Fired when the media is not being played
+ *
+ * @event MEDIACONTROL_NOTPLAYING
+ */
+ Events.MEDIACONTROL_NOTPLAYING = 'mediacontrol:notplaying';
+ /**
+ * Fired when the container was changed
+ *
+ * @event MEDIACONTROL_CONTAINERCHANGED
+ */
+ Events.MEDIACONTROL_CONTAINERCHANGED = 'mediacontrol:containerchanged';
+
+ // Core Events
+ Events.CORE_CONTAINERS_CREATED = 'core:containers:created';
+ module.exports = exports['default'];
+
+/***/ },
+/* 6 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ module.exports = __webpack_require__(7);
+
+/***/ },
+/* 7 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _vendor = __webpack_require__(8);
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ var BOLD = 'font-weight: bold; font-size: 13px;';
+ var INFO = 'color: #006600;' + BOLD;
+ var DEBUG = 'color: #0000ff;' + BOLD;
+ var WARN = 'color: #ff8000;' + BOLD;
+ var ERROR = 'color: #ff0000;' + BOLD;
+
+ var LEVEL_DEBUG = 0;
+ var LEVEL_INFO = 1;
+ var LEVEL_WARN = 2;
+ var LEVEL_ERROR = 3;
+ var LEVEL_DISABLED = LEVEL_ERROR;
+
+ var COLORS = [DEBUG, INFO, WARN, ERROR, ERROR];
+ var DESCRIPTIONS = ['debug', 'info', 'warn', 'error', 'disabled'];
+
+ var Log = function () {
+ function Log() {
+ var _this = this;
+
+ var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LEVEL_INFO;
+ var offLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : LEVEL_DISABLED;
+
+ _classCallCheck(this, Log);
+
+ this.kibo = new _vendor.Kibo();
+ this.kibo.down(['ctrl shift d'], function () {
+ return _this.onOff();
+ });
+ this.BLACKLIST = ['timeupdate', 'playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress'];
+ this.level = level;
+ this.offLevel = offLevel;
+ }
+
+ Log.prototype.debug = function debug(klass) {
+ this.log(klass, LEVEL_DEBUG, Array.prototype.slice.call(arguments, 1));
+ };
+
+ Log.prototype.info = function info(klass) {
+ this.log(klass, LEVEL_INFO, Array.prototype.slice.call(arguments, 1));
+ };
+
+ Log.prototype.warn = function warn(klass) {
+ this.log(klass, LEVEL_WARN, Array.prototype.slice.call(arguments, 1));
+ };
+
+ Log.prototype.error = function error(klass) {
+ this.log(klass, LEVEL_ERROR, Array.prototype.slice.call(arguments, 1));
+ };
+
+ Log.prototype.onOff = function onOff() {
+ if (this.level === this.offLevel) {
+ this.level = this.previousLevel;
+ } else {
+ this.previousLevel = this.level;
+ this.level = this.offLevel;
+ }
+ // handle instances where console.log is unavailable
+ if (window.console && window.console.log) {
+ window.console.log('%c[Clappr.Log] set log level to ' + DESCRIPTIONS[this.level], WARN);
+ }
+ };
+
+ Log.prototype.level = function level(newLevel) {
+ this.level = newLevel;
+ };
+
+ Log.prototype.log = function log(klass, level, message) {
+ if (this.BLACKLIST.indexOf(message[0]) >= 0) return;
+ if (level < this.level) return;
+
+ if (!message) {
+ message = klass;
+ klass = null;
+ }
+ var color = COLORS[level];
+ var klassDescription = '';
+ if (klass) {
+ klassDescription = '[' + klass + ']';
+ }
+ if (window.console && window.console.log) {
+ window.console.log.apply(console, ['%c[' + DESCRIPTIONS[level] + ']' + klassDescription, color].concat(message));
+ }
+ };
+
+ return Log;
+ }();
+
+ exports.default = Log;
+
+
+ Log.LEVEL_DEBUG = LEVEL_DEBUG;
+ Log.LEVEL_INFO = LEVEL_INFO;
+ Log.LEVEL_WARN = LEVEL_WARN;
+ Log.LEVEL_ERROR = LEVEL_ERROR;
+
+ Log.getInstance = function () {
+ if (this._instance === undefined) {
+ this._instance = new this();
+ this._instance.previousLevel = this._instance.level;
+ this._instance.level = this._instance.offLevel;
+ }
+ return this._instance;
+ };
+
+ Log.setLevel = function (level) {
+ this.getInstance().level = level;
+ };
+
+ Log.debug = function () {
+ this.getInstance().debug.apply(this.getInstance(), arguments);
+ };
+ Log.info = function () {
+ this.getInstance().info.apply(this.getInstance(), arguments);
+ };
+ Log.warn = function () {
+ this.getInstance().warn.apply(this.getInstance(), arguments);
+ };
+ Log.error = function () {
+ this.getInstance().error.apply(this.getInstance(), arguments);
+ };
+ module.exports = exports['default'];
+
+/***/ },
+/* 8 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _kibo = __webpack_require__(9);
+
+ var _kibo2 = _interopRequireDefault(_kibo);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ exports.default = { Kibo: _kibo2.default };
+ module.exports = exports['default'];
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ /* eslint-disable */
+ // Kibo is released under the MIT License. Copyright (c) 2013 marquete.
+ // see https://github.com/marquete/kibo
+
+ var Kibo = function Kibo(element) {
+ this.element = element || window.document;
+ this.initialize();
+ };
+
+ Kibo.KEY_NAMES_BY_CODE = {
+ 8: 'backspace', 9: 'tab', 13: 'enter',
+ 16: 'shift', 17: 'ctrl', 18: 'alt',
+ 20: 'caps_lock',
+ 27: 'esc',
+ 32: 'space',
+ 37: 'left', 38: 'up', 39: 'right', 40: 'down',
+ 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7', 56: '8', 57: '9',
+ 65: 'a', 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', 73: 'i', 74: 'j',
+ 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't',
+ 85: 'u', 86: 'v', 87: 'w', 88: 'x', 89: 'y', 90: 'z', 112: 'f1', 113: 'f2', 114: 'f3',
+ 115: 'f4', 116: 'f5', 117: 'f6', 118: 'f7', 119: 'f8', 120: 'f9', 121: 'f10', 122: 'f11', 123: 'f12'
+ };
+
+ Kibo.KEY_CODES_BY_NAME = {};
+ (function () {
+ for (var key in Kibo.KEY_NAMES_BY_CODE) {
+ if (Object.prototype.hasOwnProperty.call(Kibo.KEY_NAMES_BY_CODE, key)) {
+ Kibo.KEY_CODES_BY_NAME[Kibo.KEY_NAMES_BY_CODE[key]] = +key;
+ }
+ }
+ })();
+
+ Kibo.MODIFIERS = ['shift', 'ctrl', 'alt'];
+
+ Kibo.registerEvent = function () {
+ if (document.addEventListener) {
+ return function (element, eventName, func) {
+ element.addEventListener(eventName, func, false);
+ };
+ } else if (document.attachEvent) {
+ return function (element, eventName, func) {
+ element.attachEvent('on' + eventName, func);
+ };
+ }
+ }();
+
+ Kibo.unregisterEvent = function () {
+ if (document.removeEventListener) {
+ return function (element, eventName, func) {
+ element.removeEventListener(eventName, func, false);
+ };
+ } else if (document.detachEvent) {
+ return function (element, eventName, func) {
+ element.detachEvent('on' + eventName, func);
+ };
+ }
+ }();
+
+ Kibo.stringContains = function (string, substring) {
+ return string.indexOf(substring) !== -1;
+ };
+
+ Kibo.neatString = function (string) {
+ return string.replace(/^\s+|\s+$/g, '').replace(/\s+/g, ' ');
+ };
+
+ Kibo.capitalize = function (string) {
+ return string.toLowerCase().replace(/^./, function (match) {
+ return match.toUpperCase();
+ });
+ };
+
+ Kibo.isString = function (what) {
+ return Kibo.stringContains(Object.prototype.toString.call(what), 'String');
+ };
+
+ Kibo.arrayIncludes = function () {
+ if (Array.prototype.indexOf) {
+ return function (haystack, needle) {
+ return haystack.indexOf(needle) !== -1;
+ };
+ } else {
+ return function (haystack, needle) {
+ for (var i = 0; i < haystack.length; i++) {
+ if (haystack[i] === needle) {
+ return true;
+ }
+ }
+ return false;
+ };
+ }
+ }();
+
+ Kibo.extractModifiers = function (keyCombination) {
+ var modifiers, i;
+ modifiers = [];
+ for (i = 0; i < Kibo.MODIFIERS.length; i++) {
+ if (Kibo.stringContains(keyCombination, Kibo.MODIFIERS[i])) {
+ modifiers.push(Kibo.MODIFIERS[i]);
+ }
+ }
+ return modifiers;
+ };
+
+ Kibo.extractKey = function (keyCombination) {
+ var keys, i;
+ keys = Kibo.neatString(keyCombination).split(' ');
+ for (i = 0; i < keys.length; i++) {
+ if (!Kibo.arrayIncludes(Kibo.MODIFIERS, keys[i])) {
+ return keys[i];
+ }
+ }
+ };
+
+ Kibo.modifiersAndKey = function (keyCombination) {
+ var result, key;
+
+ if (Kibo.stringContains(keyCombination, 'any')) {
+ return Kibo.neatString(keyCombination).split(' ').slice(0, 2).join(' ');
+ }
+
+ result = Kibo.extractModifiers(keyCombination);
+
+ key = Kibo.extractKey(keyCombination);
+ if (key && !Kibo.arrayIncludes(Kibo.MODIFIERS, key)) {
+ result.push(key);
+ }
+
+ return result.join(' ');
+ };
+
+ Kibo.keyName = function (keyCode) {
+ return Kibo.KEY_NAMES_BY_CODE[keyCode + ''];
+ };
+
+ Kibo.keyCode = function (keyName) {
+ return +Kibo.KEY_CODES_BY_NAME[keyName];
+ };
+
+ Kibo.prototype.initialize = function () {
+ var i,
+ that = this;
+
+ this.lastKeyCode = -1;
+ this.lastModifiers = {};
+ for (i = 0; i < Kibo.MODIFIERS.length; i++) {
+ this.lastModifiers[Kibo.MODIFIERS[i]] = false;
+ }
+
+ this.keysDown = { any: [] };
+ this.keysUp = { any: [] };
+ this.downHandler = this.handler('down');
+ this.upHandler = this.handler('up');
+
+ Kibo.registerEvent(this.element, 'keydown', this.downHandler);
+ Kibo.registerEvent(this.element, 'keyup', this.upHandler);
+ Kibo.registerEvent(window, 'unload', function unloader() {
+ Kibo.unregisterEvent(that.element, 'keydown', that.downHandler);
+ Kibo.unregisterEvent(that.element, 'keyup', that.upHandler);
+ Kibo.unregisterEvent(window, 'unload', unloader);
+ });
+ };
+
+ Kibo.prototype.handler = function (upOrDown) {
+ var that = this;
+ return function (e) {
+ var i, registeredKeys, lastModifiersAndKey;
+
+ e = e || window.event;
+
+ that.lastKeyCode = e.keyCode;
+ for (i = 0; i < Kibo.MODIFIERS.length; i++) {
+ that.lastModifiers[Kibo.MODIFIERS[i]] = e[Kibo.MODIFIERS[i] + 'Key'];
+ }
+ if (Kibo.arrayIncludes(Kibo.MODIFIERS, Kibo.keyName(that.lastKeyCode))) {
+ that.lastModifiers[Kibo.keyName(that.lastKeyCode)] = true;
+ }
+
+ registeredKeys = that['keys' + Kibo.capitalize(upOrDown)];
+
+ for (i = 0; i < registeredKeys.any.length; i++) {
+ if (registeredKeys.any[i](e) === false && e.preventDefault) {
+ e.preventDefault();
+ }
+ }
+
+ lastModifiersAndKey = that.lastModifiersAndKey();
+ if (registeredKeys[lastModifiersAndKey]) {
+ for (i = 0; i < registeredKeys[lastModifiersAndKey].length; i++) {
+ if (registeredKeys[lastModifiersAndKey][i](e) === false && e.preventDefault) {
+ e.preventDefault();
+ }
+ }
+ }
+ };
+ };
+
+ Kibo.prototype.registerKeys = function (upOrDown, newKeys, func) {
+ var i,
+ keys,
+ registeredKeys = this['keys' + Kibo.capitalize(upOrDown)];
+
+ if (Kibo.isString(newKeys)) {
+ newKeys = [newKeys];
+ }
+
+ for (i = 0; i < newKeys.length; i++) {
+ keys = newKeys[i];
+ keys = Kibo.modifiersAndKey(keys + '');
+
+ if (registeredKeys[keys]) {
+ registeredKeys[keys].push(func);
+ } else {
+ registeredKeys[keys] = [func];
+ }
+ }
+
+ return this;
+ };
+
+ // jshint maxdepth:5
+ Kibo.prototype.unregisterKeys = function (upOrDown, newKeys, func) {
+ var i,
+ j,
+ keys,
+ registeredKeys = this['keys' + Kibo.capitalize(upOrDown)];
+
+ if (Kibo.isString(newKeys)) {
+ newKeys = [newKeys];
+ }
+
+ for (i = 0; i < newKeys.length; i++) {
+ keys = newKeys[i];
+ keys = Kibo.modifiersAndKey(keys + '');
+
+ if (func === null) {
+ delete registeredKeys[keys];
+ } else {
+ if (registeredKeys[keys]) {
+ for (j = 0; j < registeredKeys[keys].length; j++) {
+ if (String(registeredKeys[keys][j]) === String(func)) {
+ registeredKeys[keys].splice(j, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return this;
+ };
+
+ Kibo.prototype.off = function (keys) {
+ return this.unregisterKeys('down', keys, null);
+ };
+
+ Kibo.prototype.delegate = function (upOrDown, keys, func) {
+ return func !== null || func !== undefined ? this.registerKeys(upOrDown, keys, func) : this.unregisterKeys(upOrDown, keys, func);
+ };
+
+ Kibo.prototype.down = function (keys, func) {
+ return this.delegate('down', keys, func);
+ };
+
+ Kibo.prototype.up = function (keys, func) {
+ return this.delegate('up', keys, func);
+ };
+
+ Kibo.prototype.lastKey = function (modifier) {
+ if (!modifier) {
+ return Kibo.keyName(this.lastKeyCode);
+ }
+
+ return this.lastModifiers[modifier];
+ };
+
+ Kibo.prototype.lastModifiersAndKey = function () {
+ var result, i;
+
+ result = [];
+ for (i = 0; i < Kibo.MODIFIERS.length; i++) {
+ if (this.lastKey(Kibo.MODIFIERS[i])) {
+ result.push(Kibo.MODIFIERS[i]);
+ }
+ }
+
+ if (!Kibo.arrayIncludes(result, this.lastKey())) {
+ result.push(this.lastKey());
+ }
+
+ return result.join(' ');
+ };
+
+ exports.default = Kibo;
+ module.exports = exports['default'];
+
+/***/ },
+/* 10 */
+/***/ function(module, exports) {
+
+ /**
+ * lodash (Custom Build)
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright jQuery Foundation and other contributors
+ * Released under MIT license
+ * Based on Underscore.js 1.8.3
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ */
+
+ /** Used as the `TypeError` message for "Functions" methods. */
+ var FUNC_ERROR_TEXT = 'Expected a function';
+
+ /** Used as references for various `Number` constants. */
+ var INFINITY = 1 / 0,
+ MAX_INTEGER = 1.7976931348623157e+308,
+ NAN = 0 / 0;
+
+ /** `Object#toString` result references. */
+ var symbolTag = '[object Symbol]';
+
+ /** Used to match leading and trailing whitespace. */
+ var reTrim = /^\s+|\s+$/g;
+
+ /** Used to detect bad signed hexadecimal string values. */
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+ /** Used to detect binary string values. */
+ var reIsBinary = /^0b[01]+$/i;
+
+ /** Used to detect octal string values. */
+ var reIsOctal = /^0o[0-7]+$/i;
+
+ /** Built-in method references without a dependency on `root`. */
+ var freeParseInt = parseInt;
+
+ /** Used for built-in method references. */
+ var objectProto = Object.prototype;
+
+ /**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+ var objectToString = objectProto.toString;
+
+ /**
+ * Creates a function that invokes `func`, with the `this` binding and arguments
+ * of the created function, while it's called less than `n` times. Subsequent
+ * calls to the created function return the result of the last `func` invocation.
+ *
+ * @static
+ * @memberOf _
+ * @since 3.0.0
+ * @category Function
+ * @param {number} n The number of calls at which `func` is no longer invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * jQuery(element).on('click', _.before(5, addContactToList));
+ * // => Allows adding up to 4 contacts to the list.
+ */
+ function before(n, func) {
+ var result;
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ n = toInteger(n);
+ return function() {
+ if (--n > 0) {
+ result = func.apply(this, arguments);
+ }
+ if (n <= 1) {
+ func = undefined;
+ }
+ return result;
+ };
+ }
+
+ /**
+ * Creates a function that is restricted to invoking `func` once. Repeat calls
+ * to the function return the value of the first invocation. The `func` is
+ * invoked with the `this` binding and arguments of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var initialize = _.once(createApplication);
+ * initialize();
+ * initialize();
+ * // => `createApplication` is invoked once
+ */
+ function once(func) {
+ return before(2, func);
+ }
+
+ /**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+ function isObject(value) {
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+ }
+
+ /**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+ function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+ }
+
+ /**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+ function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
+ }
+
+ /**
+ * Converts `value` to a finite number.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.12.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted number.
+ * @example
+ *
+ * _.toFinite(3.2);
+ * // => 3.2
+ *
+ * _.toFinite(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toFinite(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toFinite('3.2');
+ * // => 3.2
+ */
+ function toFinite(value) {
+ if (!value) {
+ return value === 0 ? value : 0;
+ }
+ value = toNumber(value);
+ if (value === INFINITY || value === -INFINITY) {
+ var sign = (value < 0 ? -1 : 1);
+ return sign * MAX_INTEGER;
+ }
+ return value === value ? value : 0;
+ }
+
+ /**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This method is loosely based on
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3.2);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3.2');
+ * // => 3
+ */
+ function toInteger(value) {
+ var result = toFinite(value),
+ remainder = result % 1;
+
+ return result === result ? (remainder ? result - remainder : result) : 0;
+ }
+
+ /**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3.2);
+ * // => 3.2
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3.2');
+ * // => 3.2
+ */
+ function toNumber(value) {
+ if (typeof value == 'number') {
+ return value;
+ }
+ if (isSymbol(value)) {
+ return NAN;
+ }
+ if (isObject(value)) {
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
+ value = isObject(other) ? (other + '') : other;
+ }
+ if (typeof value != 'string') {
+ return value === 0 ? value : +value;
+ }
+ value = value.replace(reTrim, '');
+ var isBinary = reIsBinary.test(value);
+ return (isBinary || reIsOctal.test(value))
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : (reIsBadHex.test(value) ? NAN : +value);
+ }
+
+ module.exports = once;
+
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ module.exports = __webpack_require__(12);
+
+/***/ },
+/* 12 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _base_object = __webpack_require__(4);
+
+ var _base_object2 = _interopRequireDefault(_base_object);
+
+ var _core = __webpack_require__(13);
+
+ var _core2 = _interopRequireDefault(_core);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ /**
+ * The Core Factory is responsible for instantiate the core and it's plugins.
+ * @class CoreFactory
+ * @constructor
+ * @extends BaseObject
+ * @module components
+ */
+ var CoreFactory = function (_BaseObject) {
+ _inherits(CoreFactory, _BaseObject);
+
+ _createClass(CoreFactory, [{
+ key: 'loader',
+ get: function get() {
+ return this.player.loader;
+ }
+
+ /**
+ * it builds the core factory
+ * @method constructor
+ * @param {Player} player the player object
+ */
+
+ }]);
+
+ function CoreFactory(player) {
+ _classCallCheck(this, CoreFactory);
+
+ var _this = _possibleConstructorReturn(this, _BaseObject.call(this));
+
+ _this.player = player;
+ _this._options = player.options;
+ return _this;
+ }
+
+ /**
+ * creates a core and its plugins
+ * @method create
+ * @return {Core} created core
+ */
+
+
+ CoreFactory.prototype.create = function create() {
+ this.options.loader = this.loader;
+ this.core = new _core2.default(this.options);
+ this.addCorePlugins();
+ this.core.createContainers(this.options);
+ return this.core;
+ };
+
+ /**
+ * given the core plugins (`loader.corePlugins`) it builds each one
+ * @method addCorePlugins
+ * @return {Core} the core with all plugins
+ */
+
+
+ CoreFactory.prototype.addCorePlugins = function addCorePlugins() {
+ var _this2 = this;
+
+ this.loader.corePlugins.forEach(function (Plugin) {
+ var plugin = new Plugin(_this2.core);
+ _this2.core.addPlugin(plugin);
+ _this2.setupExternalInterface(plugin);
+ });
+ return this.core;
+ };
+
+ CoreFactory.prototype.setupExternalInterface = function setupExternalInterface(plugin) {
+ var externalFunctions = plugin.getExternalInterface();
+ for (var key in externalFunctions) {
+ this.player[key] = externalFunctions[key].bind(plugin);
+ }
+ };
+
+ return CoreFactory;
+ }(_base_object2.default);
+
+ exports.default = CoreFactory;
+ module.exports = exports['default'];
+
+/***/ },
+/* 13 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ module.exports = __webpack_require__(14);
+
+/***/ },
+/* 14 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+ var _utils = __webpack_require__(2);
+
+ var _events = __webpack_require__(5);
+
+ var _events2 = _interopRequireDefault(_events);
+
+ var _styler = __webpack_require__(15);
+
+ var _styler2 = _interopRequireDefault(_styler);
+
+ var _ui_object = __webpack_require__(18);
+
+ var _ui_object2 = _interopRequireDefault(_ui_object);
+
+ var _browser = __webpack_require__(3);
+
+ var _browser2 = _interopRequireDefault(_browser);
+
+ var _container_factory = __webpack_require__(20);
+
+ var _container_factory2 = _interopRequireDefault(_container_factory);
+
+ var _media_control = __webpack_require__(27);
+
+ var _media_control2 = _interopRequireDefault(_media_control);
+
+ var _mediator = __webpack_require__(30);
+
+ var _mediator2 = _interopRequireDefault(_mediator);
+
+ var _player_info = __webpack_require__(45);
+
+ var _player_info2 = _interopRequireDefault(_player_info);
+
+ var _clapprZepto = __webpack_require__(16);
+
+ var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
+
+ var _style = __webpack_require__(46);
+
+ var _style2 = _interopRequireDefault(_style);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ /**
+ * The Core is responsible to manage Containers, the mediator, MediaControl
+ * and the player state.
+ * @class Core
+ * @constructor
+ * @extends UIObject
+ * @module components
+ */
+ var Core = function (_UIObject) {
+ _inherits(Core, _UIObject);
+
+ _createClass(Core, [{
+ key: 'events',
+ get: function get() {
+ return {
+ 'webkitfullscreenchange': 'handleFullscreenChange',
+ 'mousemove': 'showMediaControl',
+ 'mouseleave': 'hideMediaControl'
+ };
+ }
+ }, {
+ key: 'attributes',
+ get: function get() {
+ return {
+ 'data-player': '',
+ tabindex: 9999
+ };
+ }
+
+ /**
+ * checks if the core is ready.
+ * @property isReady
+ * @type {Boolean} `true` if the core is ready, otherwise `false`
+ */
+
+ }, {
+ key: 'isReady',
+ get: function get() {
+ return !!this.ready;
+ }
+
+ /**
+ * The internationalization plugin.
+ * @property i18n
+ * @type {Strings}
+ */
+
+ }, {
+ key: 'i18n',
+ get: function get() {
+ return this.getPlugin('strings') || { t: function t(key) {
+ return key;
+ } };
+ }
+ }]);
+
+ function Core(options) {
+ _classCallCheck(this, Core);
+
+ var _this = _possibleConstructorReturn(this, _UIObject.call(this, options));
+
+ _this.playerInfo = _player_info2.default.getInstance(options.playerId);
+ _this.firstResize = true;
+ _this.plugins = [];
+ _this.containers = [];
+ _this.setupMediaControl(null);
+ //FIXME fullscreen api sucks
+ _this._boundFullscreenHandler = function () {
+ return _this.handleFullscreenChange();
+ };
+ (0, _clapprZepto2.default)(document).bind('fullscreenchange', _this._boundFullscreenHandler);
+ (0, _clapprZepto2.default)(document).bind('MSFullscreenChange', _this._boundFullscreenHandler);
+ (0, _clapprZepto2.default)(document).bind('mozfullscreenchange', _this._boundFullscreenHandler);
+ return _this;
+ }
+
+ Core.prototype.createContainers = function createContainers(options) {
+ var _this2 = this;
+
+ this.defer = _clapprZepto2.default.Deferred();
+ this.defer.promise(this);
+ this.containerFactory = new _container_factory2.default(options, options.loader, this.i18n);
+ this.containerFactory.createContainers().then(function (containers) {
+ return _this2.setupContainers(containers);
+ }).then(function (containers) {
+ return _this2.resolveOnContainersReady(containers);
+ });
+ };
+
+ Core.prototype.updateSize = function updateSize() {
+ if (_utils.Fullscreen.isFullscreen()) {
+ this.setFullscreen();
+ } else {
+ this.setPlayerSize();
+ }
+ };
+
+ Core.prototype.setFullscreen = function setFullscreen() {
+ if (!_browser2.default.isiOS) {
+ this.$el.addClass('fullscreen');
+ this.$el.removeAttr('style');
+ this.playerInfo.previousSize = { width: this.options.width, height: this.options.height };
+ this.playerInfo.currentSize = { width: (0, _clapprZepto2.default)(window).width(), height: (0, _clapprZepto2.default)(window).height() };
+ }
+ };
+
+ Core.prototype.setPlayerSize = function setPlayerSize() {
+ this.$el.removeClass('fullscreen');
+ this.playerInfo.currentSize = this.playerInfo.previousSize;
+ this.playerInfo.previousSize = { width: (0, _clapprZepto2.default)(window).width(), height: (0, _clapprZepto2.default)(window).height() };
+ this.resize(this.playerInfo.currentSize);
+ };
+
+ Core.prototype.resize = function resize(options) {
+ if (!(0, _utils.isNumber)(options.height) && !(0, _utils.isNumber)(options.width)) {
+ this.el.style.height = '' + options.height;
+ this.el.style.width = '' + options.width;
+ } else {
+ this.el.style.height = options.height + 'px';
+ this.el.style.width = options.width + 'px';
+ }
+ this.playerInfo.previousSize = { width: this.options.width, height: this.options.height };
+ this.options.width = options.width;
+ this.options.height = options.height;
+ this.playerInfo.currentSize = options;
+ this.triggerResize(this.playerInfo.currentSize);
+ };
+
+ Core.prototype.enableResizeObserver = function enableResizeObserver() {
+ var _this3 = this;
+
+ var checkSizeCallback = function checkSizeCallback() {
+ if (_this3.playerInfo.computedSize.width != _this3.el.clientWidth || _this3.playerInfo.computedSize.height != _this3.el.clientHeight) {
+ _this3.playerInfo.computedSize = { width: _this3.el.clientWidth, height: _this3.el.clientHeight };
+ _this3.triggerResize(_this3.playerInfo.computedSize);
+ }
+ };
+ this.resizeObserverInterval = setInterval(checkSizeCallback, 500);
+ };
+
+ Core.prototype.triggerResize = function triggerResize(newSize) {
+ var thereWasChange = this.firstResize || this.oldHeight !== newSize.height || this.oldWidth !== newSize.width;
+ if (thereWasChange) {
+ _mediator2.default.trigger(this.options.playerId + ':' + _events2.default.PLAYER_RESIZE, newSize);
+ this.oldHeight = newSize.height;
+ this.oldWidth = newSize.width;
+ this.firstResize = false;
+ }
+ };
+
+ Core.prototype.disableResizeObserver = function disableResizeObserver() {
+ if (this.resizeObserverInterval) clearInterval(this.resizeObserverInterval);
+ };
+
+ Core.prototype.resolveOnContainersReady = function resolveOnContainersReady(containers) {
+ var _this4 = this;
+
+ _clapprZepto2.default.when.apply(_clapprZepto2.default, containers).done(function () {
+ _this4.defer.resolve(_this4);
+ _this4.ready = true;
+ _this4.trigger(_events2.default.CORE_READY);
+ });
+ };
+
+ Core.prototype.addPlugin = function addPlugin(plugin) {
+ this.plugins.push(plugin);
+ };
+
+ Core.prototype.hasPlugin = function hasPlugin(name) {
+ return !!this.getPlugin(name);
+ };
+
+ Core.prototype.getPlugin = function getPlugin(name) {
+ return this.plugins.filter(function (plugin) {
+ return plugin.name === name;
+ })[0];
+ };
+
+ Core.prototype.load = function load(sources, mimeType) {
+ var _this5 = this;
+
+ this.options.mimeType = mimeType;
+ sources = sources && sources.constructor === Array ? sources : [sources];
+ this.containers.forEach(function (container) {
+ return container.destroy();
+ });
+ this.mediaControl.container = null;
+ this.containerFactory.options = _clapprZepto2.default.extend(this.options, { sources: sources });
+ this.containerFactory.createContainers().then(function (containers) {
+ _this5.setupContainers(containers);
+ });
+ };
+
+ Core.prototype.destroy = function destroy() {
+ this.disableResizeObserver();
+ this.containers.forEach(function (container) {
+ return container.destroy();
+ });
+ this.plugins.forEach(function (plugin) {
+ return plugin.destroy();
+ });
+ this.$el.remove();
+ this.mediaControl.destroy();
+ (0, _clapprZepto2.default)(document).unbind('fullscreenchange', this._boundFullscreenHandler);
+ (0, _clapprZepto2.default)(document).unbind('MSFullscreenChange', this._boundFullscreenHandler);
+ (0, _clapprZepto2.default)(document).unbind('mozfullscreenchange', this._boundFullscreenHandler);
+ };
+
+ Core.prototype.handleFullscreenChange = function handleFullscreenChange() {
+ this.trigger(_events2.default.CORE_FULLSCREEN, _utils.Fullscreen.isFullscreen());
+ this.updateSize();
+ this.mediaControl.show();
+ };
+
+ Core.prototype.setMediaControlContainer = function setMediaControlContainer(container) {
+ this.mediaControl.setContainer(container);
+ this.mediaControl.render();
+ };
+
+ Core.prototype.disableMediaControl = function disableMediaControl() {
+ this.mediaControl.disable();
+ this.$el.removeClass('nocursor');
+ };
+
+ Core.prototype.enableMediaControl = function enableMediaControl() {
+ this.mediaControl.enable();
+ };
+
+ Core.prototype.removeContainer = function removeContainer(container) {
+ this.stopListening(container);
+ this.containers = this.containers.filter(function (c) {
+ return c !== container;
+ });
+ };
+
+ Core.prototype.appendContainer = function appendContainer(container) {
+ this.listenTo(container, _events2.default.CONTAINER_DESTROYED, this.removeContainer);
+ this.containers.push(container);
+ };
+
+ Core.prototype.setupContainers = function setupContainers(containers) {
+ containers.map(this.appendContainer.bind(this));
+ this.trigger(_events2.default.CORE_CONTAINERS_CREATED);
+ this.renderContainers();
+ this.setupMediaControl(this.getCurrentContainer());
+ this.render();
+ this.$el.appendTo(this.options.parentElement);
+ return this.containers;
+ };
+
+ Core.prototype.renderContainers = function renderContainers() {
+ var _this6 = this;
+
+ this.containers.map(function (container) {
+ return _this6.el.appendChild(container.render().el);
+ });
+ };
+
+ Core.prototype.createContainer = function createContainer(source, options) {
+ var container = this.containerFactory.createContainer(source, options);
+ this.appendContainer(container);
+ this.el.appendChild(container.render().el);
+ return container;
+ };
+
+ Core.prototype.setupMediaControl = function setupMediaControl(container) {
+ if (this.mediaControl) {
+ this.mediaControl.setContainer(container);
+ } else {
+ this.mediaControl = this.createMediaControl(_clapprZepto2.default.extend({ container: container, focusElement: this.el }, this.options));
+ this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_FULLSCREEN, this.toggleFullscreen);
+ this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_SHOW, this.onMediaControlShow.bind(this, true));
+ this.listenTo(this.mediaControl, _events2.default.MEDIACONTROL_HIDE, this.onMediaControlShow.bind(this, false));
+ }
+ };
+
+ Core.prototype.createMediaControl = function createMediaControl(options) {
+ if (options.mediacontrol && options.mediacontrol.external) {
+ return new options.mediacontrol.external(options).render();
+ } else {
+ return new _media_control2.default(options).render();
+ }
+ };
+
+ Core.prototype.getCurrentContainer = function getCurrentContainer() {
+ if (!this.mediaControl || !this.mediaControl.container) {
+ return this.containers[0];
+ }
+ return this.mediaControl.container;
+ };
+
+ Core.prototype.getCurrentPlayback = function getCurrentPlayback() {
+ var container = this.getCurrentContainer();
+ return container && container.playback;
+ };
+
+ Core.prototype.getPlaybackType = function getPlaybackType() {
+ var container = this.getCurrentContainer();
+ return container && container.getPlaybackType();
+ };
+
+ Core.prototype.toggleFullscreen = function toggleFullscreen() {
+ if (!_utils.Fullscreen.isFullscreen()) {
+ _utils.Fullscreen.requestFullscreen(this.el);
+ if (!_browser2.default.isiOS) {
+ this.$el.addClass('fullscreen');
+ }
+ } else {
+ _utils.Fullscreen.cancelFullscreen();
+ if (!_browser2.default.isiOS) {
+ this.$el.removeClass('fullscreen nocursor');
+ }
+ }
+ this.mediaControl.show();
+ };
+
+ Core.prototype.showMediaControl = function showMediaControl(event) {
+ this.mediaControl.show(event);
+ };
+
+ Core.prototype.hideMediaControl = function hideMediaControl() {
+ this.mediaControl.hide(this.options.hideMediaControlDelay);
+ };
+
+ Core.prototype.onMediaControlShow = function onMediaControlShow(showing) {
+ this.getCurrentContainer().trigger(showing ? _events2.default.CONTAINER_MEDIACONTROL_SHOW : _events2.default.CONTAINER_MEDIACONTROL_HIDE);
+
+ if (showing) this.$el.removeClass('nocursor');else if (_utils.Fullscreen.isFullscreen()) this.$el.addClass('nocursor');
+ };
+
+ /**
+ * enables to configure the container after its creation
+ * @method configure
+ * @param {Object} options all the options to change in form of a javascript object
+ */
+
+
+ Core.prototype.configure = function configure(options) {
+ var _this7 = this;
+
+ this._options = _clapprZepto2.default.extend(this._options, options);
+ var sources = options.source || options.sources;
+
+ if (sources) {
+ this.load(sources, options.mimeType || this.options.mimeType);
+ } else {
+ this.trigger(_events2.default.CORE_OPTIONS_CHANGE);
+
+ this.containers.forEach(function (container) {
+ container.configure(_this7.options);
+ });
+ }
+ };
+
+ Core.prototype.render = function render() {
+ var style = _styler2.default.getStyleFor(_style2.default, { baseUrl: this.options.baseUrl });
+ this.$el.append(style);
+ this.$el.append(this.mediaControl.render().el);
+
+ this.options.width = this.options.width || this.$el.width();
+ this.options.height = this.options.height || this.$el.height();
+ var size = { width: this.options.width, height: this.options.height };
+ this.playerInfo.previousSize = this.playerInfo.currentSize = this.playerInfo.computedSize = size;
+ this.updateSize();
+
+ this.previousSize = { width: this.$el.width(), height: this.$el.height() };
+
+ this.enableResizeObserver();
+
+ return this;
+ };
+
+ return Core;
+ }(_ui_object2.default);
+
+ exports.default = Core;
+ module.exports = exports['default'];
+
+/***/ },
+/* 15 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _clapprZepto = __webpack_require__(16);
+
+ var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
+
+ var _template = __webpack_require__(17);
+
+ var _template2 = _interopRequireDefault(_template);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ // Copyright 2014 Globo.com Player authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+ var Styler = {
+ getStyleFor: function getStyleFor(style) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { baseUrl: '' };
+
+ return (0, _clapprZepto2.default)('').html((0, _template2.default)(style.toString())(options));
+ }
+ };
+
+ exports.default = Styler;
+ module.exports = exports['default'];
+
+/***/ },
+/* 16 */
+/***/ function(module, exports) {
+
+ /* Zepto v1.1.4-80-ga9184b2 - zepto event ajax callbacks deferred touch selector ie - zeptojs.com/license */
+ var Zepto=function(){function D(t){return null==t?String(t):j[S.call(t)]||"object"}function L(t){return"function"==D(t)}function k(t){return null!=t&&t==t.window}function Z(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function $(t){return"object"==D(t)}function F(t){return $(t)&&!k(t)&&Object.getPrototypeOf(t)==Object.prototype}function R(t){return"number"==typeof t.length}function q(t){return s.call(t,function(t){return null!=t})}function W(t){return t.length>0?n.fn.concat.apply([],t):t}function z(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function H(t){return t in c?c[t]:c[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function _(t,e){return"number"!=typeof e||l[z(t)]?e:e+"px"}function I(t){var e,n;return f[t]||(e=u.createElement(t),u.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),f[t]=n),f[t]}function U(t){return"children"in t?a.call(t.children):n.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function X(t,e){var n,i=t?t.length:0;for(n=0;i>n;n++)this[n]=t[n];this.length=i,this.selector=e||""}function B(n,i,r){for(e in i)r&&(F(i[e])||A(i[e]))?(F(i[e])&&!F(n[e])&&(n[e]={}),A(i[e])&&!A(n[e])&&(n[e]=[]),B(n[e],i[e],r)):i[e]!==t&&(n[e]=i[e])}function V(t,e){return null==e?n(t):n(t).filter(e)}function Y(t,e,n,i){return L(e)?e.call(t,n,i):e}function J(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function G(e,n){var i=e.className||"",r=i&&i.baseVal!==t;return n===t?r?i.baseVal:i:void(r?i.baseVal=n:e.className=n)}function K(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?n.parseJSON(t):t):t}catch(e){return t}}function Q(t,e){e(t);for(var n=0,i=t.childNodes.length;i>n;n++)Q(t.childNodes[n],e)}var t,e,n,i,N,P,r=[],o=r.concat,s=r.filter,a=r.slice,u=window.document,f={},c={},l={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},h=/^\s*<(\w+|!)[^>]*>/,p=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,d=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,m=/^(?:body|html)$/i,g=/([A-Z])/g,v=["val","css","html","text","data","width","height","offset"],y=["after","prepend","before","append"],w=u.createElement("table"),x=u.createElement("tr"),b={tr:u.createElement("tbody"),tbody:w,thead:w,tfoot:w,td:x,th:x,"*":u.createElement("div")},E=/complete|loaded|interactive/,T=/^[\w-]*$/,j={},S=j.toString,C={},O=u.createElement("div"),M={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},A=Array.isArray||function(t){return t instanceof Array};return C.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=O).appendChild(t),i=~C.qsa(r,e).indexOf(t),o&&O.removeChild(t),i},N=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},P=function(t){return s.call(t,function(e,n){return t.indexOf(e)==n})},C.fragment=function(e,i,r){var o,s,f;return p.test(e)&&(o=n(u.createElement(RegExp.$1))),o||(e.replace&&(e=e.replace(d,"<$1>$2>")),i===t&&(i=h.test(e)&&RegExp.$1),i in b||(i="*"),f=b[i],f.innerHTML=""+e,o=n.each(a.call(f.childNodes),function(){f.removeChild(this)})),F(r)&&(s=n(o),n.each(r,function(t,e){v.indexOf(t)>-1?s[t](e):s.attr(t,e)})),o},C.Z=function(t,e){return new X(t,e)},C.isZ=function(t){return t instanceof C.Z},C.init=function(e,i){var r;if(!e)return C.Z();if("string"==typeof e)if(e=e.trim(),"<"==e[0]&&h.test(e))r=C.fragment(e,RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=C.qsa(u,e)}else{if(L(e))return n(u).ready(e);if(C.isZ(e))return e;if(A(e))r=q(e);else if($(e))r=[e],e=null;else if(h.test(e))r=C.fragment(e.trim(),RegExp.$1,i),e=null;else{if(i!==t)return n(i).find(e);r=C.qsa(u,e)}}return C.Z(r,e)},n=function(t,e){return C.init(t,e)},n.extend=function(t){var e,n=a.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){B(t,n,e)}),t},C.qsa=function(t,e){var n,i="#"==e[0],r=!i&&"."==e[0],o=i||r?e.slice(1):e,s=T.test(o);return t.getElementById&&s&&i?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:a.call(s&&!i&&t.getElementsByClassName?r?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},n.contains=u.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},n.type=D,n.isFunction=L,n.isWindow=k,n.isArray=A,n.isPlainObject=F,n.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},n.inArray=function(t,e,n){return r.indexOf.call(e,t,n)},n.camelCase=N,n.trim=function(t){return null==t?"":String.prototype.trim.call(t)},n.uuid=0,n.support={},n.expr={},n.noop=function(){},n.map=function(t,e){var n,r,o,i=[];if(R(t))for(r=0;r=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return r.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return L(t)?this.not(this.not(t)):n(s.call(this,function(e){return C.matches(e,t)}))},add:function(t,e){return n(P(this.concat(n(t,e))))},is:function(t){return this.length>0&&C.matches(this[0],t)},not:function(e){var i=[];if(L(e)&&e.call!==t)this.each(function(t){e.call(this,t)||i.push(this)});else{var r="string"==typeof e?this.filter(e):R(e)&&L(e.item)?a.call(e):n(e);this.forEach(function(t){r.indexOf(t)<0&&i.push(t)})}return n(i)},has:function(t){return this.filter(function(){return $(t)?n.contains(this,t):n(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!$(t)?t:n(t)},last:function(){var t=this[this.length-1];return t&&!$(t)?t:n(t)},find:function(t){var e,i=this;return e=t?"object"==typeof t?n(t).filter(function(){var t=this;return r.some.call(i,function(e){return n.contains(e,t)})}):1==this.length?n(C.qsa(this[0],t)):this.map(function(){return C.qsa(this,t)}):n()},closest:function(t,e){var i=this[0],r=!1;for("object"==typeof t&&(r=n(t));i&&!(r?r.indexOf(i)>=0:C.matches(i,t));)i=i!==e&&!Z(i)&&i.parentNode;return n(i)},parents:function(t){for(var e=[],i=this;i.length>0;)i=n.map(i,function(t){return(t=t.parentNode)&&!Z(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return V(e,t)},parent:function(t){return V(P(this.pluck("parentNode")),t)},children:function(t){return V(this.map(function(){return U(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||a.call(this.childNodes)})},siblings:function(t){return V(this.map(function(t,e){return s.call(U(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return n.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=I(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var e=L(t);if(this[0]&&!e)var i=n(t).get(0),r=i.parentNode||this.length>1;return this.each(function(o){n(this).wrapAll(e?t.call(this,o):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){n(this[0]).before(t=n(t));for(var e;(e=t.children()).length;)t=e.first();n(t).append(this)}return this},wrapInner:function(t){var e=L(t);return this.each(function(i){var r=n(this),o=r.contents(),s=e?t.call(this,i):t;o.length?o.wrapAll(s):r.append(s)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var i=n(this);(e===t?"none"==i.css("display"):e)?i.show():i.hide()})},prev:function(t){return n(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return n(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var i=this.innerHTML;n(this).empty().append(Y(this,t,e,i))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=Y(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this[0].textContent:null},attr:function(n,i){var r;return"string"!=typeof n||1 in arguments?this.each(function(t){if(1===this.nodeType)if($(n))for(e in n)J(this,e,n[e]);else J(this,n,Y(this,i,t,this.getAttribute(n)))}):this.length&&1===this[0].nodeType?!(r=this[0].getAttribute(n))&&n in this[0]?this[0][n]:r:t},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){J(this,t)},this)})},prop:function(t,e){return t=M[t]||t,1 in arguments?this.each(function(n){this[t]=Y(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(e,n){var i="data-"+e.replace(g,"-$1").toLowerCase(),r=1 in arguments?this.attr(i,n):this.attr(i);return null!==r?K(r):t},val:function(t){return 0 in arguments?this.each(function(e){this.value=Y(this,t,e,this.value)}):this[0]&&(this[0].multiple?n(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var i=n(this),r=Y(this,t,e,i.offset()),o=i.offsetParent().offset(),s={top:r.top-o.top,left:r.left-o.left};"static"==i.css("position")&&(s.position="relative"),i.css(s)});if(!this.length)return null;if(!n.contains(u.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(t,i){if(arguments.length<2){var r,o=this[0];if(!o)return;if(r=getComputedStyle(o,""),"string"==typeof t)return o.style[N(t)]||r.getPropertyValue(t);if(A(t)){var s={};return n.each(t,function(t,e){s[e]=o.style[N(e)]||r.getPropertyValue(e)}),s}}var a="";if("string"==D(t))i||0===i?a=z(t)+":"+_(t,i):this.each(function(){this.style.removeProperty(z(t))});else for(e in t)t[e]||0===t[e]?a+=z(e)+":"+_(e,t[e])+";":this.each(function(){this.style.removeProperty(z(e))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(n(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?r.some.call(this,function(t){return this.test(G(t))},H(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){i=[];var r=G(this),o=Y(this,t,e,r);o.split(/\s+/g).forEach(function(t){n(this).hasClass(t)||i.push(t)},this),i.length&&G(this,r+(r?" ":"")+i.join(" "))}}):this},removeClass:function(e){return this.each(function(n){if("className"in this){if(e===t)return G(this,"");i=G(this),Y(this,e,n,i).split(/\s+/g).forEach(function(t){i=i.replace(H(t)," ")}),G(this,i.trim())}})},toggleClass:function(e,i){return e?this.each(function(r){var o=n(this),s=Y(this,e,r,G(this));s.split(/\s+/g).forEach(function(e){(i===t?!o.hasClass(e):i)?o.addClass(e):o.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var n="scrollTop"in this[0];return e===t?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var n="scrollLeft"in this[0];return e===t?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),i=this.offset(),r=m.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(n(t).css("margin-top"))||0,i.left-=parseFloat(n(t).css("margin-left"))||0,r.top+=parseFloat(n(e[0]).css("border-top-width"))||0,r.left+=parseFloat(n(e[0]).css("border-left-width"))||0,{top:i.top-r.top,left:i.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||u.body;t&&!m.test(t.nodeName)&&"static"==n(t).css("position");)t=t.offsetParent;return t})}},n.fn.detach=n.fn.remove,["width","height"].forEach(function(e){var i=e.replace(/./,function(t){return t[0].toUpperCase()});n.fn[e]=function(r){var o,s=this[0];return r===t?k(s)?s["inner"+i]:Z(s)?s.documentElement["scroll"+i]:(o=this.offset())&&o[e]:this.each(function(t){s=n(this),s.css(e,Y(this,r,t,s[e]()))})}}),y.forEach(function(t,e){var i=e%2;n.fn[t]=function(){var t,o,r=n.map(arguments,function(e){return t=D(e),"object"==t||"array"==t||null==e?e:C.fragment(e)}),s=this.length>1;return r.length<1?this:this.each(function(t,a){o=i?a:a.parentNode,a=0==e?a.nextSibling:1==e?a.firstChild:2==e?a:null;var f=n.contains(u.documentElement,o);r.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!o)return n(t).remove();o.insertBefore(t,a),f&&Q(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},n.fn[i?t+"To":"insert"+(e?"Before":"After")]=function(e){return n(e)[t](this),this}}),C.Z.prototype=X.prototype=n.fn,C.uniq=P,C.deserializeValue=K,n.zepto=C,n}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(t){function l(t){return t._zid||(t._zid=e++)}function h(t,e,n,i){if(e=p(e),e.ns)var r=d(e.ns);return(s[l(t)]||[]).filter(function(t){return!(!t||e.e&&t.e!=e.e||e.ns&&!r.test(t.ns)||n&&l(t.fn)!==l(n)||i&&t.sel!=i)})}function p(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function d(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function m(t,e){return t.del&&!u&&t.e in f||!!e}function g(t){return c[t]||u&&f[t]||t}function v(e,i,r,o,a,u,f){var h=l(e),d=s[h]||(s[h]=[]);i.split(/\s/).forEach(function(i){if("ready"==i)return t(document).ready(r);var s=p(i);s.fn=r,s.sel=a,s.e in c&&(r=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?s.fn.apply(this,arguments):void 0}),s.del=u;var l=u||r;s.proxy=function(t){if(t=T(t),!t.isImmediatePropagationStopped()){t.data=o;var i=l.apply(e,t._args==n?[t]:[t].concat(t._args));return i===!1&&(t.preventDefault(),t.stopPropagation()),i}},s.i=d.length,d.push(s),"addEventListener"in e&&e.addEventListener(g(s.e),s.proxy,m(s,f))})}function y(t,e,n,i,r){var o=l(t);(e||"").split(/\s/).forEach(function(e){h(t,e,n,i).forEach(function(e){delete s[o][e.i],"removeEventListener"in t&&t.removeEventListener(g(e.e),e.proxy,m(e,r))})})}function T(e,i){return(i||!e.isDefaultPrevented)&&(i||(i=e),t.each(E,function(t,n){var r=i[t];e[t]=function(){return this[n]=w,r&&r.apply(i,arguments)},e[n]=x}),(i.defaultPrevented!==n?i.defaultPrevented:"returnValue"in i?i.returnValue===!1:i.getPreventDefault&&i.getPreventDefault())&&(e.isDefaultPrevented=w)),e}function j(t){var e,i={originalEvent:t};for(e in t)b.test(e)||t[e]===n||(i[e]=t[e]);return T(i,t)}var n,e=1,i=Array.prototype.slice,r=t.isFunction,o=function(t){return"string"==typeof t},s={},a={},u="onfocusin"in window,f={focus:"focusin",blur:"focusout"},c={mouseenter:"mouseover",mouseleave:"mouseout"};a.click=a.mousedown=a.mouseup=a.mousemove="MouseEvents",t.event={add:v,remove:y},t.proxy=function(e,n){var s=2 in arguments&&i.call(arguments,2);if(r(e)){var a=function(){return e.apply(n,s?s.concat(i.call(arguments)):arguments)};return a._zid=l(e),a}if(o(n))return s?(s.unshift(e[n],e),t.proxy.apply(null,s)):t.proxy(e[n],e);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,i){return this.on(t,e,n,i,1)};var w=function(){return!0},x=function(){return!1},b=/^([A-Z]|returnValue$|layer[XY]$)/,E={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,s,a,u,f){var c,l,h=this;return e&&!o(e)?(t.each(e,function(t,e){h.on(t,s,a,e,f)}),h):(o(s)||r(u)||u===!1||(u=a,a=s,s=n),(u===n||a===!1)&&(u=a,a=n),u===!1&&(u=x),h.each(function(n,r){f&&(c=function(t){return y(r,t.type,u),u.apply(this,arguments)}),s&&(l=function(e){var n,o=t(e.target).closest(s,r).get(0);return o&&o!==r?(n=t.extend(j(e),{currentTarget:o,liveFired:r}),(c||u).apply(o,[n].concat(i.call(arguments,1)))):void 0}),v(r,e,u,a,s,l||c)}))},t.fn.off=function(e,i,s){var a=this;return e&&!o(e)?(t.each(e,function(t,e){a.off(t,i,e)}),a):(o(i)||r(s)||s===!1||(s=i,i=n),s===!1&&(s=x),a.each(function(){y(this,e,s,i)}))},t.fn.trigger=function(e,n){return e=o(e)||t.isPlainObject(e)?t.Event(e):T(e),e._args=n,this.each(function(){e.type in f&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,n){var i,r;return this.each(function(s,a){i=j(o(e)?t.Event(e):e),i._args=n,i.target=a,t.each(h(a,e.type||e),function(t,e){return r=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),r},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){o(t)||(e=t,t=e.type);var n=document.createEvent(a[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),T(n)}}(Zepto),function(t){function h(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.isDefaultPrevented()}function p(t,e,i,r){return t.global?h(e||n,i,r):void 0}function d(e){e.global&&0===t.active++&&p(e,null,"ajaxStart")}function m(e){e.global&&!--t.active&&p(e,null,"ajaxStop")}function g(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||p(e,n,"ajaxBeforeSend",[t,e])===!1?!1:void p(e,n,"ajaxSend",[t,e])}function v(t,e,n,i){var r=n.context,o="success";n.success.call(r,t,o,e),i&&i.resolveWith(r,[t,o,e]),p(n,r,"ajaxSuccess",[e,n,t]),w(o,e,n)}function y(t,e,n,i,r){var o=i.context;i.error.call(o,n,e,t),r&&r.rejectWith(o,[n,e,t]),p(i,o,"ajaxError",[n,i,t||e]),w(e,n,i)}function w(t,e,n){var i=n.context;n.complete.call(i,e,t),p(n,i,"ajaxComplete",[e,n]),m(n)}function x(){}function b(t){return t&&(t=t.split(";",2)[0]),t&&(t==f?"html":t==u?"json":s.test(t)?"script":a.test(t)&&"xml")||"text"}function E(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function T(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=E(e.url,e.data),e.data=void 0)}function j(e,n,i,r){return t.isFunction(n)&&(r=i,i=n,n=void 0),t.isFunction(i)||(r=i,i=void 0),{url:e,data:n,success:i,dataType:r}}function C(e,n,i,r){var o,s=t.isArray(n),a=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),r&&(n=i?r:r+"["+(a||"object"==o||"array"==o?n:"")+"]"),!r&&s?e.add(u.name,u.value):"array"==o||!i&&"object"==o?C(e,u,i,n):e.add(n,u)})}var i,r,e=0,n=window.document,o=/\n\t * \n\t * ```\n\t * Now, create the player:\n\t * ```html\n\t * \n\t * \n\t * \n\t * \n\t * ```\n\t */\n\t\n\tvar Player = function (_BaseObject) {\n\t _inherits(Player, _BaseObject);\n\t\n\t _createClass(Player, [{\n\t key: 'loader',\n\t set: function set(loader) {\n\t this._loader = loader;\n\t },\n\t get: function get() {\n\t if (!this._loader) {\n\t this._loader = new _loader2.default(this.options.plugins || {}, this.options.playerId);\n\t }\n\t return this._loader;\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this.core.mediaControl.container.ended;\n\t }\n\t\n\t /**\n\t * Determine if the playback is having to buffer in order for\n\t * playback to be smooth.\n\t * (i.e if a live stream is playing smoothly, this will be false)\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return this.core.mediaControl.container.buffering;\n\t }\n\t\n\t /*\n\t * determine if the player is ready.\n\t * @property isReady\n\t * @type {Boolean} `true` if the player is ready. ie PLAYER_READY event has fired\n\t */\n\t\n\t }, {\n\t key: 'isReady',\n\t get: function get() {\n\t return !!this._ready;\n\t }\n\t\n\t /**\n\t * An events map that allows the user to add custom callbacks in player's options.\n\t * @property eventsMapping\n\t * @type {Object}\n\t */\n\t\n\t }, {\n\t key: 'eventsMapping',\n\t get: function get() {\n\t return {\n\t onReady: _events2.default.PLAYER_READY,\n\t onResize: _events2.default.PLAYER_RESIZE,\n\t onPlay: _events2.default.PLAYER_PLAY,\n\t onPause: _events2.default.PLAYER_PAUSE,\n\t onStop: _events2.default.PLAYER_STOP,\n\t onEnded: _events2.default.PLAYER_ENDED,\n\t onSeek: _events2.default.PLAYER_SEEK,\n\t onError: _events2.default.PLAYER_ERROR,\n\t onTimeUpdate: _events2.default.PLAYER_TIMEUPDATE,\n\t onVolumeUpdate: _events2.default.PLAYER_VOLUMEUPDATE\n\t };\n\t }\n\t\n\t /**\n\t * ## Player's constructor\n\t *\n\t * You might pass the options object to build the player.\n\t * ```javascript\n\t * var options = {source: \"http://example.com/video.mp4\", param1: \"val1\"};\n\t * var player = new Clappr.Player(options);\n\t * ```\n\t *\n\t * @method constructor\n\t * @param {Object} options Data\n\t * options to build a player instance\n\t * @param {Number} [options.width]\n\t * player's width **default**: `640`\n\t * @param {Number} [options.height]\n\t * player's height **default**: `360`\n\t * @param {String} [options.parentId]\n\t * the id of the element on the page that the player should be inserted into\n\t * @param {Object} [options.parent]\n\t * a reference to a dom element that the player should be inserted into\n\t * @param {String} [options.source]\n\t * The media source URL, or {source: <>, mimeType: <>}\n\t * @param {Object} [options.sources]\n\t * An array of media source URL's, or an array of {source: <>, mimeType: <>}\n\t * @param {Boolean} [options.autoPlay]\n\t * automatically play after page load **default**: `false`\n\t * @param {Boolean} [options.loop]\n\t * automatically replay after it ends **default**: `false`\n\t * @param {Boolean} [options.chromeless]\n\t * player acts in chromeless mode **default**: `false`\n\t * @param {Boolean} [options.allowUserInteraction]\n\t * whether or not the player should handle click events when in chromeless mode **default**: `false` on desktops browsers, `true` on mobile.\n\t * @param {Boolean} [options.disableKeyboardShortcuts]\n\t * disable keyboard shortcuts. **default**: `false`. `true` if `allowUserInteraction` is `false`.\n\t * @param {Boolean} [options.muted]\n\t * start the video muted **default**: `false`\n\t * @param {String} [options.mimeType]\n\t * add `mimeType: \"application/vnd.apple.mpegurl\"` if you need to use a url without extension.\n\t * @param {String} [options.actualLiveTime]\n\t * show duration and seek time relative to actual time.\n\t * @param {String} [options.actualLiveServerTime]\n\t * specify server time as a string, format: \"2015/11/26 06:01:03\". This option is meant to be used with actualLiveTime.\n\t * @param {Boolean} [options.persistConfig]\n\t * persist player's settings (volume) through the same domain **default**: `true`\n\t * @param {String} [options.preload]\n\t * video will be preloaded according to `preload` attribute options **default**: `'metadata'`\n\t * @param {Number} [options.maxBufferLength]\n\t * the default behavior for the **HLS playback** is to keep buffering indefinitely, even on VoD.\n\t * This replicates the behavior for progressive download, which continues buffering when pausing the video, thus making the video available for playback even on slow networks.\n\t * To change this behavior use `maxBufferLength` where **value is in seconds**.\n\t * @param {String} [options.gaAccount]\n\t * enable Google Analytics events dispatch **(play/pause/stop/buffering/etc)** by adding your `gaAccount`\n\t * @param {String} [options.gaTrackerName]\n\t * besides `gaAccount` you can optionally, pass your favorite trackerName as `gaTrackerName`\n\t * @param {Object} [options.mediacontrol]\n\t * customize control bar colors, example: `mediacontrol: {seekbar: \"#E113D3\", buttons: \"#66B2FF\"}`\n\t * @param {Boolean} [options.hideMediaControl]\n\t * control media control auto hide **default**: `true`\n\t * @param {Boolean} [options.hideVolumeBar]\n\t * when embedded with width less than 320, volume bar will hide. You can force this behavior for all sizes by adding `true` **default**: `false`\n\t * @param {String} [options.watermark]\n\t * put `watermark: 'http://url/img.png'` on your embed parameters to automatically add watermark on your video.\n\t * You can customize corner position by defining position parameter. Positions can be `bottom-left`, `bottom-right`, `top-left` and `top-right`.\n\t * @param {String} [options.watermarkLink]\n\t * `watermarkLink: 'http://example.net/'` - define URL to open when the watermark is clicked. If not provided watermark will not be clickable.\n\t * @param {Boolean} [options.disableVideoTagContextMenu]\n\t * disables the context menu (right click) on the video element if a HTML5Video playback is used.\n\t * @param {Boolean} [options.autoSeekFromUrl]\n\t * Automatically seek to the seconds provided in the url (e.g example.com?t=100) **default**: `true`\n\t * @param {Boolean} [options.exitFullscreenOnEnd]\n\t * Automatically exit full screen when the media finishes. **default**: `true`\n\t * @param {String} [options.poster]\n\t * define a poster by adding its address `poster: 'http://url/img.png'`. It will appear after video embed, disappear on play and go back when user stops the video.\n\t * @param {String} [options.playbackNotSupportedMessage]\n\t * define a custom message to be displayed when a playback is not supported.\n\t * @param {Object} [options.events]\n\t * Specify listeners which will be registered with their corresponding player events.\n\t * E.g. onReady -> \"PLAYER_READY\", onTimeUpdate -> \"PLAYER_TIMEUPDATE\"\n\t */\n\t\n\t }]);\n\t\n\t function Player(options) {\n\t _classCallCheck(this, Player);\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseObject.call(this, options));\n\t\n\t var defaultOptions = { playerId: (0, _utils.uniqueId)(''), persistConfig: true, width: 640, height: 360, baseUrl: baseUrl, allowUserInteraction: _browser2.default.isMobile };\n\t _this._options = _clapprZepto2.default.extend(defaultOptions, options);\n\t _this.options.sources = _this._normalizeSources(options);\n\t if (!_this.options.chromeless) {\n\t // \"allowUserInteraction\" cannot be false if not in chromeless mode.\n\t _this.options.allowUserInteraction = true;\n\t }\n\t if (!_this.options.allowUserInteraction) {\n\t // if user iteraction is not allowed ensure keyboard shortcuts are disabled\n\t _this.options.disableKeyboardShortcuts = true;\n\t }\n\t _this._registerOptionEventListeners();\n\t _this._coreFactory = new _core_factory2.default(_this);\n\t _this.playerInfo = _player_info2.default.getInstance(_this.options.playerId);\n\t _this.playerInfo.currentSize = { width: options.width, height: options.height };\n\t _this.playerInfo.options = _this.options;\n\t if (_this.options.parentId) {\n\t _this.setParentId(_this.options.parentId);\n\t } else if (_this.options.parent) {\n\t _this.attachTo(_this.options.parent);\n\t }\n\t return _this;\n\t }\n\t\n\t /**\n\t * Specify a `parentId` to the player.\n\t * @method setParentId\n\t * @param {String} parentId the element parent id.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.setParentId = function setParentId(parentId) {\n\t var el = document.querySelector(parentId);\n\t if (el) {\n\t this.attachTo(el);\n\t }\n\t return this;\n\t };\n\t\n\t /**\n\t * You can use this method to attach the player to a given element. You don't need to do this when you specify it during the player instantiation passing the `parentId` param.\n\t * @method attachTo\n\t * @param {Object} element a given element.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.attachTo = function attachTo(element) {\n\t this.options.parentElement = element;\n\t this.core = this._coreFactory.create();\n\t this._addEventListeners();\n\t return this;\n\t };\n\t\n\t Player.prototype._addEventListeners = function _addEventListeners() {\n\t if (!this.core.isReady) {\n\t this.listenToOnce(this.core, _events2.default.CORE_READY, this._onReady);\n\t } else {\n\t this._onReady();\n\t }\n\t this.listenTo(this.core.mediaControl, _events2.default.MEDIACONTROL_CONTAINERCHANGED, this._containerChanged);\n\t this.listenTo(this.core, _events2.default.CORE_FULLSCREEN, this._onFullscreenChange);\n\t return this;\n\t };\n\t\n\t Player.prototype._addContainerEventListeners = function _addContainerEventListeners() {\n\t var container = this.core.mediaControl.container;\n\t if (container) {\n\t this.listenTo(container, _events2.default.CONTAINER_PLAY, this._onPlay);\n\t this.listenTo(container, _events2.default.CONTAINER_PAUSE, this._onPause);\n\t this.listenTo(container, _events2.default.CONTAINER_STOP, this._onStop);\n\t this.listenTo(container, _events2.default.CONTAINER_ENDED, this._onEnded);\n\t this.listenTo(container, _events2.default.CONTAINER_SEEK, this._onSeek);\n\t this.listenTo(container, _events2.default.CONTAINER_ERROR, this._onError);\n\t this.listenTo(container, _events2.default.CONTAINER_TIMEUPDATE, this._onTimeUpdate);\n\t this.listenTo(container, _events2.default.CONTAINER_VOLUME, this._onVolumeUpdate);\n\t }\n\t return this;\n\t };\n\t\n\t Player.prototype._registerOptionEventListeners = function _registerOptionEventListeners() {\n\t var _this2 = this;\n\t\n\t var userEvents = this.options.events || {};\n\t Object.keys(userEvents).forEach(function (userEvent) {\n\t var eventType = _this2.eventsMapping[userEvent];\n\t if (eventType) {\n\t var eventFunction = userEvents[userEvent];\n\t eventFunction = typeof eventFunction === 'function' && eventFunction;\n\t eventFunction && _this2.on(eventType, eventFunction);\n\t }\n\t });\n\t return this;\n\t };\n\t\n\t Player.prototype._containerChanged = function _containerChanged() {\n\t this.stopListening();\n\t this._addEventListeners();\n\t };\n\t\n\t Player.prototype._onReady = function _onReady() {\n\t this._ready = true;\n\t this._addContainerEventListeners();\n\t this.trigger(_events2.default.PLAYER_READY);\n\t };\n\t\n\t Player.prototype._onFullscreenChange = function _onFullscreenChange(fullscreen) {\n\t this.trigger(_events2.default.PLAYER_FULLSCREEN, fullscreen);\n\t };\n\t\n\t Player.prototype._onVolumeUpdate = function _onVolumeUpdate(volume) {\n\t this.trigger(_events2.default.PLAYER_VOLUMEUPDATE, volume);\n\t };\n\t\n\t Player.prototype._onPlay = function _onPlay() {\n\t this.trigger(_events2.default.PLAYER_PLAY);\n\t };\n\t\n\t Player.prototype._onPause = function _onPause() {\n\t this.trigger(_events2.default.PLAYER_PAUSE);\n\t };\n\t\n\t Player.prototype._onStop = function _onStop() {\n\t this.trigger(_events2.default.PLAYER_STOP, this.getCurrentTime());\n\t };\n\t\n\t Player.prototype._onEnded = function _onEnded() {\n\t this.trigger(_events2.default.PLAYER_ENDED);\n\t };\n\t\n\t Player.prototype._onSeek = function _onSeek(time) {\n\t this.trigger(_events2.default.PLAYER_SEEK, time);\n\t };\n\t\n\t Player.prototype._onTimeUpdate = function _onTimeUpdate(timeProgress) {\n\t this.trigger(_events2.default.PLAYER_TIMEUPDATE, timeProgress);\n\t };\n\t\n\t Player.prototype._onError = function _onError(error) {\n\t this.trigger(_events2.default.PLAYER_ERROR, error);\n\t };\n\t\n\t Player.prototype._normalizeSources = function _normalizeSources(options) {\n\t var sources = options.sources || (options.source !== undefined ? [options.source] : []);\n\t return sources.length === 0 ? [{ source: '', mimeType: '' }] : sources;\n\t };\n\t\n\t /**\n\t * resizes the current player canvas.\n\t * @method resize\n\t * @param {Object} size should be a literal object with `height` and `width`.\n\t * @return {Player} itself\n\t * @example\n\t * ```javascript\n\t * player.resize({height: 360, width: 640})\n\t * ```\n\t */\n\t\n\t\n\t Player.prototype.resize = function resize(size) {\n\t this.core.resize(size);\n\t return this;\n\t };\n\t\n\t /**\n\t * loads a new source.\n\t * @method load\n\t * @param {Array|String} sources source or sources of video.\n\t * An array item can be a string or {source: <>, mimeType: <>}\n\t * @param {String} mimeType a mime type, example: `'application/vnd.apple.mpegurl'`\n\t * @param {Boolean} [autoPlay=false] whether playing should be started immediately\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.load = function load(sources, mimeType, autoPlay) {\n\t if (autoPlay !== undefined) {\n\t this.configure({ autoPlay: !!autoPlay });\n\t }\n\t this.core.load(sources, mimeType);\n\t return this;\n\t };\n\t\n\t /**\n\t * destroys the current player and removes it from the DOM.\n\t * @method destroy\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.destroy = function destroy() {\n\t this.core.destroy();\n\t return this;\n\t };\n\t\n\t /**\n\t * plays the current video (`source`).\n\t * @method play\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.play = function play() {\n\t this.core.mediaControl.container.play();\n\t return this;\n\t };\n\t\n\t /**\n\t * pauses the current video (`source`).\n\t * @method pause\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.pause = function pause() {\n\t this.core.mediaControl.container.pause();\n\t return this;\n\t };\n\t\n\t /**\n\t * stops the current video (`source`).\n\t * @method stop\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.stop = function stop() {\n\t this.core.mediaControl.container.stop();\n\t return this;\n\t };\n\t\n\t /**\n\t * seeks the current video (`source`). For example, `player.seek(120)` will seek to second 120 (2minutes) of the current video.\n\t * @method seek\n\t * @param {Number} time should be a number between 0 and the video duration.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.seek = function seek(time) {\n\t this.core.mediaControl.container.seek(time);\n\t return this;\n\t };\n\t\n\t /**\n\t * seeks the current video (`source`). For example, `player.seek(50)` will seek to the middle of the current video.\n\t * @method seekPercentage\n\t * @param {Number} time should be a number between 0 and 100.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.seekPercentage = function seekPercentage(percentage) {\n\t this.core.mediaControl.container.seekPercentage(percentage);\n\t return this;\n\t };\n\t\n\t /**\n\t * Set the volume for the current video (`source`).\n\t * @method setVolume\n\t * @param {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.setVolume = function setVolume(volume) {\n\t if (this.core && this.core.mediaControl) {\n\t this.core.mediaControl.setVolume(volume);\n\t }\n\t return this;\n\t };\n\t\n\t /**\n\t * Get the volume for the current video\n\t * @method getVolume\n\t * @return {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.\n\t */\n\t\n\t\n\t Player.prototype.getVolume = function getVolume() {\n\t return this.core && this.core.mediaControl ? this.core.mediaControl.volume : 0;\n\t };\n\t\n\t /**\n\t * mutes the current video (`source`).\n\t * @method mute\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.mute = function mute() {\n\t this._mutedVolume = this.getVolume();\n\t this.setVolume(0);\n\t return this;\n\t };\n\t\n\t /**\n\t * unmutes the current video (`source`).\n\t * @method unmute\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.unmute = function unmute() {\n\t this.setVolume(typeof this._mutedVolume === 'number' ? this._mutedVolume : 100);\n\t this._mutedVolume = null;\n\t return this;\n\t };\n\t\n\t /**\n\t * checks if the player is playing.\n\t * @method isPlaying\n\t * @return {Boolean} `true` if the current source is playing, otherwise `false`\n\t */\n\t\n\t\n\t Player.prototype.isPlaying = function isPlaying() {\n\t return this.core.mediaControl.container.isPlaying();\n\t };\n\t\n\t /**\n\t * returns `true` if DVR is enable otherwise `false`.\n\t * @method isDvrEnabled\n\t * @return {Boolean}\n\t */\n\t\n\t\n\t Player.prototype.isDvrEnabled = function isDvrEnabled() {\n\t return this.core.mediaControl.container.isDvrEnabled();\n\t };\n\t\n\t /**\n\t * returns `true` if DVR is in use otherwise `false`.\n\t * @method isDvrInUse\n\t * @return {Boolean}\n\t */\n\t\n\t\n\t Player.prototype.isDvrInUse = function isDvrInUse() {\n\t return this.core.mediaControl.container.isDvrInUse();\n\t };\n\t\n\t /**\n\t * enables to configure a player after its creation\n\t * @method configure\n\t * @param {Object} options all the options to change in form of a javascript object\n\t * @return {Player} itself\n\t */\n\t\n\t\n\t Player.prototype.configure = function configure(options) {\n\t this.core.configure(options);\n\t return this;\n\t };\n\t\n\t /**\n\t * get a plugin by its name.\n\t * @method getPlugin\n\t * @param {String} name of the plugin.\n\t * @return {Object} the plugin instance\n\t * @example\n\t * ```javascript\n\t * var poster = player.getPlugin('poster');\n\t * poster.hidePlayButton();\n\t * ```\n\t */\n\t\n\t\n\t Player.prototype.getPlugin = function getPlugin(name) {\n\t var plugins = this.core.plugins.concat(this.core.mediaControl.container.plugins);\n\t return plugins.filter(function (plugin) {\n\t return plugin.name === name;\n\t })[0];\n\t };\n\t\n\t /**\n\t * the current time in seconds.\n\t * @method getCurrentTime\n\t * @return {Number} current time (in seconds) of the current source\n\t */\n\t\n\t\n\t Player.prototype.getCurrentTime = function getCurrentTime() {\n\t return this.core.mediaControl.container.getCurrentTime();\n\t };\n\t\n\t /**\n\t * The time that \"0\" now represents relative to when playback started.\n\t * For a stream with a sliding window this will increase as content is\n\t * removed from the beginning.\n\t * @method getStartTimeOffset\n\t * @return {Number} time (in seconds) that time \"0\" represents.\n\t */\n\t\n\t\n\t Player.prototype.getStartTimeOffset = function getStartTimeOffset() {\n\t return this.core.mediaControl.container.getStartTimeOffset();\n\t };\n\t\n\t /**\n\t * the duration time in seconds.\n\t * @method getDuration\n\t * @return {Number} duration time (in seconds) of the current source\n\t */\n\t\n\t\n\t Player.prototype.getDuration = function getDuration() {\n\t return this.core.mediaControl.container.getDuration();\n\t };\n\t\n\t return Player;\n\t}(_base_object2.default);\n\t\n\texports.default = Player;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 47 */\n/*!******************************************************************!*\\\n !*** ./src/playbacks/base_flash_playback/base_flash_playback.js ***!\n \\******************************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _flash = __webpack_require__(/*! ./public/flash.html */ 92);\n\t\n\tvar _flash2 = _interopRequireDefault(_flash);\n\t\n\tvar _flash3 = __webpack_require__(/*! ./public/flash.scss */ 81);\n\t\n\tvar _flash4 = _interopRequireDefault(_flash3);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2015 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar IE_CLASSID = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';\n\t\n\tvar BaseFlashPlayback = function (_Playback) {\n\t _inherits(BaseFlashPlayback, _Playback);\n\t\n\t function BaseFlashPlayback() {\n\t _classCallCheck(this, BaseFlashPlayback);\n\t\n\t return _possibleConstructorReturn(this, _Playback.apply(this, arguments));\n\t }\n\t\n\t BaseFlashPlayback.prototype.setElement = function setElement(element) {\n\t this.$el = element;\n\t this.el = element[0];\n\t };\n\t\n\t BaseFlashPlayback.prototype._setupFirefox = function _setupFirefox() {\n\t var $el = this.$('embed');\n\t $el.attr('data-flash-playback', this.name);\n\t $el.addClass(this.attributes.class);\n\t this.setElement($el);\n\t };\n\t\n\t BaseFlashPlayback.prototype.render = function render() {\n\t this.$el.html(this.template({\n\t cid: this.cid,\n\t swfPath: this.swfPath,\n\t baseUrl: this.baseUrl,\n\t playbackId: this.uniqueId,\n\t wmode: this.wmode,\n\t callbackName: 'window.Clappr.flashlsCallbacks.' + this.cid }));\n\t\n\t if (_browser2.default.isIE) {\n\t this.$('embed').remove();\n\t\n\t if (_browser2.default.isLegacyIE) {\n\t this.$el.attr('classid', IE_CLASSID);\n\t }\n\t }\n\t\n\t if (_browser2.default.isFirefox) {\n\t this._setupFirefox();\n\t }\n\t\n\t this.el.id = this.cid;\n\t this.$el.append(_styler2.default.getStyleFor(_flash4.default));\n\t\n\t return this;\n\t };\n\t\n\t _createClass(BaseFlashPlayback, [{\n\t key: 'tagName',\n\t get: function get() {\n\t return 'object';\n\t }\n\t }, {\n\t key: 'swfPath',\n\t get: function get() {\n\t return '';\n\t }\n\t }, {\n\t key: 'wmode',\n\t get: function get() {\n\t return 'transparent';\n\t }\n\t }, {\n\t key: 'template',\n\t get: function get() {\n\t return (0, _template2.default)(_flash2.default);\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t var type = 'application/x-shockwave-flash';\n\t\n\t if (_browser2.default.isLegacyIE) {\n\t type = '';\n\t }\n\t\n\t return {\n\t class: 'clappr-flash-playback',\n\t type: type,\n\t width: '100%',\n\t height: '100%',\n\t 'data-flash-playback': this.name\n\t };\n\t }\n\t }]);\n\t\n\t return BaseFlashPlayback;\n\t}(_playback2.default);\n\t\n\texports.default = BaseFlashPlayback;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 48 */\n/*!**************************************!*\\\n !*** ./src/playbacks/flash/flash.js ***!\n \\**************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _base_flash_playback = __webpack_require__(/*! playbacks/base_flash_playback */ 18);\n\t\n\tvar _base_flash_playback2 = _interopRequireDefault(_base_flash_playback);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _mediator = __webpack_require__(/*! components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _Player = __webpack_require__(/*! ./public/Player.swf */ 111);\n\t\n\tvar _Player2 = _interopRequireDefault(_Player);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar MAX_ATTEMPTS = 60;\n\t\n\tvar Flash = function (_BaseFlashPlayback) {\n\t _inherits(Flash, _BaseFlashPlayback);\n\t\n\t _createClass(Flash, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'flash';\n\t }\n\t }, {\n\t key: 'swfPath',\n\t get: function get() {\n\t return (0, _template2.default)(_Player2.default)({ baseUrl: this._baseUrl });\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this._currentState === 'ENDED';\n\t }\n\t\n\t /**\n\t * Determine if the playback is buffering.\n\t * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return !!this._bufferingState && this._currentState !== 'ENDED';\n\t }\n\t }]);\n\t\n\t function Flash() {\n\t _classCallCheck(this, Flash);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseFlashPlayback.call.apply(_BaseFlashPlayback, [this].concat(args)));\n\t\n\t _this._src = _this.options.src;\n\t _this._baseUrl = _this.options.baseUrl;\n\t _this._autoPlay = _this.options.autoPlay;\n\t _this.settings = { default: ['seekbar'] };\n\t _this.settings.left = ['playpause', 'position', 'duration'];\n\t _this.settings.right = ['fullscreen', 'volume'];\n\t _this.settings.seekEnabled = true;\n\t _this._isReadyState = false;\n\t _this._addListeners();\n\t return _this;\n\t }\n\t\n\t Flash.prototype._bootstrap = function _bootstrap() {\n\t var _this2 = this;\n\t\n\t if (this.el.playerPlay) {\n\t this.el.width = '100%';\n\t this.el.height = '100%';\n\t if (this._currentState === 'PLAYING') {\n\t this._firstPlay();\n\t } else {\n\t this._currentState = 'IDLE';\n\t this._autoPlay && this.play();\n\t }\n\t (0, _clapprZepto2.default)('').insertAfter(this.$el);\n\t if (this.getDuration() > 0) {\n\t this._metadataLoaded();\n\t } else {\n\t _mediator2.default.once(this.uniqueId + ':timeupdate', this._metadataLoaded, this);\n\t }\n\t } else {\n\t this._attempts = this._attempts || 0;\n\t if (++this._attempts <= MAX_ATTEMPTS) {\n\t setTimeout(function () {\n\t return _this2._bootstrap();\n\t }, 50);\n\t } else {\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { message: 'Max number of attempts reached' }, this.name);\n\t }\n\t }\n\t };\n\t\n\t Flash.prototype._metadataLoaded = function _metadataLoaded() {\n\t this._isReadyState = true;\n\t this.trigger(_events2.default.PLAYBACK_READY, this.name);\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE, this.name);\n\t };\n\t\n\t Flash.prototype.getPlaybackType = function getPlaybackType() {\n\t return _playback2.default.VOD;\n\t };\n\t\n\t Flash.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() {\n\t return false;\n\t };\n\t\n\t Flash.prototype._updateTime = function _updateTime() {\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: this.el.getPosition(), total: this.el.getDuration() }, this.name);\n\t };\n\t\n\t Flash.prototype._addListeners = function _addListeners() {\n\t _mediator2.default.on(this.uniqueId + ':progress', this._progress, this);\n\t _mediator2.default.on(this.uniqueId + ':timeupdate', this._updateTime, this);\n\t _mediator2.default.on(this.uniqueId + ':statechanged', this._checkState, this);\n\t _mediator2.default.on(this.uniqueId + ':flashready', this._bootstrap, this);\n\t };\n\t\n\t Flash.prototype.stopListening = function stopListening() {\n\t _BaseFlashPlayback.prototype.stopListening.call(this);\n\t _mediator2.default.off(this.uniqueId + ':progress');\n\t _mediator2.default.off(this.uniqueId + ':timeupdate');\n\t _mediator2.default.off(this.uniqueId + ':statechanged');\n\t _mediator2.default.off(this.uniqueId + ':flashready');\n\t };\n\t\n\t Flash.prototype._checkState = function _checkState() {\n\t if (this._isIdle || this._currentState === 'PAUSED') {\n\t return;\n\t } else if (this._currentState !== 'PLAYING_BUFFERING' && this.el.getState() === 'PLAYING_BUFFERING') {\n\t this._bufferingState = true;\n\t this.trigger(_events2.default.PLAYBACK_BUFFERING, this.name);\n\t this._currentState = 'PLAYING_BUFFERING';\n\t } else if (this.el.getState() === 'PLAYING') {\n\t this._bufferingState = false;\n\t this.trigger(_events2.default.PLAYBACK_BUFFERFULL, this.name);\n\t this._currentState = 'PLAYING';\n\t } else if (this.el.getState() === 'IDLE') {\n\t this._currentState = 'IDLE';\n\t } else if (this.el.getState() === 'ENDED') {\n\t this.trigger(_events2.default.PLAYBACK_ENDED, this.name);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 0, total: this.el.getDuration() }, this.name);\n\t this._currentState = 'ENDED';\n\t this._isIdle = true;\n\t }\n\t };\n\t\n\t Flash.prototype._progress = function _progress() {\n\t if (this._currentState !== 'IDLE' && this._currentState !== 'ENDED') {\n\t this.trigger(_events2.default.PLAYBACK_PROGRESS, {\n\t start: 0,\n\t current: this.el.getBytesLoaded(),\n\t total: this.el.getBytesTotal()\n\t });\n\t }\n\t };\n\t\n\t Flash.prototype._firstPlay = function _firstPlay() {\n\t var _this3 = this;\n\t\n\t if (this.el.playerPlay) {\n\t this._isIdle = false;\n\t this.el.playerPlay(this._src);\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this3._checkInitialSeek();\n\t });\n\t this._currentState = 'PLAYING';\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_READY, this._firstPlay);\n\t }\n\t };\n\t\n\t Flash.prototype._checkInitialSeek = function _checkInitialSeek() {\n\t var seekTime = (0, _utils.seekStringToSeconds)(window.location.href);\n\t if (seekTime !== 0) {\n\t this.seekSeconds(seekTime);\n\t }\n\t };\n\t\n\t Flash.prototype.play = function play() {\n\t this.trigger(_events2.default.PLAYBACK_PLAY_INTENT);\n\t if (this._currentState === 'PAUSED' || this._currentState === 'PLAYING_BUFFERING') {\n\t this._currentState = 'PLAYING';\n\t this.el.playerResume();\n\t this.trigger(_events2.default.PLAYBACK_PLAY, this.name);\n\t } else if (this._currentState !== 'PLAYING') {\n\t this._firstPlay();\n\t this.trigger(_events2.default.PLAYBACK_PLAY, this.name);\n\t }\n\t };\n\t\n\t Flash.prototype.volume = function volume(value) {\n\t var _this4 = this;\n\t\n\t if (this.isReady) {\n\t this.el.playerVolume(value);\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this4.volume(value);\n\t });\n\t }\n\t };\n\t\n\t Flash.prototype.pause = function pause() {\n\t this._currentState = 'PAUSED';\n\t this.el.playerPause();\n\t this.trigger(_events2.default.PLAYBACK_PAUSE, this.name);\n\t };\n\t\n\t Flash.prototype.stop = function stop() {\n\t this.el.playerStop();\n\t this.trigger(_events2.default.PLAYBACK_STOP);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 0, total: 0 }, this.name);\n\t };\n\t\n\t Flash.prototype.isPlaying = function isPlaying() {\n\t return !!(this.isReady && this._currentState.indexOf('PLAYING') > -1);\n\t };\n\t\n\t Flash.prototype.getDuration = function getDuration() {\n\t return this.el.getDuration();\n\t };\n\t\n\t Flash.prototype.seekPercentage = function seekPercentage(percentage) {\n\t var _this5 = this;\n\t\n\t if (this.el.getDuration() > 0) {\n\t var seekSeconds = this.el.getDuration() * (percentage / 100);\n\t this.seek(seekSeconds);\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this5.seekPercentage(percentage);\n\t });\n\t }\n\t };\n\t\n\t Flash.prototype.seek = function seek(time) {\n\t var _this6 = this;\n\t\n\t if (this.isReady && this.el.playerSeek) {\n\t this.el.playerSeek(time);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: time, total: this.el.getDuration() }, this.name);\n\t if (this._currentState === 'PAUSED') {\n\t this.el.playerPause();\n\t }\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this6.seek(time);\n\t });\n\t }\n\t };\n\t\n\t Flash.prototype.destroy = function destroy() {\n\t clearInterval(this.bootstrapId);\n\t _BaseFlashPlayback.prototype.stopListening.call(this);\n\t this.$el.remove();\n\t };\n\t\n\t _createClass(Flash, [{\n\t key: 'isReady',\n\t get: function get() {\n\t return this._isReadyState;\n\t }\n\t }]);\n\t\n\t return Flash;\n\t}(_base_flash_playback2.default);\n\t\n\texports.default = Flash;\n\t\n\t\n\tFlash.canPlay = function (resource) {\n\t if (!_browser2.default.hasFlash || !resource || resource.constructor !== String) {\n\t return false;\n\t } else {\n\t var resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || [];\n\t return resourceParts.length > 1 && !_browser2.default.isMobile && resourceParts[1].toLowerCase().match(/^(mp4|mov|f4v|3gpp|3gp)$/);\n\t }\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 49 */\n/*!******************************************!*\\\n !*** ./src/playbacks/flashls/flashls.js ***!\n \\******************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _base_flash_playback = __webpack_require__(/*! playbacks/base_flash_playback */ 18);\n\t\n\tvar _base_flash_playback2 = _interopRequireDefault(_base_flash_playback);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _template = __webpack_require__(/*! base/template */ 6);\n\t\n\tvar _template2 = _interopRequireDefault(_template);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _mediator = __webpack_require__(/*! components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _flashls_events = __webpack_require__(/*! ./flashls_events */ 50);\n\t\n\tvar _flashls_events2 = _interopRequireDefault(_flashls_events);\n\t\n\tvar _HLSPlayer = __webpack_require__(/*! ./public/HLSPlayer.swf */ 112);\n\t\n\tvar _HLSPlayer2 = _interopRequireDefault(_HLSPlayer);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar MAX_ATTEMPTS = 60;\n\tvar AUTO = -1;\n\t\n\tvar FlasHLS = function (_BaseFlashPlayback) {\n\t _inherits(FlasHLS, _BaseFlashPlayback);\n\t\n\t _createClass(FlasHLS, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'flashls';\n\t }\n\t }, {\n\t key: 'swfPath',\n\t get: function get() {\n\t return (0, _template2.default)(_HLSPlayer2.default)({ baseUrl: this._baseUrl });\n\t }\n\t }, {\n\t key: 'levels',\n\t get: function get() {\n\t return this._levels || [];\n\t }\n\t }, {\n\t key: 'currentLevel',\n\t get: function get() {\n\t if (this._currentLevel === null || this._currentLevel === undefined) {\n\t return AUTO;\n\t } else {\n\t return this._currentLevel; //0 is a valid level ID\n\t }\n\t },\n\t set: function set(id) {\n\t this._currentLevel = id;\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_START);\n\t this.el.playerSetCurrentLevel(id);\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this._hasEnded;\n\t }\n\t\n\t /**\n\t * Determine if the playback is buffering.\n\t * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return !!this._bufferingState && !this._hasEnded;\n\t }\n\t }]);\n\t\n\t function FlasHLS() {\n\t _classCallCheck(this, FlasHLS);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, _BaseFlashPlayback.call.apply(_BaseFlashPlayback, [this].concat(args)));\n\t\n\t _this._src = _this.options.src;\n\t _this._baseUrl = _this.options.baseUrl;\n\t _this._initHlsParameters(_this.options);\n\t // TODO can this be private?\n\t _this.highDefinition = false;\n\t _this._autoPlay = _this.options.autoPlay;\n\t _this._loop = _this.options.loop;\n\t _this._defaultSettings = {\n\t left: ['playstop'],\n\t default: ['seekbar'],\n\t right: ['fullscreen', 'volume', 'hd-indicator'],\n\t seekEnabled: false\n\t };\n\t _this.settings = _clapprZepto2.default.extend({}, _this._defaultSettings);\n\t _this._playbackType = _playback2.default.LIVE;\n\t _this._hasEnded = false;\n\t _this._addListeners();\n\t return _this;\n\t }\n\t\n\t FlasHLS.prototype._initHlsParameters = function _initHlsParameters(options) {\n\t this._autoStartLoad = options.autoStartLoad === undefined ? true : options.autoStartLoad;\n\t this._capLevelToStage = options.capLevelToStage === undefined ? false : options.capLevelToStage;\n\t this._maxLevelCappingMode = options.maxLevelCappingMode === undefined ? 'downscale' : options.maxLevelCappingMode;\n\t this._minBufferLength = options.minBufferLength === undefined ? -1 : options.minBufferLength;\n\t this._minBufferLengthCapping = options.minBufferLengthCapping === undefined ? -1 : options.minBufferLengthCapping;\n\t this._maxBufferLength = options.maxBufferLength === undefined ? 120 : options.maxBufferLength;\n\t this._maxBackBufferLength = options.maxBackBufferLength === undefined ? 30 : options.maxBackBufferLength;\n\t this._lowBufferLength = options.lowBufferLength === undefined ? 3 : options.lowBufferLength;\n\t this._mediaTimePeriod = options.mediaTimePeriod === undefined ? 100 : options.mediaTimePeriod;\n\t this._fpsDroppedMonitoringPeriod = options.fpsDroppedMonitoringPeriod === undefined ? 5000 : options.fpsDroppedMonitoringPeriod;\n\t this._fpsDroppedMonitoringThreshold = options.fpsDroppedMonitoringThreshold === undefined ? 0.2 : options.fpsDroppedMonitoringThreshold;\n\t this._capLevelonFPSDrop = options.capLevelonFPSDrop === undefined ? false : options.capLevelonFPSDrop;\n\t this._smoothAutoSwitchonFPSDrop = options.smoothAutoSwitchonFPSDrop === undefined ? this.capLevelonFPSDrop : options.smoothAutoSwitchonFPSDrop;\n\t this._switchDownOnLevelError = options.switchDownOnLevelError === undefined ? true : options.switchDownOnLevelError;\n\t this._seekMode = options.seekMode === undefined ? 'ACCURATE' : options.seekMode;\n\t this._keyLoadMaxRetry = options.keyLoadMaxRetry === undefined ? 3 : options.keyLoadMaxRetry;\n\t this._keyLoadMaxRetryTimeout = options.keyLoadMaxRetryTimeout === undefined ? 64000 : options.keyLoadMaxRetryTimeout;\n\t this._fragmentLoadMaxRetry = options.fragmentLoadMaxRetry === undefined ? 3 : options.fragmentLoadMaxRetry;\n\t this._fragmentLoadMaxRetryTimeout = options.fragmentLoadMaxRetryTimeout === undefined ? 4000 : options.fragmentLoadMaxRetryTimeout;\n\t this._fragmentLoadSkipAfterMaxRetry = options.fragmentLoadSkipAfterMaxRetry === undefined ? true : options.fragmentLoadSkipAfterMaxRetry;\n\t this._maxSkippedFragments = options.maxSkippedFragments === undefined ? 5 : options.maxSkippedFragments;\n\t this._flushLiveURLCache = options.flushLiveURLCache === undefined ? false : options.flushLiveURLCache;\n\t this._initialLiveManifestSize = options.initialLiveManifestSize === undefined ? 1 : options.initialLiveManifestSize;\n\t this._manifestLoadMaxRetry = options.manifestLoadMaxRetry === undefined ? 3 : options.manifestLoadMaxRetry;\n\t this._manifestLoadMaxRetryTimeout = options.manifestLoadMaxRetryTimeout === undefined ? 64000 : options.manifestLoadMaxRetryTimeout;\n\t this._manifestRedundantLoadmaxRetry = options.manifestRedundantLoadmaxRetry === undefined ? 3 : options.manifestRedundantLoadmaxRetry;\n\t this._startFromBitrate = options.startFromBitrate === undefined ? -1 : options.startFromBitrate;\n\t this._startFromLevel = options.startFromLevel === undefined ? -1 : options.startFromLevel;\n\t this._autoStartMaxDuration = options.autoStartMaxDuration === undefined ? -1 : options.autoStartMaxDuration;\n\t this._seekFromLevel = options.seekFromLevel === undefined ? -1 : options.seekFromLevel;\n\t this._useHardwareVideoDecoder = options.useHardwareVideoDecoder === undefined ? false : options.useHardwareVideoDecoder;\n\t this._hlsLogEnabled = options.hlsLogEnabled === undefined ? true : options.hlsLogEnabled;\n\t this._logDebug = options.logDebug === undefined ? false : options.logDebug;\n\t this._logDebug2 = options.logDebug2 === undefined ? false : options.logDebug2;\n\t this._logWarn = options.logWarn === undefined ? true : options.logWarn;\n\t this._logError = options.logError === undefined ? true : options.logError;\n\t this._hlsMinimumDvrSize = options.hlsMinimumDvrSize === undefined ? 60 : options.hlsMinimumDvrSize;\n\t };\n\t\n\t FlasHLS.prototype._addListeners = function _addListeners() {\n\t var _this2 = this;\n\t\n\t _mediator2.default.on(this.cid + ':flashready', function () {\n\t return _this2._bootstrap();\n\t });\n\t _mediator2.default.on(this.cid + ':timeupdate', function (timeMetrics) {\n\t return _this2._updateTime(timeMetrics);\n\t });\n\t _mediator2.default.on(this.cid + ':playbackstate', function (state) {\n\t return _this2._setPlaybackState(state);\n\t });\n\t _mediator2.default.on(this.cid + ':levelchanged', function (level) {\n\t return _this2._levelChanged(level);\n\t });\n\t _mediator2.default.on(this.cid + ':error', function (code, url, message) {\n\t return _this2._flashPlaybackError(code, url, message);\n\t });\n\t _mediator2.default.on(this.cid + ':fragmentloaded', function (loadmetrics) {\n\t return _this2._onFragmentLoaded(loadmetrics);\n\t });\n\t _mediator2.default.on(this.cid + ':levelendlist', function (level) {\n\t return _this2._onLevelEndlist(level);\n\t });\n\t };\n\t\n\t FlasHLS.prototype.stopListening = function stopListening() {\n\t _BaseFlashPlayback.prototype.stopListening.call(this);\n\t _mediator2.default.off(this.cid + ':flashready');\n\t _mediator2.default.off(this.cid + ':timeupdate');\n\t _mediator2.default.off(this.cid + ':playbackstate');\n\t _mediator2.default.off(this.cid + ':levelchanged');\n\t _mediator2.default.off(this.cid + ':playbackerror');\n\t _mediator2.default.off(this.cid + ':fragmentloaded');\n\t _mediator2.default.off(this.cid + ':manifestloaded');\n\t _mediator2.default.off(this.cid + ':levelendlist');\n\t };\n\t\n\t FlasHLS.prototype._bootstrap = function _bootstrap() {\n\t var _this3 = this;\n\t\n\t if (this.el.playerLoad) {\n\t this.el.width = '100%';\n\t this.el.height = '100%';\n\t this._isReadyState = true;\n\t this._srcLoaded = false;\n\t this._currentState = 'IDLE';\n\t this._setFlashSettings();\n\t this._updatePlaybackType();\n\t if (this._autoPlay || this._shouldPlayOnManifestLoaded) {\n\t this.play();\n\t }\n\t this.trigger(_events2.default.PLAYBACK_READY, this.name);\n\t } else {\n\t this._bootstrapAttempts = this._bootstrapAttempts || 0;\n\t if (++this._bootstrapAttempts <= MAX_ATTEMPTS) {\n\t setTimeout(function () {\n\t return _this3._bootstrap();\n\t }, 50);\n\t } else {\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { message: 'Max number of attempts reached' }, this.name);\n\t }\n\t }\n\t };\n\t\n\t FlasHLS.prototype._setFlashSettings = function _setFlashSettings() {\n\t this.el.playerSetAutoStartLoad(this._autoStartLoad);\n\t this.el.playerSetCapLevelToStage(this._capLevelToStage);\n\t this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode);\n\t this.el.playerSetMinBufferLength(this._minBufferLength);\n\t this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping);\n\t this.el.playerSetMaxBufferLength(this._maxBufferLength);\n\t this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength);\n\t this.el.playerSetLowBufferLength(this._lowBufferLength);\n\t this.el.playerSetMediaTimePeriod(this._mediaTimePeriod);\n\t this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod);\n\t this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold);\n\t this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop);\n\t this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop);\n\t this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError);\n\t this.el.playerSetSeekMode(this._seekMode);\n\t this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry);\n\t this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout);\n\t this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry);\n\t this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout);\n\t this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry);\n\t this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments);\n\t this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache);\n\t this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize);\n\t this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry);\n\t this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout);\n\t this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry);\n\t this.el.playerSetStartFromBitrate(this._startFromBitrate);\n\t this.el.playerSetStartFromLevel(this._startFromLevel);\n\t this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration);\n\t this.el.playerSetSeekFromLevel(this._seekFromLevel);\n\t this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder);\n\t this.el.playerSetLogInfo(this._hlsLogEnabled);\n\t this.el.playerSetLogDebug(this._logDebug);\n\t this.el.playerSetLogDebug2(this._logDebug2);\n\t this.el.playerSetLogWarn(this._logWarn);\n\t this.el.playerSetLogError(this._logError);\n\t };\n\t\n\t FlasHLS.prototype.setAutoStartLoad = function setAutoStartLoad(autoStartLoad) {\n\t this._autoStartLoad = autoStartLoad;\n\t this.el.playerSetAutoStartLoad(this._autoStartLoad);\n\t };\n\t\n\t FlasHLS.prototype.setCapLevelToStage = function setCapLevelToStage(capLevelToStage) {\n\t this._capLevelToStage = capLevelToStage;\n\t this.el.playerSetCapLevelToStage(this._capLevelToStage);\n\t };\n\t\n\t FlasHLS.prototype.setMaxLevelCappingMode = function setMaxLevelCappingMode(maxLevelCappingMode) {\n\t this._maxLevelCappingMode = maxLevelCappingMode;\n\t this.el.playerSetMaxLevelCappingMode(this._maxLevelCappingMode);\n\t };\n\t\n\t FlasHLS.prototype.setSetMinBufferLength = function setSetMinBufferLength(minBufferLength) {\n\t this._minBufferLength = minBufferLength;\n\t this.el.playerSetMinBufferLength(this._minBufferLength);\n\t };\n\t\n\t FlasHLS.prototype.setMinBufferLengthCapping = function setMinBufferLengthCapping(minBufferLengthCapping) {\n\t this._minBufferLengthCapping = minBufferLengthCapping;\n\t this.el.playerSetMinBufferLengthCapping(this._minBufferLengthCapping);\n\t };\n\t\n\t FlasHLS.prototype.setMaxBufferLength = function setMaxBufferLength(maxBufferLength) {\n\t this._maxBufferLength = maxBufferLength;\n\t this.el.playerSetMaxBufferLength(this._maxBufferLength);\n\t };\n\t\n\t FlasHLS.prototype.setMaxBackBufferLength = function setMaxBackBufferLength(maxBackBufferLength) {\n\t this._maxBackBufferLength = maxBackBufferLength;\n\t this.el.playerSetMaxBackBufferLength(this._maxBackBufferLength);\n\t };\n\t\n\t FlasHLS.prototype.setLowBufferLength = function setLowBufferLength(lowBufferLength) {\n\t this._lowBufferLength = lowBufferLength;\n\t this.el.playerSetLowBufferLength(this._lowBufferLength);\n\t };\n\t\n\t FlasHLS.prototype.setMediaTimePeriod = function setMediaTimePeriod(mediaTimePeriod) {\n\t this._mediaTimePeriod = mediaTimePeriod;\n\t this.el.playerSetMediaTimePeriod(this._mediaTimePeriod);\n\t };\n\t\n\t FlasHLS.prototype.setFpsDroppedMonitoringPeriod = function setFpsDroppedMonitoringPeriod(fpsDroppedMonitoringPeriod) {\n\t this._fpsDroppedMonitoringPeriod = fpsDroppedMonitoringPeriod;\n\t this.el.playerSetFpsDroppedMonitoringPeriod(this._fpsDroppedMonitoringPeriod);\n\t };\n\t\n\t FlasHLS.prototype.setFpsDroppedMonitoringThreshold = function setFpsDroppedMonitoringThreshold(fpsDroppedMonitoringThreshold) {\n\t this._fpsDroppedMonitoringThreshold = fpsDroppedMonitoringThreshold;\n\t this.el.playerSetFpsDroppedMonitoringThreshold(this._fpsDroppedMonitoringThreshold);\n\t };\n\t\n\t FlasHLS.prototype.setCapLevelonFPSDrop = function setCapLevelonFPSDrop(capLevelonFPSDrop) {\n\t this._capLevelonFPSDrop = capLevelonFPSDrop;\n\t this.el.playerSetCapLevelonFPSDrop(this._capLevelonFPSDrop);\n\t };\n\t\n\t FlasHLS.prototype.setSmoothAutoSwitchonFPSDrop = function setSmoothAutoSwitchonFPSDrop(smoothAutoSwitchonFPSDrop) {\n\t this._smoothAutoSwitchonFPSDrop = smoothAutoSwitchonFPSDrop;\n\t this.el.playerSetSmoothAutoSwitchonFPSDrop(this._smoothAutoSwitchonFPSDrop);\n\t };\n\t\n\t FlasHLS.prototype.setSwitchDownOnLevelError = function setSwitchDownOnLevelError(switchDownOnLevelError) {\n\t this._switchDownOnLevelError = switchDownOnLevelError;\n\t this.el.playerSetSwitchDownOnLevelError(this._switchDownOnLevelError);\n\t };\n\t\n\t FlasHLS.prototype.setSeekMode = function setSeekMode(seekMode) {\n\t this._seekMode = seekMode;\n\t this.el.playerSetSeekMode(this._seekMode);\n\t };\n\t\n\t FlasHLS.prototype.setKeyLoadMaxRetry = function setKeyLoadMaxRetry(keyLoadMaxRetry) {\n\t this._keyLoadMaxRetry = keyLoadMaxRetry;\n\t this.el.playerSetKeyLoadMaxRetry(this._keyLoadMaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setKeyLoadMaxRetryTimeout = function setKeyLoadMaxRetryTimeout(keyLoadMaxRetryTimeout) {\n\t this._keyLoadMaxRetryTimeout = keyLoadMaxRetryTimeout;\n\t this.el.playerSetKeyLoadMaxRetryTimeout(this._keyLoadMaxRetryTimeout);\n\t };\n\t\n\t FlasHLS.prototype.setFragmentLoadMaxRetry = function setFragmentLoadMaxRetry(fragmentLoadMaxRetry) {\n\t this._fragmentLoadMaxRetry = fragmentLoadMaxRetry;\n\t this.el.playerSetFragmentLoadMaxRetry(this._fragmentLoadMaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setFragmentLoadMaxRetryTimeout = function setFragmentLoadMaxRetryTimeout(fragmentLoadMaxRetryTimeout) {\n\t this._fragmentLoadMaxRetryTimeout = fragmentLoadMaxRetryTimeout;\n\t this.el.playerSetFragmentLoadMaxRetryTimeout(this._fragmentLoadMaxRetryTimeout);\n\t };\n\t\n\t FlasHLS.prototype.setFragmentLoadSkipAfterMaxRetry = function setFragmentLoadSkipAfterMaxRetry(fragmentLoadSkipAfterMaxRetry) {\n\t this._fragmentLoadSkipAfterMaxRetry = fragmentLoadSkipAfterMaxRetry;\n\t this.el.playerSetFragmentLoadSkipAfterMaxRetry(this._fragmentLoadSkipAfterMaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setMaxSkippedFragments = function setMaxSkippedFragments(maxSkippedFragments) {\n\t this._maxSkippedFragments = maxSkippedFragments;\n\t this.el.playerSetMaxSkippedFragments(this._maxSkippedFragments);\n\t };\n\t\n\t FlasHLS.prototype.setFlushLiveURLCache = function setFlushLiveURLCache(flushLiveURLCache) {\n\t this._flushLiveURLCache = flushLiveURLCache;\n\t this.el.playerSetFlushLiveURLCache(this._flushLiveURLCache);\n\t };\n\t\n\t FlasHLS.prototype.setInitialLiveManifestSize = function setInitialLiveManifestSize(initialLiveManifestSize) {\n\t this._initialLiveManifestSize = initialLiveManifestSize;\n\t this.el.playerSetInitialLiveManifestSize(this._initialLiveManifestSize);\n\t };\n\t\n\t FlasHLS.prototype.setManifestLoadMaxRetry = function setManifestLoadMaxRetry(manifestLoadMaxRetry) {\n\t this._manifestLoadMaxRetry = manifestLoadMaxRetry;\n\t this.el.playerSetManifestLoadMaxRetry(this._manifestLoadMaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setManifestLoadMaxRetryTimeout = function setManifestLoadMaxRetryTimeout(manifestLoadMaxRetryTimeout) {\n\t this._manifestLoadMaxRetryTimeout = manifestLoadMaxRetryTimeout;\n\t this.el.playerSetManifestLoadMaxRetryTimeout(this._manifestLoadMaxRetryTimeout);\n\t };\n\t\n\t FlasHLS.prototype.setManifestRedundantLoadmaxRetry = function setManifestRedundantLoadmaxRetry(manifestRedundantLoadmaxRetry) {\n\t this._manifestRedundantLoadmaxRetry = manifestRedundantLoadmaxRetry;\n\t this.el.playerSetManifestRedundantLoadmaxRetry(this._manifestRedundantLoadmaxRetry);\n\t };\n\t\n\t FlasHLS.prototype.setStartFromBitrate = function setStartFromBitrate(startFromBitrate) {\n\t this._startFromBitrate = startFromBitrate;\n\t this.el.playerSetStartFromBitrate(this._startFromBitrate);\n\t };\n\t\n\t FlasHLS.prototype.setStartFromLevel = function setStartFromLevel(startFromLevel) {\n\t this._startFromLevel = startFromLevel;\n\t this.el.playerSetStartFromLevel(this._startFromLevel);\n\t };\n\t\n\t FlasHLS.prototype.setAutoStartMaxDuration = function setAutoStartMaxDuration(autoStartMaxDuration) {\n\t this._autoStartMaxDuration = autoStartMaxDuration;\n\t this.el.playerSetAutoStartMaxDuration(this._autoStartMaxDuration);\n\t };\n\t\n\t FlasHLS.prototype.setSeekFromLevel = function setSeekFromLevel(seekFromLevel) {\n\t this._seekFromLevel = seekFromLevel;\n\t this.el.playerSetSeekFromLevel(this._seekFromLevel);\n\t };\n\t\n\t FlasHLS.prototype.setUseHardwareVideoDecoder = function setUseHardwareVideoDecoder(useHardwareVideoDecoder) {\n\t this._useHardwareVideoDecoder = useHardwareVideoDecoder;\n\t this.el.playerSetUseHardwareVideoDecoder(this._useHardwareVideoDecoder);\n\t };\n\t\n\t FlasHLS.prototype.setSetLogInfo = function setSetLogInfo(hlsLogEnabled) {\n\t this._hlsLogEnabled = hlsLogEnabled;\n\t this.el.playerSetLogInfo(this._hlsLogEnabled);\n\t };\n\t\n\t FlasHLS.prototype.setLogDebug = function setLogDebug(logDebug) {\n\t this._logDebug = logDebug;\n\t this.el.playerSetLogDebug(this._logDebug);\n\t };\n\t\n\t FlasHLS.prototype.setLogDebug2 = function setLogDebug2(logDebug2) {\n\t this._logDebug2 = logDebug2;\n\t this.el.playerSetLogDebug2(this._logDebug2);\n\t };\n\t\n\t FlasHLS.prototype.setLogWarn = function setLogWarn(logWarn) {\n\t this._logWarn = logWarn;\n\t this.el.playerSetLogWarn(this._logWarn);\n\t };\n\t\n\t FlasHLS.prototype.setLogError = function setLogError(logError) {\n\t this._logError = logError;\n\t this.el.playerSetLogError(this._logError);\n\t };\n\t\n\t FlasHLS.prototype._levelChanged = function _levelChanged(level) {\n\t var currentLevel = this.el.getLevels()[level];\n\t if (currentLevel) {\n\t this.highDefinition = currentLevel.height >= 720 || currentLevel.bitrate / 1000 >= 2000;\n\t this.trigger(_events2.default.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition);\n\t\n\t if (!this._levels || this._levels.length === 0) this._fillLevels();\n\t\n\t this.trigger(_events2.default.PLAYBACK_BITRATE, {\n\t height: currentLevel.height,\n\t width: currentLevel.width,\n\t bandwidth: currentLevel.bitrate,\n\t bitrate: currentLevel.bitrate,\n\t level: level\n\t });\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_END);\n\t }\n\t };\n\t\n\t FlasHLS.prototype._updateTime = function _updateTime(timeMetrics) {\n\t if (this._currentState === 'IDLE') {\n\t return;\n\t }\n\t\n\t var duration = this._normalizeDuration(timeMetrics.duration);\n\t var position = Math.min(Math.max(timeMetrics.position, 0), duration);\n\t var previousDVRStatus = this._dvrEnabled;\n\t var livePlayback = this._playbackType === _playback2.default.LIVE;\n\t this._dvrEnabled = livePlayback && duration > this._hlsMinimumDvrSize;\n\t\n\t if (duration === 100 || livePlayback === undefined) {\n\t return;\n\t }\n\t\n\t if (this._dvrEnabled !== previousDVRStatus) {\n\t this._updateSettings();\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE, this.name);\n\t }\n\t\n\t if (livePlayback && (!this._dvrEnabled || !this._dvrInUse)) {\n\t position = duration;\n\t }\n\t\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: position, total: duration }, this.name);\n\t };\n\t\n\t FlasHLS.prototype.play = function play() {\n\t this.trigger(_events2.default.PLAYBACK_PLAY_INTENT);\n\t if (this._currentState === 'PAUSED') {\n\t this.el.playerResume();\n\t } else if (!this._srcLoaded && this._currentState !== 'PLAYING') {\n\t this._firstPlay();\n\t } else {\n\t this.el.playerPlay();\n\t }\n\t };\n\t\n\t FlasHLS.prototype.getPlaybackType = function getPlaybackType() {\n\t return this._playbackType ? this._playbackType : null;\n\t };\n\t\n\t FlasHLS.prototype.getCurrentLevelIndex = function getCurrentLevelIndex() {\n\t return this._currentLevel;\n\t };\n\t\n\t FlasHLS.prototype.getCurrentLevel = function getCurrentLevel() {\n\t return this.levels[this.currentLevel];\n\t };\n\t\n\t FlasHLS.prototype.getCurrentBitrate = function getCurrentBitrate() {\n\t return this.levels[this.currentLevel].bitrate;\n\t };\n\t\n\t FlasHLS.prototype.setCurrentLevel = function setCurrentLevel(level) {\n\t this.currentLevel = level;\n\t };\n\t\n\t FlasHLS.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() {\n\t return this.highDefinition;\n\t };\n\t\n\t FlasHLS.prototype.getLevels = function getLevels() {\n\t return this.levels;\n\t };\n\t\n\t FlasHLS.prototype._setPlaybackState = function _setPlaybackState(state) {\n\t if (['PLAYING_BUFFERING', 'PAUSED_BUFFERING'].indexOf(state) >= 0) {\n\t this._bufferingState = true;\n\t this.trigger(_events2.default.PLAYBACK_BUFFERING, this.name);\n\t this._updateCurrentState(state);\n\t } else if (['PLAYING', 'PAUSED'].indexOf(state) >= 0) {\n\t if (['PLAYING_BUFFERING', 'PAUSED_BUFFERING', 'IDLE'].indexOf(this._currentState) >= 0) {\n\t this._bufferingState = false;\n\t this.trigger(_events2.default.PLAYBACK_BUFFERFULL, this.name);\n\t }\n\t this._updateCurrentState(state);\n\t } else if (state === 'IDLE') {\n\t this._srcLoaded = false;\n\t if (this._loop && ['PLAYING_BUFFERING', 'PLAYING'].indexOf(this._currentState) >= 0) {\n\t this.play();\n\t this.seek(0);\n\t } else {\n\t this._updateCurrentState(state);\n\t this._hasEnded = true;\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 0, total: this.getDuration() }, this.name);\n\t this.trigger(_events2.default.PLAYBACK_ENDED, this.name);\n\t }\n\t }\n\t };\n\t\n\t FlasHLS.prototype._updateCurrentState = function _updateCurrentState(state) {\n\t this._currentState = state;\n\t if (state !== 'IDLE') {\n\t this._hasEnded = false;\n\t }\n\t this._updatePlaybackType();\n\t if (state === 'PLAYING') {\n\t this.trigger(_events2.default.PLAYBACK_PLAY, this.name);\n\t } else if (state === 'PAUSED') {\n\t this.trigger(_events2.default.PLAYBACK_PAUSE, this.name);\n\t }\n\t };\n\t\n\t FlasHLS.prototype._updatePlaybackType = function _updatePlaybackType() {\n\t this._playbackType = this.el.getType();\n\t if (this._playbackType) {\n\t this._playbackType = this._playbackType.toLowerCase();\n\t if (this._playbackType === _playback2.default.VOD) {\n\t this._startReportingProgress();\n\t } else {\n\t this._stopReportingProgress();\n\t }\n\t }\n\t this.trigger(_events2.default.PLAYBACK_PLAYBACKSTATE, { type: this._playbackType });\n\t };\n\t\n\t FlasHLS.prototype._startReportingProgress = function _startReportingProgress() {\n\t if (!this._reportingProgress) {\n\t this._reportingProgress = true;\n\t }\n\t };\n\t\n\t FlasHLS.prototype._stopReportingProgress = function _stopReportingProgress() {\n\t this._reportingProgress = false;\n\t };\n\t\n\t FlasHLS.prototype._onFragmentLoaded = function _onFragmentLoaded(loadmetrics) {\n\t this.trigger(_events2.default.PLAYBACK_FRAGMENT_LOADED, loadmetrics);\n\t if (this._reportingProgress && this.el.getPosition) {\n\t var buffered = this.el.getPosition() + this.el.getbufferLength();\n\t this.trigger(_events2.default.PLAYBACK_PROGRESS, {\n\t start: this.el.getPosition(),\n\t current: buffered,\n\t total: this.el.getDuration()\n\t });\n\t }\n\t };\n\t\n\t FlasHLS.prototype._onLevelEndlist = function _onLevelEndlist() {\n\t this._updatePlaybackType();\n\t };\n\t\n\t FlasHLS.prototype._firstPlay = function _firstPlay() {\n\t var _this4 = this;\n\t\n\t this._shouldPlayOnManifestLoaded = true;\n\t if (this.el.playerLoad) {\n\t _mediator2.default.once(this.cid + ':manifestloaded', function (duration, loadmetrics) {\n\t return _this4._manifestLoaded(duration, loadmetrics);\n\t });\n\t this._setFlashSettings(); //ensure flushLiveURLCache will work (#327)\n\t this.el.playerLoad(this._src);\n\t this._srcLoaded = true;\n\t }\n\t };\n\t\n\t FlasHLS.prototype.volume = function volume(value) {\n\t var _this5 = this;\n\t\n\t if (this.isReady) {\n\t this.el.playerVolume(value);\n\t } else {\n\t this.listenToOnce(this, _events2.default.PLAYBACK_BUFFERFULL, function () {\n\t return _this5.volume(value);\n\t });\n\t }\n\t };\n\t\n\t FlasHLS.prototype.pause = function pause() {\n\t if (this._playbackType !== _playback2.default.LIVE || this._dvrEnabled) {\n\t this.el.playerPause();\n\t if (this._playbackType === _playback2.default.LIVE && this._dvrEnabled) {\n\t this._updateDvr(true);\n\t }\n\t }\n\t };\n\t\n\t FlasHLS.prototype.stop = function stop() {\n\t this._srcLoaded = false;\n\t this.el.playerStop();\n\t this.trigger(_events2.default.PLAYBACK_STOP);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: 0, total: 0 }, this.name);\n\t };\n\t\n\t FlasHLS.prototype.isPlaying = function isPlaying() {\n\t if (this._currentState) {\n\t return !!this._currentState.match(/playing/i);\n\t }\n\t return false;\n\t };\n\t\n\t FlasHLS.prototype.getDuration = function getDuration() {\n\t return this._normalizeDuration(this.el.getDuration());\n\t };\n\t\n\t FlasHLS.prototype._normalizeDuration = function _normalizeDuration(duration) {\n\t if (this._playbackType === _playback2.default.LIVE) {\n\t // estimate 10 seconds of buffer time for live streams for seek positions\n\t duration = Math.max(0, duration - 10);\n\t }\n\t return duration;\n\t };\n\t\n\t FlasHLS.prototype.seekPercentage = function seekPercentage(percentage) {\n\t var duration = this.el.getDuration();\n\t var time = 0;\n\t if (percentage > 0) {\n\t time = duration * percentage / 100;\n\t }\n\t this.seek(time);\n\t };\n\t\n\t FlasHLS.prototype.seek = function seek(time) {\n\t var duration = this.getDuration();\n\t if (this._playbackType === _playback2.default.LIVE) {\n\t // seek operations to a time within 3 seconds from live stream will position playhead back to live\n\t var dvrInUse = duration - time > 3;\n\t this._updateDvr(dvrInUse);\n\t }\n\t this.el.playerSeek(time);\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, { current: time, total: duration }, this.name);\n\t };\n\t\n\t FlasHLS.prototype._updateDvr = function _updateDvr(dvrInUse) {\n\t var previousDvrInUse = !!this._dvrInUse;\n\t this._dvrInUse = dvrInUse;\n\t if (this._dvrInUse !== previousDvrInUse) {\n\t this._updateSettings();\n\t this.trigger(_events2.default.PLAYBACK_DVR, this._dvrInUse);\n\t this.trigger(_events2.default.PLAYBACK_STATS_ADD, { 'dvr': this._dvrInUse });\n\t }\n\t };\n\t\n\t FlasHLS.prototype._flashPlaybackError = function _flashPlaybackError(code, url, message) {\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { code: code, url: url, message: message });\n\t this.trigger(_events2.default.PLAYBACK_STOP);\n\t };\n\t\n\t FlasHLS.prototype._manifestLoaded = function _manifestLoaded(duration, loadmetrics) {\n\t if (this._shouldPlayOnManifestLoaded) {\n\t this._shouldPlayOnManifestLoaded = false;\n\t // this method initialises the player (and starts playback)\n\t // this needs to happen before PLAYBACK_LOADEDMETADATA is fired\n\t // as the user may call seek() in a LOADEDMETADATA listener.\n\t /// when playerPlay() is called the player seeks to 0\n\t this.el.playerPlay();\n\t }\n\t\n\t this._fillLevels();\n\t this.trigger(_events2.default.PLAYBACK_LOADEDMETADATA, { duration: duration, data: loadmetrics });\n\t };\n\t\n\t FlasHLS.prototype._fillLevels = function _fillLevels() {\n\t var levels = this.el.getLevels();\n\t var levelsLength = levels.length;\n\t this._levels = [];\n\t\n\t for (var index = 0; index < levelsLength; index++) {\n\t this._levels.push({ id: index, label: levels[index].height + 'p', level: levels[index] });\n\t }\n\t this.trigger(_events2.default.PLAYBACK_LEVELS_AVAILABLE, this._levels);\n\t };\n\t\n\t FlasHLS.prototype.destroy = function destroy() {\n\t this.stopListening();\n\t this.$el.remove();\n\t };\n\t\n\t FlasHLS.prototype._updateSettings = function _updateSettings() {\n\t this.settings = _clapprZepto2.default.extend({}, this._defaultSettings);\n\t if (this._playbackType === _playback2.default.VOD || this._dvrInUse) {\n\t this.settings.left = ['playpause', 'position', 'duration'];\n\t this.settings.seekEnabled = true;\n\t } else if (this._dvrEnabled) {\n\t this.settings.left = ['playpause'];\n\t this.settings.seekEnabled = true;\n\t } else {\n\t this.settings.seekEnabled = false;\n\t }\n\t };\n\t\n\t FlasHLS.prototype._createCallbacks = function _createCallbacks() {\n\t var _this6 = this;\n\t\n\t if (!window.Clappr) {\n\t window.Clappr = {};\n\t }\n\t if (!window.Clappr.flashlsCallbacks) {\n\t window.Clappr.flashlsCallbacks = {};\n\t }\n\t this.flashlsEvents = new _flashls_events2.default(this.cid);\n\t window.Clappr.flashlsCallbacks[this.cid] = function (eventName, args) {\n\t _this6.flashlsEvents[eventName].apply(_this6.flashlsEvents, args);\n\t };\n\t };\n\t\n\t FlasHLS.prototype.render = function render() {\n\t _BaseFlashPlayback.prototype.render.call(this);\n\t this._createCallbacks();\n\t return this;\n\t };\n\t\n\t _createClass(FlasHLS, [{\n\t key: 'isReady',\n\t get: function get() {\n\t return this._isReadyState;\n\t }\n\t }, {\n\t key: 'dvrEnabled',\n\t get: function get() {\n\t return !!this._dvrEnabled;\n\t }\n\t }]);\n\t\n\t return FlasHLS;\n\t}(_base_flash_playback2.default);\n\t\n\texports.default = FlasHLS;\n\t\n\t\n\tFlasHLS.canPlay = function (resource, mimeType) {\n\t var resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || [];\n\t return _browser2.default.hasFlash && (resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'm3u8' || mimeType === 'application/x-mpegURL' || mimeType === 'application/vnd.apple.mpegurl');\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 50 */\n/*!*************************************************!*\\\n !*** ./src/playbacks/flashls/flashls_events.js ***!\n \\*************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _mediator = __webpack_require__(/*! ../../components/mediator */ 11);\n\t\n\tvar _mediator2 = _interopRequireDefault(_mediator);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar HLSEvents = function () {\n\t function HLSEvents(instanceId) {\n\t _classCallCheck(this, HLSEvents);\n\t\n\t this.instanceId = instanceId;\n\t }\n\t\n\t HLSEvents.prototype.ready = function ready() {\n\t _mediator2.default.trigger(this.instanceId + ':flashready');\n\t };\n\t\n\t HLSEvents.prototype.videoSize = function videoSize(width, height) {\n\t _mediator2.default.trigger(this.instanceId + ':videosizechanged', width, height);\n\t };\n\t\n\t HLSEvents.prototype.complete = function complete() {\n\t _mediator2.default.trigger(this.instanceId + ':complete');\n\t };\n\t\n\t HLSEvents.prototype.error = function error(code, url, message) {\n\t _mediator2.default.trigger(this.instanceId + ':error', code, url, message);\n\t };\n\t\n\t HLSEvents.prototype.manifest = function manifest(duration, loadmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':manifestloaded', duration, loadmetrics);\n\t };\n\t\n\t HLSEvents.prototype.audioLevelLoaded = function audioLevelLoaded(loadmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':audiolevelloaded', loadmetrics);\n\t };\n\t\n\t HLSEvents.prototype.levelLoaded = function levelLoaded(loadmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':levelloaded', loadmetrics);\n\t };\n\t\n\t HLSEvents.prototype.levelEndlist = function levelEndlist(level) {\n\t _mediator2.default.trigger(this.instanceId + ':levelendlist', level);\n\t };\n\t\n\t HLSEvents.prototype.fragmentLoaded = function fragmentLoaded(loadmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':fragmentloaded', loadmetrics);\n\t };\n\t\n\t HLSEvents.prototype.fragmentPlaying = function fragmentPlaying(playmetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':fragmentplaying', playmetrics);\n\t };\n\t\n\t HLSEvents.prototype.position = function position(timemetrics) {\n\t _mediator2.default.trigger(this.instanceId + ':timeupdate', timemetrics);\n\t };\n\t\n\t HLSEvents.prototype.state = function state(newState) {\n\t _mediator2.default.trigger(this.instanceId + ':playbackstate', newState);\n\t };\n\t\n\t HLSEvents.prototype.seekState = function seekState(newState) {\n\t _mediator2.default.trigger(this.instanceId + ':seekstate', newState);\n\t };\n\t\n\t HLSEvents.prototype.switch = function _switch(newLevel) {\n\t _mediator2.default.trigger(this.instanceId + ':levelchanged', newLevel);\n\t };\n\t\n\t HLSEvents.prototype.audioTracksListChange = function audioTracksListChange(trackList) {\n\t _mediator2.default.trigger(this.instanceId + ':audiotracklistchanged', trackList);\n\t };\n\t\n\t HLSEvents.prototype.audioTrackChange = function audioTrackChange(trackId) {\n\t _mediator2.default.trigger(this.instanceId + ':audiotrackchanged', trackId);\n\t };\n\t\n\t return HLSEvents;\n\t}();\n\t\n\texports.default = HLSEvents;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 51 */\n/*!**********************************!*\\\n !*** ./src/playbacks/hls/hls.js ***!\n \\**********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _html5_video = __webpack_require__(/*! playbacks/html5_video */ 16);\n\t\n\tvar _html5_video2 = _interopRequireDefault(_html5_video);\n\t\n\tvar _hls = __webpack_require__(/*! hls.js */ 90);\n\t\n\tvar _hls2 = _interopRequireDefault(_hls);\n\t\n\tvar _lodash = __webpack_require__(/*! lodash.isequal */ 99);\n\t\n\tvar _lodash2 = _interopRequireDefault(_lodash);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _log = __webpack_require__(/*! plugins/log */ 19);\n\t\n\tvar _log2 = _interopRequireDefault(_log);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar AUTO = -1;\n\t\n\tvar HLS = function (_HTML5VideoPlayback) {\n\t _inherits(HLS, _HTML5VideoPlayback);\n\t\n\t _createClass(HLS, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'hls';\n\t }\n\t }, {\n\t key: 'levels',\n\t get: function get() {\n\t return this._levels || [];\n\t }\n\t }, {\n\t key: 'currentLevel',\n\t get: function get() {\n\t if (this._currentLevel === null || this._currentLevel === undefined) {\n\t return AUTO;\n\t } else {\n\t return this._currentLevel; //0 is a valid level ID\n\t }\n\t },\n\t set: function set(id) {\n\t this._currentLevel = id;\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_START);\n\t this._hls.currentLevel = this._currentLevel;\n\t }\n\t }, {\n\t key: '_startTime',\n\t get: function get() {\n\t if (this._playbackType === _playback2.default.LIVE && this._playlistType !== 'EVENT') {\n\t return this._extrapolatedStartTime;\n\t }\n\t return this._playableRegionStartTime;\n\t }\n\t }, {\n\t key: '_now',\n\t get: function get() {\n\t return (0, _utils.now)();\n\t }\n\t\n\t // the time in the video element which should represent the start of the sliding window\n\t // extrapolated to increase in real time (instead of jumping as the early segments are removed)\n\t\n\t }, {\n\t key: '_extrapolatedStartTime',\n\t get: function get() {\n\t if (!this._localStartTimeCorrelation) {\n\t return this._playableRegionStartTime;\n\t }\n\t var corr = this._localStartTimeCorrelation;\n\t var timePassed = this._now - corr.local;\n\t var extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000;\n\t // cap at the end of the extrapolated window duration\n\t return Math.min(extrapolatedWindowStartTime, this._playableRegionStartTime + this._extrapolatedWindowDuration);\n\t }\n\t\n\t // the time in the video element which should represent the end of the content\n\t // extrapolated to increase in real time (instead of jumping as segments are added)\n\t\n\t }, {\n\t key: '_extrapolatedEndTime',\n\t get: function get() {\n\t var actualEndTime = this._playableRegionStartTime + this._playableRegionDuration;\n\t if (!this._localEndTimeCorrelation) {\n\t return actualEndTime;\n\t }\n\t var corr = this._localEndTimeCorrelation;\n\t var timePassed = this._now - corr.local;\n\t var extrapolatedEndTime = (corr.remote + timePassed) / 1000;\n\t return Math.max(actualEndTime - this._extrapolatedWindowDuration, Math.min(extrapolatedEndTime, actualEndTime));\n\t }\n\t }, {\n\t key: '_duration',\n\t get: function get() {\n\t return this._extrapolatedEndTime - this._startTime;\n\t }\n\t\n\t // Returns the duration (seconds) of the window that the extrapolated start time is allowed\n\t // to move in before being capped.\n\t // The extrapolated start time should never reach the cap at the end of the window as the\n\t // window should slide as chunks are removed from the start.\n\t // This also applies to the extrapolated end time in the same way.\n\t //\n\t // If chunks aren't being removed for some reason that the start time will reach and remain fixed at\n\t // playableRegionStartTime + extrapolatedWindowDuration\n\t //\n\t // <-- window duration -->\n\t // I.e playableRegionStartTime |-----------------------|\n\t // | --> . . .\n\t // . --> | --> . .\n\t // . . --> | --> .\n\t // . . . --> |\n\t // . . . .\n\t // extrapolatedStartTime\n\t\n\t }, {\n\t key: '_extrapolatedWindowDuration',\n\t get: function get() {\n\t if (this._segmentTargetDuration === null) {\n\t return 0;\n\t }\n\t return this._extrapolatedWindowNumSegments * this._segmentTargetDuration;\n\t }\n\t }]);\n\t\n\t function HLS() {\n\t _classCallCheck(this, HLS);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t // backwards compatibility (TODO: remove on 0.3.0)\n\t var _this = _possibleConstructorReturn(this, _HTML5VideoPlayback.call.apply(_HTML5VideoPlayback, [this].concat(args)));\n\t\n\t _this.options.playback || (_this.options.playback = _this.options);\n\t _this._minDvrSize = typeof _this.options.hlsMinimumDvrSize === 'undefined' ? 60 : _this.options.hlsMinimumDvrSize;\n\t // The size of the start time extrapolation window measured as a multiple of segments.\n\t // Should be 2 or higher, or 0 to disable. Should only need to be increased above 2 if more than one segment is\n\t // removed from the start of the playlist at a time. E.g if the playlist is cached for 10 seconds and new chunks are\n\t // added/removed every 5.\n\t _this._extrapolatedWindowNumSegments = !_this.options.playback || typeof _this.options.playback.extrapolatedWindowNumSegments === 'undefined' ? 2 : _this.options.playback.extrapolatedWindowNumSegments;\n\t\n\t _this._playbackType = _playback2.default.VOD;\n\t _this._lastTimeUpdate = null;\n\t _this._lastDuration = null;\n\t // for hls streams which have dvr with a sliding window,\n\t // the content at the start of the playlist is removed as new\n\t // content is appended at the end.\n\t // this means the actual playable start time will increase as the\n\t // start content is deleted\n\t // For streams with dvr where the entire recording is kept from the\n\t // beginning this should stay as 0\n\t _this._playableRegionStartTime = 0;\n\t // {local, remote} remote is the time in the video element that should represent 0\n\t // local is the system time when the 'remote' measurment took place\n\t _this._localStartTimeCorrelation = null;\n\t // {local, remote} remote is the time in the video element that should represents the end\n\t // local is the system time when the 'remote' measurment took place\n\t _this._localEndTimeCorrelation = null;\n\t // if content is removed from the beginning then this empty area should\n\t // be ignored. \"playableRegionDuration\" excludes the empty area\n\t _this._playableRegionDuration = 0;\n\t // true when the actual duration is longer than hlsjs's live sync point\n\t // when this is false playableRegionDuration will be the actual duration\n\t // when this is true playableRegionDuration will exclude the time after the sync point\n\t _this._durationExcludesAfterLiveSyncPoint = false;\n\t // #EXT-X-TARGETDURATION\n\t _this._segmentTargetDuration = null;\n\t // #EXT-X-PLAYLIST-TYPE\n\t _this._playlistType = null;\n\t _this._recoverAttemptsRemaining = _this.options.hlsRecoverAttempts || 16;\n\t _this._startTimeUpdateTimer();\n\t return _this;\n\t }\n\t\n\t HLS.prototype._setupHls = function _setupHls() {\n\t var _this2 = this;\n\t\n\t this._hls = new _hls2.default(this.options.playback.hlsjsConfig || {});\n\t this._hls.on(_hls2.default.Events.MEDIA_ATTACHED, function () {\n\t return _this2._hls.loadSource(_this2.options.src);\n\t });\n\t this._hls.on(_hls2.default.Events.LEVEL_LOADED, function (evt, data) {\n\t return _this2._updatePlaybackType(evt, data);\n\t });\n\t this._hls.on(_hls2.default.Events.LEVEL_UPDATED, function (evt, data) {\n\t return _this2._onLevelUpdated(evt, data);\n\t });\n\t this._hls.on(_hls2.default.Events.LEVEL_SWITCH, function (evt, data) {\n\t return _this2._onLevelSwitch(evt, data);\n\t });\n\t this._hls.on(_hls2.default.Events.FRAG_LOADED, function (evt, data) {\n\t return _this2._onFragmentLoaded(evt, data);\n\t });\n\t this._hls.on(_hls2.default.Events.ERROR, function (evt, data) {\n\t return _this2._onHLSJSError(evt, data);\n\t });\n\t this._hls.attachMedia(this.el);\n\t };\n\t\n\t HLS.prototype._recover = function _recover(evt, data) {\n\t if (!this._recoveredDecodingError) {\n\t this._recoveredDecodingError = true;\n\t this._hls.recoverMediaError();\n\t } else if (!this._recoveredAudioCodecError) {\n\t this._recoveredAudioCodecError = true;\n\t this._hls.swapAudioCodec();\n\t this._hls.recoverMediaError();\n\t } else {\n\t _log2.default.error('hlsjs: failed to recover');\n\t this.trigger(_events2.default.PLAYBACK_ERROR, 'hlsjs: could not recover from error, evt ' + evt + ', data ' + data + ' ', this.name);\n\t }\n\t };\n\t\n\t // override\n\t\n\t\n\t HLS.prototype._setupSrc = function _setupSrc(srcUrl) {// eslint-disable-line no-unused-vars\n\t // this playback manages the src on the video element itself\n\t };\n\t\n\t HLS.prototype._startTimeUpdateTimer = function _startTimeUpdateTimer() {\n\t var _this3 = this;\n\t\n\t this._timeUpdateTimer = setInterval(function () {\n\t _this3._onDurationChange();\n\t _this3._onTimeUpdate();\n\t }, 100);\n\t };\n\t\n\t HLS.prototype._stopTimeUpdateTimer = function _stopTimeUpdateTimer() {\n\t clearInterval(this._timeUpdateTimer);\n\t };\n\t\n\t // the duration on the video element itself should not be used\n\t // as this does not necesarily represent the duration of the stream\n\t // https://github.com/clappr/clappr/issues/668#issuecomment-157036678\n\t\n\t\n\t HLS.prototype.getDuration = function getDuration() {\n\t return this._duration;\n\t };\n\t\n\t HLS.prototype.getCurrentTime = function getCurrentTime() {\n\t // e.g. can be < 0 if user pauses near the start\n\t // eventually they will then be kicked to the end by hlsjs if they run out of buffer\n\t // before the official start time\n\t return Math.max(0, this.el.currentTime - this._startTime);\n\t };\n\t\n\t // the time that \"0\" now represents relative to when playback started\n\t // for a stream with a sliding window this will increase as content is\n\t // removed from the beginning\n\t\n\t\n\t HLS.prototype.getStartTimeOffset = function getStartTimeOffset() {\n\t return this._startTime;\n\t };\n\t\n\t HLS.prototype.seekPercentage = function seekPercentage(percentage) {\n\t var seekTo = this._duration;\n\t if (percentage > 0) {\n\t seekTo = this._duration * (percentage / 100);\n\t }\n\t this.seek(seekTo);\n\t };\n\t\n\t HLS.prototype.seek = function seek(time) {\n\t if (time < 0) {\n\t _log2.default.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.');\n\t time = this.getDuration();\n\t }\n\t // assume live if time within 3 seconds of end of stream\n\t this.dvrEnabled && this._updateDvr(time < this.getDuration() - 3);\n\t time += this._startTime;\n\t _HTML5VideoPlayback.prototype.seek.call(this, time);\n\t };\n\t\n\t HLS.prototype.seekToLivePoint = function seekToLivePoint() {\n\t this.seek(this.getDuration());\n\t };\n\t\n\t HLS.prototype._updateDvr = function _updateDvr(status) {\n\t this.trigger(_events2.default.PLAYBACK_DVR, status);\n\t this.trigger(_events2.default.PLAYBACK_STATS_ADD, { 'dvr': status });\n\t };\n\t\n\t HLS.prototype._updateSettings = function _updateSettings() {\n\t if (this._playbackType === _playback2.default.VOD) {\n\t this.settings.left = ['playpause', 'position', 'duration'];\n\t } else if (this.dvrEnabled) {\n\t this.settings.left = ['playpause'];\n\t } else {\n\t this.settings.left = ['playstop'];\n\t }\n\t this.settings.seekEnabled = this.isSeekEnabled();\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE);\n\t };\n\t\n\t HLS.prototype._onHLSJSError = function _onHLSJSError(evt, data) {\n\t // only report/handle errors if they are fatal\n\t // hlsjs should automatically handle non fatal errors\n\t if (data.fatal) {\n\t if (this._recoverAttemptsRemaining > 0) {\n\t this._recoverAttemptsRemaining -= 1;\n\t switch (data.type) {\n\t case _hls2.default.ErrorTypes.NETWORK_ERROR:\n\t _log2.default.warn('hlsjs: trying to recover from network error, evt ' + evt + ', data ' + data + ' ');\n\t this._hls.startLoad();\n\t break;\n\t case _hls2.default.ErrorTypes.MEDIA_ERROR:\n\t _log2.default.warn('hlsjs: trying to recover from media error, evt ' + evt + ', data ' + data + ' ');\n\t this._recover(evt, data);\n\t break;\n\t default:\n\t _log2.default.error('hlsjs: trying to recover from error, evt ' + evt + ', data ' + data + ' ');\n\t this.trigger(_events2.default.PLAYBACK_ERROR, 'hlsjs: could not recover from error, evt ' + evt + ', data ' + data + ' ', this.name);\n\t break;\n\t }\n\t } else {\n\t _log2.default.error('hlsjs: could not recover from error after maximum number of attempts, evt ' + evt + ', data ' + data + ' ');\n\t this.trigger(_events2.default.PLAYBACK_ERROR, { evt: evt, data: data }, this.name);\n\t }\n\t } else {\n\t _log2.default.warn('hlsjs: non-fatal error occurred, evt ' + evt + ', data ' + data + ' ');\n\t }\n\t };\n\t\n\t HLS.prototype._onTimeUpdate = function _onTimeUpdate() {\n\t var update = { current: this.getCurrentTime(), total: this.getDuration() };\n\t if ((0, _lodash2.default)(update, this._lastTimeUpdate)) {\n\t return;\n\t }\n\t this._lastTimeUpdate = update;\n\t this.trigger(_events2.default.PLAYBACK_TIMEUPDATE, update, this.name);\n\t };\n\t\n\t HLS.prototype._onDurationChange = function _onDurationChange() {\n\t var duration = this.getDuration();\n\t if (this._lastDuration === duration) {\n\t return;\n\t }\n\t this._lastDuration = duration;\n\t _HTML5VideoPlayback.prototype._onDurationChange.call(this);\n\t };\n\t\n\t HLS.prototype._onProgress = function _onProgress() {\n\t if (!this.el.buffered.length) {\n\t return;\n\t }\n\t var buffered = [];\n\t var bufferedPos = 0;\n\t for (var i = 0; i < this.el.buffered.length; i++) {\n\t buffered = [].concat(_toConsumableArray(buffered), [{\n\t // for a stream with sliding window dvr something that is buffered my slide off the start of the timeline\n\t start: Math.max(0, this.el.buffered.start(i) - this._playableRegionStartTime),\n\t end: Math.max(0, this.el.buffered.end(i) - this._playableRegionStartTime)\n\t }]);\n\t if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {\n\t bufferedPos = i;\n\t }\n\t }\n\t var progress = {\n\t start: buffered[bufferedPos].start,\n\t current: buffered[bufferedPos].end,\n\t total: this.getDuration()\n\t };\n\t this.trigger(_events2.default.PLAYBACK_PROGRESS, progress, buffered);\n\t };\n\t\n\t HLS.prototype.play = function play() {\n\t if (!this._hls) {\n\t this._setupHls();\n\t }\n\t _HTML5VideoPlayback.prototype.play.call(this);\n\t };\n\t\n\t HLS.prototype.pause = function pause() {\n\t if (!this._hls) {\n\t return;\n\t }\n\t _HTML5VideoPlayback.prototype.pause.call(this);\n\t if (this.dvrEnabled) {\n\t this._updateDvr(true);\n\t }\n\t };\n\t\n\t HLS.prototype.stop = function stop() {\n\t if (this._hls) {\n\t _HTML5VideoPlayback.prototype.stop.call(this);\n\t this._hls.destroy();\n\t delete this._hls;\n\t }\n\t };\n\t\n\t HLS.prototype.destroy = function destroy() {\n\t this._stopTimeUpdateTimer();\n\t if (this._hls) {\n\t this._hls.destroy();\n\t delete this._hls;\n\t }\n\t _HTML5VideoPlayback.prototype.destroy.call(this);\n\t };\n\t\n\t HLS.prototype._updatePlaybackType = function _updatePlaybackType(evt, data) {\n\t this._playbackType = data.details.live ? _playback2.default.LIVE : _playback2.default.VOD;\n\t this._fillLevels();\n\t this._onLevelUpdated(evt, data);\n\t };\n\t\n\t HLS.prototype._fillLevels = function _fillLevels() {\n\t this._levels = this._hls.levels.map(function (level, index) {\n\t return { id: index, level: level, label: level.bitrate / 1000 + 'Kbps' };\n\t });\n\t this.trigger(_events2.default.PLAYBACK_LEVELS_AVAILABLE, this._levels);\n\t };\n\t\n\t HLS.prototype._onLevelUpdated = function _onLevelUpdated(evt, data) {\n\t this._segmentTargetDuration = data.details.targetduration;\n\t this._playlistType = data.details.type || null;\n\t\n\t var startTimeChanged = false;\n\t var durationChanged = false;\n\t var fragments = data.details.fragments;\n\t var previousPlayableRegionStartTime = this._playableRegionStartTime;\n\t var previousPlayableRegionDuration = this._playableRegionDuration;\n\t\n\t if (fragments.length === 0) {\n\t return;\n\t }\n\t\n\t if (this._playableRegionStartTime !== fragments[0].start) {\n\t startTimeChanged = true;\n\t this._playableRegionStartTime = fragments[0].start;\n\t }\n\t\n\t if (startTimeChanged) {\n\t if (!this._localStartTimeCorrelation) {\n\t // set the correlation to map to middle of the extrapolation window\n\t this._localStartTimeCorrelation = {\n\t local: this._now,\n\t remote: (fragments[0].start + this._extrapolatedWindowDuration / 2) * 1000\n\t };\n\t } else {\n\t // check if the correlation still works\n\t var corr = this._localStartTimeCorrelation;\n\t var timePassed = this._now - corr.local;\n\t // this should point to a time within the extrapolation window\n\t var startTime = (corr.remote + timePassed) / 1000;\n\t if (startTime < fragments[0].start) {\n\t // our start time is now earlier than the first chunk\n\t // (maybe the chunk was removed early)\n\t // reset correlation so that it sits at the beginning of the first available chunk\n\t this._localStartTimeCorrelation = {\n\t local: this._now,\n\t remote: fragments[0].start * 1000\n\t };\n\t } else if (startTime > previousPlayableRegionStartTime + this._extrapolatedWindowDuration) {\n\t // start time was past the end of the old extrapolation window (so would have been capped)\n\t // see if now that time would be inside the window, and if it would be set the correlation\n\t // so that it resumes from the time it was at at the end of the old window\n\t // update the correlation so that the time starts counting again from the value it's on now\n\t this._localStartTimeCorrelation = {\n\t local: this._now,\n\t remote: Math.max(fragments[0].start, previousPlayableRegionStartTime + this._extrapolatedWindowDuration) * 1000\n\t };\n\t }\n\t }\n\t }\n\t\n\t var newDuration = data.details.totalduration;\n\t // if it's a live stream then shorten the duration to remove access\n\t // to the area after hlsjs's live sync point\n\t // seeks to areas after this point sometimes have issues\n\t if (this._playbackType === _playback2.default.LIVE) {\n\t var fragmentTargetDuration = data.details.targetduration;\n\t var hlsjsConfig = this.options.playback || {};\n\t var liveSyncDurationCount = hlsjsConfig.liveSyncDurationCount || _hls2.default.DefaultConfig.liveSyncDurationCount;\n\t var hiddenAreaDuration = fragmentTargetDuration * liveSyncDurationCount;\n\t if (hiddenAreaDuration <= newDuration) {\n\t newDuration -= hiddenAreaDuration;\n\t this._durationExcludesAfterLiveSyncPoint = true;\n\t } else {\n\t this._durationExcludesAfterLiveSyncPoint = false;\n\t }\n\t }\n\t\n\t if (newDuration !== this._playableRegionDuration) {\n\t durationChanged = true;\n\t this._playableRegionDuration = newDuration;\n\t }\n\t\n\t // Note the end time is not the playableRegionDuration\n\t // The end time will always increase even if content is removed from the beginning\n\t var endTime = fragments[0].start + newDuration;\n\t var previousEndTime = previousPlayableRegionStartTime + previousPlayableRegionDuration;\n\t var endTimeChanged = endTime !== previousEndTime;\n\t if (endTimeChanged) {\n\t if (!this._localEndTimeCorrelation) {\n\t // set the correlation to map to the end\n\t this._localEndTimeCorrelation = {\n\t local: this._now,\n\t remote: endTime * 1000\n\t };\n\t } else {\n\t // check if the correlation still works\n\t var _corr = this._localEndTimeCorrelation;\n\t var _timePassed = this._now - _corr.local;\n\t // this should point to a time within the extrapolation window from the end\n\t var extrapolatedEndTime = (_corr.remote + _timePassed) / 1000;\n\t if (extrapolatedEndTime > endTime) {\n\t this._localEndTimeCorrelation = {\n\t local: this._now,\n\t remote: endTime * 1000\n\t };\n\t } else if (extrapolatedEndTime < endTime - this._extrapolatedWindowDuration) {\n\t // our extrapolated end time is now earlier than the extrapolation window from the actual end time\n\t // (maybe a chunk became available early)\n\t // reset correlation so that it sits at the beginning of the extrapolation window from the end time\n\t this._localEndTimeCorrelation = {\n\t local: this._now,\n\t remote: (endTime - this._extrapolatedWindowDuration) * 1000\n\t };\n\t } else if (extrapolatedEndTime > previousEndTime) {\n\t // end time was past the old end time (so would have been capped)\n\t // set the correlation so that it resumes from the time it was at at the end of the old window\n\t this._localEndTimeCorrelation = {\n\t local: this._now,\n\t remote: previousEndTime * 1000\n\t };\n\t }\n\t }\n\t }\n\t\n\t // now that the values have been updated call any methods that use on them so they get the updated values\n\t // immediately\n\t durationChanged && this._onDurationChange();\n\t startTimeChanged && this._onProgress();\n\t };\n\t\n\t HLS.prototype._onFragmentLoaded = function _onFragmentLoaded(evt, data) {\n\t this.trigger(_events2.default.PLAYBACK_FRAGMENT_LOADED, data);\n\t };\n\t\n\t HLS.prototype._onLevelSwitch = function _onLevelSwitch(evt, data) {\n\t if (!this.levels.length) {\n\t this._fillLevels();\n\t }\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH_END);\n\t this.trigger(_events2.default.PLAYBACK_LEVEL_SWITCH, data);\n\t var currentLevel = this._hls.levels[data.level];\n\t if (currentLevel) {\n\t // TODO should highDefinition be private and maybe have a read only accessor if it's used somewhere\n\t this.highDefinition = currentLevel.height >= 720 || currentLevel.bitrate / 1000 >= 2000;\n\t this.trigger(_events2.default.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition);\n\t this.trigger(_events2.default.PLAYBACK_BITRATE, {\n\t height: currentLevel.height,\n\t width: currentLevel.width,\n\t bandwidth: currentLevel.bitrate,\n\t bitrate: currentLevel.bitrate,\n\t level: data.level\n\t });\n\t }\n\t };\n\t\n\t HLS.prototype.getPlaybackType = function getPlaybackType() {\n\t return this._playbackType;\n\t };\n\t\n\t HLS.prototype.isSeekEnabled = function isSeekEnabled() {\n\t return this._playbackType === _playback2.default.VOD || this.dvrEnabled;\n\t };\n\t\n\t _createClass(HLS, [{\n\t key: 'dvrEnabled',\n\t get: function get() {\n\t // enabled when:\n\t // - the duration does not include content after hlsjs's live sync point\n\t // - the playable region duration is longer than the configured duration to enable dvr after\n\t // - the playback type is LIVE.\n\t return this._durationExcludesAfterLiveSyncPoint && this._duration >= this._minDvrSize && this.getPlaybackType() === _playback2.default.LIVE;\n\t }\n\t }]);\n\t\n\t return HLS;\n\t}(_html5_video2.default);\n\t\n\texports.default = HLS;\n\t\n\t\n\tHLS.canPlay = function (resource, mimeType) {\n\t var resourceParts = resource.split('?')[0].match(/.*\\.(.*)$/) || [];\n\t var isHls = resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'm3u8' || mimeType === 'application/x-mpegURL' || mimeType === 'application/vnd.apple.mpegurl';\n\t\n\t return !!(_hls2.default.isSupported() && isHls && !_browser2.default.isSafari);\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 52 */\n/*!**************************************************!*\\\n !*** ./src/playbacks/html5_audio/html5_audio.js ***!\n \\**************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _html5_video = __webpack_require__(/*! playbacks/html5_video */ 16);\n\t\n\tvar _html5_video2 = _interopRequireDefault(_html5_video);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\t// TODO: remove this playback and change HTML5Video to HTML5Playback (breaking change, only after 0.3.0)\n\tvar HTML5Audio = function (_HTML5Video) {\n\t _inherits(HTML5Audio, _HTML5Video);\n\t\n\t function HTML5Audio() {\n\t _classCallCheck(this, HTML5Audio);\n\t\n\t return _possibleConstructorReturn(this, _HTML5Video.apply(this, arguments));\n\t }\n\t\n\t HTML5Audio.prototype.updateSettings = function updateSettings() {\n\t this.settings.left = ['playpause', 'position', 'duration'];\n\t this.settings.seekEnabled = this.isSeekEnabled();\n\t this.trigger(_events2.default.PLAYBACK_SETTINGSUPDATE);\n\t };\n\t\n\t HTML5Audio.prototype.getPlaybackType = function getPlaybackType() {\n\t return _playback2.default.AOD;\n\t };\n\t\n\t _createClass(HTML5Audio, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'html5_audio';\n\t }\n\t }, {\n\t key: 'tagName',\n\t get: function get() {\n\t return 'audio';\n\t }\n\t }, {\n\t key: 'isAudioOnly',\n\t get: function get() {\n\t return true;\n\t }\n\t }]);\n\t\n\t return HTML5Audio;\n\t}(_html5_video2.default);\n\t\n\texports.default = HTML5Audio;\n\t\n\t\n\tHTML5Audio.canPlay = function (resourceUrl, mimeType) {\n\t var mimetypes = {\n\t 'wav': ['audio/wav'],\n\t 'mp3': ['audio/mp3', 'audio/mpeg;codecs=\"mp3\"'],\n\t 'aac': ['audio/mp4;codecs=\"mp4a.40.5\"'],\n\t 'oga': ['audio/ogg']\n\t };\n\t return _html5_video2.default._canPlay('audio', mimetypes, resourceUrl, mimeType);\n\t};\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 53 */\n/*!**************************************************!*\\\n !*** ./src/playbacks/html5_video/html5_video.js ***!\n \\**************************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(/*! base/utils */ 2);\n\t\n\tvar _playback = __webpack_require__(/*! base/playback */ 3);\n\t\n\tvar _playback2 = _interopRequireDefault(_playback);\n\t\n\tvar _styler = __webpack_require__(/*! base/styler */ 4);\n\t\n\tvar _styler2 = _interopRequireDefault(_styler);\n\t\n\tvar _browser = __webpack_require__(/*! components/browser */ 8);\n\t\n\tvar _browser2 = _interopRequireDefault(_browser);\n\t\n\tvar _events = __webpack_require__(/*! base/events */ 1);\n\t\n\tvar _events2 = _interopRequireDefault(_events);\n\t\n\tvar _style = __webpack_require__(/*! ./public/style.scss */ 82);\n\t\n\tvar _style2 = _interopRequireDefault(_style);\n\t\n\tvar _clapprZepto = __webpack_require__(/*! clappr-zepto */ 5);\n\t\n\tvar _clapprZepto2 = _interopRequireDefault(_clapprZepto);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } // Copyright 2014 Globo.com Player authors. All rights reserved.\n\t// Use of this source code is governed by a BSD-style\n\t// license that can be found in the LICENSE file.\n\t\n\tvar MIMETYPES = {\n\t 'mp4': ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(function (codec) {\n\t return 'video/mp4; codecs=\"' + codec + ', mp4a.40.2\"';\n\t }),\n\t 'ogg': ['video/ogg; codecs=\"theora, vorbis\"', 'video/ogg; codecs=\"dirac\"', 'video/ogg; codecs=\"theora, speex\"'],\n\t '3gpp': ['video/3gpp; codecs=\"mp4v.20.8, samr\"'],\n\t 'webm': ['video/webm; codecs=\"vp8, vorbis\"'],\n\t 'mkv': ['video/x-matroska; codecs=\"theora, vorbis\"'],\n\t 'm3u8': ['application/x-mpegurl']\n\t};\n\tMIMETYPES['ogv'] = MIMETYPES['ogg'];\n\tMIMETYPES['3gp'] = MIMETYPES['3gpp'];\n\t\n\tvar AUDIO_MIMETYPES = {\n\t 'wav': ['audio/wav'],\n\t 'mp3': ['audio/mp3', 'audio/mpeg;codecs=\"mp3\"'],\n\t 'aac': ['audio/mp4;codecs=\"mp4a.40.5\"'],\n\t 'oga': ['audio/ogg']\n\t};\n\t\n\tvar KNOWN_AUDIO_MIMETYPES = Object.keys(AUDIO_MIMETYPES).reduce(function (acc, k) {\n\t return [].concat(_toConsumableArray(acc), _toConsumableArray(AUDIO_MIMETYPES[k]));\n\t}, []);\n\t\n\t// TODO: rename this Playback to HTML5Playback (breaking change, only after 0.3.0)\n\t\n\tvar HTML5Video = function (_Playback) {\n\t _inherits(HTML5Video, _Playback);\n\t\n\t _createClass(HTML5Video, [{\n\t key: 'name',\n\t get: function get() {\n\t return 'html5_video';\n\t }\n\t }, {\n\t key: 'tagName',\n\t get: function get() {\n\t return this.isAudioOnly ? 'audio' : 'video';\n\t }\n\t }, {\n\t key: 'isAudioOnly',\n\t get: function get() {\n\t var resourceUrl = this.options.src;\n\t var mimeTypes = HTML5Video._mimeTypesForUrl(resourceUrl, AUDIO_MIMETYPES, this.options.mimeType);\n\t return this.options.playback && this.options.playback.audioOnly || this.options.audioOnly || KNOWN_AUDIO_MIMETYPES.indexOf(mimeTypes[0]) >= 0;\n\t }\n\t }, {\n\t key: 'attributes',\n\t get: function get() {\n\t return {\n\t 'data-html5-video': ''\n\t };\n\t }\n\t }, {\n\t key: 'events',\n\t get: function get() {\n\t return {\n\t 'canplay': '_onCanPlay',\n\t 'canplaythrough': '_handleBufferingEvents',\n\t 'durationchange': '_onDurationChange',\n\t 'ended': '_onEnded',\n\t 'error': '_onError',\n\t 'loadeddata': '_onLoadedData',\n\t 'loadedmetadata': '_onLoadedMetadata',\n\t 'pause': '_onPause',\n\t 'playing': '_onPlaying',\n\t 'progress': '_onProgress',\n\t 'seeked': '_handleBufferingEvents',\n\t 'seeking': '_handleBufferingEvents',\n\t 'stalled': '_handleBufferingEvents',\n\t 'timeupdate': '_onTimeUpdate',\n\t 'waiting': '_onWaiting'\n\t };\n\t }\n\t\n\t /**\n\t * Determine if the playback has ended.\n\t * @property ended\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'ended',\n\t get: function get() {\n\t return this.el.ended;\n\t }\n\t\n\t /**\n\t * Determine if the playback is having to buffer in order for\n\t * playback to be smooth.\n\t * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events\n\t * @property buffering\n\t * @type Boolean\n\t */\n\t\n\t }, {\n\t key: 'buffering',\n\t get: function get() {\n\t return !!this._bufferingState;\n\t }\n\t }]);\n\t\n\t function HTML5Video() {\n\t _classCallCheck(this, HTML5Video);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this = _possibleConstructorReturn(this, _Playback.call.apply(_Playback, [this].concat(args)));\n\t\n\t _this._loadStarted = false;\n\t _this._playheadMoving = false;\n\t _this._playheadMovingTimer = null;\n\t _this._stopped = false;\n\t _this._setupSrc(_this.options.src);\n\t // backwards compatibility (TODO: remove on 0.3.0)\n\t _this.options.playback || (_this.options.playback = _this.options || {});\n\t _this.options.playback.disableContextMenu = _this.options.playback.disableContextMenu || _this.options.disableVideoTagContextMenu;\n\t\n\t var playbackConfig = _this.options.playback;\n\t var preload = playbackConfig.preload || (_browser2.default.isSafari ? 'auto' : _this.options.preload);\n\t\n\t _clapprZepto2.default.extend(_this.el, {\n\t loop: _this.options.loop,\n\t poster: _this.options.poster,\n\t preload: preload || 'metadata',\n\t controls: (playbackConfig.controls || _this.options.useVideoTagDefaultControls) && 'controls',\n\t crossOrigin: playbackConfig.crossOrigin,\n\t 'x-webkit-playsinline': playbackConfig.playInline\n\t });\n\t\n\t // TODO should settings be private?\n\t _this.settings = { default: ['seekbar'] };\n\t _this.settings.left = ['playpause', 'position', 'duration'];\n\t _this.settings.right = ['fullscreen', 'volume', 'hd-indicator'];\n\t\n\t // https://github.com/clappr/clappr/issues/1076\n\t _this.options.autoPlay && process.nextTick(function () {\n\t return _this.play();\n\t });\n\t return _this;\n\t }\n\t\n\t /**\n\t * Sets the source url on the