From bf49ec2731ee67fafda0e6aa059ca952516b9059 Mon Sep 17 00:00:00 2001 From: Florian Larysch Date: Mon, 7 Aug 2017 23:09:42 +0200 Subject: update clappr plugin --- assets/clapprio/clappr.js | 60734 ++++++++++++++++++++-------------------- assets/clapprio/clappr.min.js | 17 +- 2 files changed, 30845 insertions(+), 29906 deletions(-) (limited to 'assets') diff --git a/assets/clapprio/clappr.js b/assets/clapprio/clappr.js index 1ee0b0a..1b7d42f 100644 --- a/assets/clapprio/clappr.js +++ b/assets/clapprio/clappr.js @@ -11,31506 +11,32460 @@ 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]) +/******/ 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 +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} /******/ }; - +/******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - +/******/ /******/ // Flag the module as loaded -/******/ module.loaded = true; - +/******/ module.l = true; +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } - - +/******/ +/******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; - +/******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; - +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "<%=baseUrl%>/"; - +/******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(0); +/******/ return __webpack_require__(__webpack_require__.s = 87); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ -/***/ function(module, exports, __webpack_require__) { +/***/ (function(module, exports, __webpack_require__) { - 'use strict'; +"use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - var _player = __webpack_require__(1); +exports.__esModule = true; - var _player2 = _interopRequireDefault(_player); +exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; - var _utils = __webpack_require__(2); +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { - var _utils2 = _interopRequireDefault(_utils); +"use strict"; - var _events = __webpack_require__(5); - var _events2 = _interopRequireDefault(_events); +exports.__esModule = true; - var _playback = __webpack_require__(31); +var _typeof2 = __webpack_require__(33); - var _playback2 = _interopRequireDefault(_playback); +var _typeof3 = _interopRequireDefault(_typeof2); - var _container_plugin = __webpack_require__(85); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _container_plugin2 = _interopRequireDefault(_container_plugin); +exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } - var _core_plugin = __webpack_require__(105); + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; +}; - var _core_plugin2 = _interopRequireDefault(_core_plugin); +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { - var _ui_core_plugin = __webpack_require__(100); +"use strict"; - var _ui_core_plugin2 = _interopRequireDefault(_ui_core_plugin); - var _ui_container_plugin = __webpack_require__(80); +exports.__esModule = true; - var _ui_container_plugin2 = _interopRequireDefault(_ui_container_plugin); +var _setPrototypeOf = __webpack_require__(119); - var _base_object = __webpack_require__(4); +var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); - var _base_object2 = _interopRequireDefault(_base_object); +var _create = __webpack_require__(71); - var _ui_object = __webpack_require__(18); +var _create2 = _interopRequireDefault(_create); - var _ui_object2 = _interopRequireDefault(_ui_object); +var _typeof2 = __webpack_require__(33); - var _browser = __webpack_require__(3); +var _typeof3 = _interopRequireDefault(_typeof2); - var _browser2 = _interopRequireDefault(_browser); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _container = __webpack_require__(22); +exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); + } - var _container2 = _interopRequireDefault(_container); + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; +}; - var _core = __webpack_require__(13); +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { - var _core2 = _interopRequireDefault(_core); +"use strict"; - var _loader = __webpack_require__(48); - var _loader2 = _interopRequireDefault(_loader); +exports.__esModule = true; - var _mediator = __webpack_require__(30); +var _defineProperty = __webpack_require__(70); - var _mediator2 = _interopRequireDefault(_mediator); +var _defineProperty2 = _interopRequireDefault(_defineProperty); - var _media_control = __webpack_require__(27); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _media_control2 = _interopRequireDefault(_media_control); +exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } - var _player_info = __webpack_require__(45); + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); - var _player_info2 = _interopRequireDefault(_player_info); +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { - var _base_flash_playback = __webpack_require__(56); +"use strict"; - var _base_flash_playback2 = _interopRequireDefault(_base_flash_playback); - var _flash = __webpack_require__(54); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _flash2 = _interopRequireDefault(_flash); +var _keys = __webpack_require__(31); + +var _keys2 = _interopRequireDefault(_keys); + +var _classCallCheck2 = __webpack_require__(0); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _typeof2 = __webpack_require__(33); + +var _typeof3 = _interopRequireDefault(_typeof2); + +var _log = __webpack_require__(55); + +var _log2 = _interopRequireDefault(_log); + +var _utils = __webpack_require__(5); + +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 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' : (0, _typeof3.default)(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() { + (0, _classCallCheck3.default)(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) { + var _this = this; + + if (!eventsApi(this, 'once', name, [callback, context]) || !callback) { + return this; + } + var off = function off() { + return _this.off(name, once); + }; + var once = function once() { + off(name, once); + callback.apply(this, arguments); + }; + 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] : (0, _keys2.default)(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' : (0, _typeof3.default)(name)) === 'object') { + callback = this; + } + if (obj) { + (listeningTo = {})[obj._listenId] = obj; + } + for (var id in listeningTo) { + obj = listeningTo[id]; + obj.off(name, callback, this); + if (remove || (0, _keys2.default)(obj._events).length === 0) { + delete this._listeningTo[id]; + } + } + return this; + }; + + Events.register = function register(eventName) { + Events.Custom || (Events.Custom = {}); + var property = typeof eventName === 'string' && eventName.toUpperCase().trim(); + + if (property && !Events.Custom[property]) { + Events.Custom[property] = property.toLowerCase().split('_').map(function (value, index) { + return index == 0 ? value : value = value[0].toUpperCase() + value.slice(1); + }).join(''); + } else { + _log2.default.error('Events', 'Error when register event: ' + eventName); + } + }; + + Events.listAvailableCustomEvents = function listAvailableCustomEvents() { + Events.Custom || (Events.Custom = {}); + return (0, _keys2.default)(Events.Custom).filter(function (property) { + return typeof Events.Custom[property] === 'string'; + }); + }; + + 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' }; + +(0, _keys2.default)(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' : (0, _typeof3.default)(name)) === 'object') { + callback = this; + } + obj[listenMethods[method]](name, callback, this); + return this; + }; +}); - var _flashls = __webpack_require__(63); +// 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'; + +/** + * Fired when subtitle is available + * + * @event PLAYER_SUBTITLE_AVAILABLE + */ +Events.PLAYER_SUBTITLE_AVAILABLE = 'subtitleavailable'; + +// 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 subtitle is available on playback for display + * + * @event PLAYBACK_SUBTITLE_AVAILABLE + */ +Events.PLAYBACK_SUBTITLE_AVAILABLE = 'playback:subtitle:available'; +/** + * Fired when playback subtitle track has changed + * + * @event CONTAINER_SUBTITLE_CHANGED + * @param {Object} track Data + * track object + * @param {Number} [track.id] + * selected track id + */ +Events.PLAYBACK_SUBTITLE_CHANGED = 'playback:subtitle:changed'; + +// Core Events +/** + * Fired when the containers are created + * + * @event CORE_CONTAINERS_CREATED + */ +Events.CORE_CONTAINERS_CREATED = 'core:containers:created'; +/** + * 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 + * + * @event CORE_FULLSCREEN + * @param {Boolean} whether or not the player is on fullscreen mode + */ +Events.CORE_FULLSCREEN = 'core:fullscreen'; +/** + * Fired when the screen orientation has changed. + * This event is trigger only for mobile devices. + * + * @event CORE_SCREEN_ORIENTATION_CHANGED + * @param {Object} screen An object with screen orientation + * screen object + * @param {Object} [screen.event] + * window resize event object + * @param {String} [screen.orientation] + * screen orientation (ie: 'landscape' or 'portrait') + */ +Events.CORE_SCREEN_ORIENTATION_CHANGED = 'core:screen:orientation:changed'; + +// 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 subtitle is available on container for display + * + * @event CONTAINER_SUBTITLE_AVAILABLE + */ +Events.CONTAINER_SUBTITLE_AVAILABLE = 'container:subtitle:available'; +/** + * Fired when subtitle track has changed + * + * @event CONTAINER_SUBTITLE_CHANGED + * @param {Object} track Data + * track object + * @param {Number} [track.id] + * selected track id + */ +Events.CONTAINER_SUBTITLE_CHANGED = 'container:subtitle:changed'; + +/** + * 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'; +module.exports = exports['default']; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { - var _flashls2 = _interopRequireDefault(_flashls); +"use strict"; - var _hls = __webpack_require__(67); - var _hls2 = _interopRequireDefault(_hls); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DomRecycler = exports.cancelAnimationFrame = exports.requestAnimationFrame = exports.QueryString = exports.Config = exports.Fullscreen = undefined; - var _html5_audio = __webpack_require__(61); +var _createClass2 = __webpack_require__(3); - var _html5_audio2 = _interopRequireDefault(_html5_audio); +var _createClass3 = _interopRequireDefault(_createClass2); - var _html5_video = __webpack_require__(51); +var _classCallCheck2 = __webpack_require__(0); - var _html5_video2 = _interopRequireDefault(_html5_video); +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var _html_img = __webpack_require__(71); +var _possibleConstructorReturn2 = __webpack_require__(1); - var _html_img2 = _interopRequireDefault(_html_img); +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - var _no_op = __webpack_require__(74); +var _inherits2 = __webpack_require__(2); - var _no_op2 = _interopRequireDefault(_no_op); +var _inherits3 = _interopRequireDefault(_inherits2); - var _poster = __webpack_require__(90); +var _defineProperty = __webpack_require__(70); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +var _getOwnPropertyDescriptor = __webpack_require__(125); + +var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); + +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; + +__webpack_require__(128); + +var _browser = __webpack_require__(13); + +var _browser2 = _interopRequireDefault(_browser); + +var _clapprZepto = __webpack_require__(6); + +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function assign(obj, source) { + if (source) { + for (var prop in source) { + var propDescriptor = (0, _getOwnPropertyDescriptor2.default)(source, prop); + propDescriptor ? (0, _defineProperty2.default)(obj, prop, propDescriptor) : obj[prop] = source[prop]; + } + } + return 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. +/*jshint -W079 */ + +function extend(parent, properties) { + var Surrogate = function (_parent) { + (0, _inherits3.default)(Surrogate, _parent); + + function Surrogate() { + (0, _classCallCheck3.default)(this, Surrogate); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var _this = (0, _possibleConstructorReturn3.default)(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(); + } else if (el.webkitEnterFullScreen) { + el.webkitEnterFullScreen(); + } + }, + cancelFullscreen: function cancelFullscreen() { + var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; + + if (el.exitFullscreen) { + el.exitFullscreen(); + } else if (el.webkitCancelFullScreen) { + el.webkitCancelFullScreen(); + } else if (el.webkitExitFullscreen) { + el.webkitExitFullscreen(); + } else if (el.mozCancelFullScreen) { + el.mozCancelFullScreen(); + } else if (el.msExitFullscreen) { + el.msExitFullscreen(); + } + }, + fullscreenEnabled: function fullscreenEnabled() { + return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled); + } +}; + +var Config = exports.Config = function () { + function Config() { + (0, _classCallCheck3.default)(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() { + (0, _classCallCheck3.default)(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; + }; + + (0, _createClass3.default)(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); + } +} + +// Simple Zepto element factory with video recycle feature. +var videoStack = []; + +var DomRecycler = exports.DomRecycler = function () { + function DomRecycler() { + (0, _classCallCheck3.default)(this, DomRecycler); + } + + DomRecycler.configure = function configure(options) { + this.options = _clapprZepto2.default.extend(this.options, options); + }; + + DomRecycler.create = function create(name) { + if (this.options.recycleVideo && name === 'video' && videoStack.length > 0) { + return videoStack.shift(); + } + return (0, _clapprZepto2.default)('<' + name + '>'); + }; + + DomRecycler.garbage = function garbage($el) { + // Expect Zepto collection with single element (does not iterate!) + if (!this.options.recycleVideo || $el[0].tagName.toUpperCase() !== 'VIDEO') return; + $el.children().remove(); + videoStack.push($el); + }; + + return DomRecycler; +}(); + +DomRecycler.options = { recycleVideo: false }; + +exports.default = { + Config: Config, + Fullscreen: Fullscreen, + QueryString: QueryString, + DomRecycler: DomRecycler, + extend: extend, + formatTime: formatTime, + seekStringToSeconds: seekStringToSeconds, + uniqueId: uniqueId, + currentScriptUrl: currentScriptUrl, + isNumber: isNumber, + requestAnimationFrame: requestAnimationFrame, + cancelAnimationFrame: cancelAnimationFrame, + getBrowserLanguage: getBrowserLanguage, + now: now, + removeArrayItem: removeArrayItem +}; + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +/* Zepto v1.2.0 - zepto ajax callbacks deferred event ie selector - zeptojs.com/license */ + + +var Zepto = (function() { + var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice, + document = window.document, + elementDisplay = {}, classCache = {}, + cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + + // special attributes that should be get/set via method calls + methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], + + adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], + table = document.createElement('table'), + tableRow = document.createElement('tr'), + containers = { + 'tr': document.createElement('tbody'), + 'tbody': table, 'thead': table, 'tfoot': table, + 'td': tableRow, 'th': tableRow, + '*': document.createElement('div') + }, + readyRE = /complete|loaded|interactive/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, uniq, + tempParent = document.createElement('div'), + propMap = { + 'tabindex': 'tabIndex', + 'readonly': 'readOnly', + 'for': 'htmlFor', + 'class': 'className', + 'maxlength': 'maxLength', + 'cellspacing': 'cellSpacing', + 'cellpadding': 'cellPadding', + 'rowspan': 'rowSpan', + 'colspan': 'colSpan', + 'usemap': 'useMap', + 'frameborder': 'frameBorder', + 'contenteditable': 'contentEditable' + }, + isArray = Array.isArray || + function(object){ return object instanceof Array } + + zepto.matches = function(element, selector) { + if (!selector || !element || element.nodeType !== 1) return false + var matchesSelector = element.matches || element.webkitMatchesSelector || + element.mozMatchesSelector || element.oMatchesSelector || + element.matchesSelector + if (matchesSelector) return matchesSelector.call(element, selector) + // fall back to performing a selector: + var match, parent = element.parentNode, temp = !parent + if (temp) (parent = tempParent).appendChild(element) + match = ~zepto.qsa(parent, selector).indexOf(element) + temp && tempParent.removeChild(element) + return match + } + + function type(obj) { + return obj == null ? String(obj) : + class2type[toString.call(obj)] || "object" + } + + function isFunction(value) { return type(value) == "function" } + function isWindow(obj) { return obj != null && obj == obj.window } + function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } + function isObject(obj) { return type(obj) == "object" } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype + } + + function likeArray(obj) { + var length = !!obj && 'length' in obj && obj.length, + type = $.type(obj) + + return 'function' != type && !isWindow(obj) && ( + 'array' == type || length === 0 || + (typeof length == 'number' && length > 0 && (length - 1) in obj) + ) + } + + function compact(array) { return filter.call(array, function(item){ return item != null }) } + function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } + camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } + function dasherize(str) { + return str.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/_/g, '-') + .toLowerCase() + } + uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } + + function classRE(name) { + return name in classCache ? + classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) + } + + function maybeAddPx(name, value) { + return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value + } + + function defaultDisplay(nodeName) { + var element, display + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName) + document.body.appendChild(element) + display = getComputedStyle(element, '').getPropertyValue("display") + element.parentNode.removeChild(element) + display == "none" && (display = "block") + elementDisplay[nodeName] = display + } + return elementDisplay[nodeName] + } + + function children(element) { + return 'children' in element ? + slice.call(element.children) : + $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) + } + + function Z(dom, selector) { + var i, len = dom ? dom.length : 0 + for (i = 0; i < len; i++) this[i] = dom[i] + this.length = len + this.selector = selector || '' + } + + // `$.zepto.fragment` takes a html string and an optional tag name + // to generate DOM nodes from the given html string. + // The generated DOM nodes are returned as an array. + // This function can be overridden in plugins for example to make + // it compatible with browsers that don't support the DOM fully. + zepto.fragment = function(html, name, properties) { + var dom, nodes, container + + // A special case optimization for a single tag + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)) + + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>") + if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 + if (!(name in containers)) name = '*' + + container = containers[name] + container.innerHTML = '' + html + dom = $.each(slice.call(container.childNodes), function(){ + container.removeChild(this) + }) + } + + if (isPlainObject(properties)) { + nodes = $(dom) + $.each(properties, function(key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value) + else nodes.attr(key, value) + }) + } + + return dom + } + + // `$.zepto.Z` swaps out the prototype of the given `dom` array + // of nodes with `$.fn` and thus supplying all the Zepto functions + // to the array. This method can be overridden in plugins. + zepto.Z = function(dom, selector) { + return new Z(dom, selector) + } + + // `$.zepto.isZ` should return `true` if the given object is a Zepto + // collection. This method can be overridden in plugins. + zepto.isZ = function(object) { + return object instanceof zepto.Z + } + + // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and + // takes a CSS selector and an optional context (and handles various + // special cases). + // This method can be overridden in plugins. + zepto.init = function(selector, context) { + var dom + // If nothing given, return an empty Zepto collection + if (!selector) return zepto.Z() + // Optimize for string selectors + else if (typeof selector == 'string') { + selector = selector.trim() + // If it's a html fragment, create nodes from it + // Note: In both Chrome 21 and Firefox 15, DOM error 12 + // is thrown if the fragment doesn't begin with < + if (selector[0] == '<' && fragmentRE.test(selector)) + dom = zepto.fragment(selector, RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // If it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // If a function is given, call it when the DOM is ready + else if (isFunction(selector)) return $(document).ready(selector) + // If a Zepto collection is given, just return it + else if (zepto.isZ(selector)) return selector + else { + // normalize array if an array of nodes is given + if (isArray(selector)) dom = compact(selector) + // Wrap DOM nodes. + else if (isObject(selector)) + dom = [selector], selector = null + // If it's a html fragment, create nodes from it + else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null + // If there's a context, create a collection on that context first, and select + // nodes from there + else if (context !== undefined) return $(context).find(selector) + // And last but no least, if it's a CSS selector, use it to select nodes. + else dom = zepto.qsa(document, selector) + } + // create a new Zepto collection from the nodes found + return zepto.Z(dom, selector) + } + + // `$` will be the base `Zepto` object. When calling this + // function just call `$.zepto.init, which makes the implementation + // details of selecting nodes and creating Zepto collections + // patchable in plugins. + $ = function(selector, context){ + return zepto.init(selector, context) + } + + function extend(target, source, deep) { + for (key in source) + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) + target[key] = {} + if (isArray(source[key]) && !isArray(target[key])) + target[key] = [] + extend(target[key], source[key], deep) + } + else if (source[key] !== undefined) target[key] = source[key] + } + + // Copy all but undefined properties from one or more + // objects to the `target` object. + $.extend = function(target){ + var deep, args = slice.call(arguments, 1) + if (typeof target == 'boolean') { + deep = target + target = args.shift() + } + args.forEach(function(arg){ extend(target, arg, deep) }) + return target + } + + // `$.zepto.qsa` is Zepto's CSS selector implementation which + // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. + // This method can be overridden in plugins. + zepto.qsa = function(element, selector){ + var found, + maybeID = selector[0] == '#', + maybeClass = !maybeID && selector[0] == '.', + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked + isSimple = simpleSelectorRE.test(nameOnly) + return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById + ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : + (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] : + slice.call( + isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName + maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class + element.getElementsByTagName(selector) : // Or a tag + element.querySelectorAll(selector) // Or it's not simple, and we need to query all + ) + } + + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector) + } + + $.contains = document.documentElement.contains ? + function(parent, node) { + return parent !== node && parent.contains(node) + } : + function(parent, node) { + while (node && (node = node.parentNode)) + if (node === parent) return true + return false + } + + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg + } + + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value) + } + + // access className property while respecting SVGAnimatedString + function className(node, value){ + var klass = node.className || '', + svg = klass && klass.baseVal !== undefined + + if (value === undefined) return svg ? klass.baseVal : klass + svg ? (klass.baseVal = value) : (node.className = value) + } + + // "true" => true + // "false" => false + // "null" => null + // "42" => 42 + // "42.5" => 42.5 + // "08" => "08" + // JSON => parse if valid + // String => self + function deserializeValue(value) { + try { + return value ? + value == "true" || + ( value == "false" ? false : + value == "null" ? null : + +value + "" == value ? +value : + /^[\[\{]/.test(value) ? $.parseJSON(value) : + value ) + : value + } catch(e) { + return value + } + } + + $.type = type + $.isFunction = isFunction + $.isWindow = isWindow + $.isArray = isArray + $.isPlainObject = isPlainObject + + $.isEmptyObject = function(obj) { + var name + for (name in obj) return false + return true + } + + $.isNumeric = function(val) { + var num = Number(val), type = typeof val + return val != null && type != 'boolean' && + (type != 'string' || val.length) && + !isNaN(num) && isFinite(num) || false + } + + $.inArray = function(elem, array, i){ + return emptyArray.indexOf.call(array, elem, i) + } + + $.camelCase = camelize + $.trim = function(str) { + return str == null ? "" : String.prototype.trim.call(str) + } + + // plugin compatibility + $.uuid = 0 + $.support = { } + $.expr = { } + $.noop = function() {} + + $.map = function(elements, callback){ + var value, values = [], i, key + if (likeArray(elements)) + for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i) + if (value != null) values.push(value) + } + else + for (key in elements) { + value = callback(elements[key], key) + if (value != null) values.push(value) + } + return flatten(values) + } + + $.each = function(elements, callback){ + var i, key + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) + if (callback.call(elements[i], i, elements[i]) === false) return elements + } else { + for (key in elements) + if (callback.call(elements[key], key, elements[key]) === false) return elements + } + + return elements + } + + $.grep = function(elements, callback){ + return filter.call(elements, callback) + } + + if (window.JSON) $.parseJSON = JSON.parse + + // Populate the class2type map + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase() + }) + + // Define methods that will be available on all + // Zepto collections + $.fn = { + constructor: zepto.Z, + length: 0, + + // Because a collection acts like an array + // copy over these useful array functions. + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + splice: emptyArray.splice, + indexOf: emptyArray.indexOf, + concat: function(){ + var i, value, args = [] + for (i = 0; i < arguments.length; i++) { + value = arguments[i] + args[i] = zepto.isZ(value) ? value.toArray() : value + } + return concat.apply(zepto.isZ(this) ? this.toArray() : this, args) + }, + + // `map` and `slice` in the jQuery API work differently + // from their array counterparts + map: function(fn){ + return $($.map(this, function(el, i){ return fn.call(el, i, el) })) + }, + slice: function(){ + return $(slice.apply(this, arguments)) + }, + + ready: function(callback){ + // need to check if document.body exists for IE as that browser reports + // document ready when it hasn't yet created the body element + if (readyRE.test(document.readyState) && document.body) callback($) + else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) + return this + }, + get: function(idx){ + return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] + }, + toArray: function(){ return this.get() }, + size: function(){ + return this.length + }, + remove: function(){ + return this.each(function(){ + if (this.parentNode != null) + this.parentNode.removeChild(this) + }) + }, + each: function(callback){ + emptyArray.every.call(this, function(el, idx){ + return callback.call(el, idx, el) !== false + }) + return this + }, + filter: function(selector){ + if (isFunction(selector)) return this.not(this.not(selector)) + return $(filter.call(this, function(element){ + return zepto.matches(element, selector) + })) + }, + add: function(selector,context){ + return $(uniq(this.concat($(selector,context)))) + }, + is: function(selector){ + return this.length > 0 && zepto.matches(this[0], selector) + }, + not: function(selector){ + var nodes=[] + if (isFunction(selector) && selector.call !== undefined) + this.each(function(idx){ + if (!selector.call(this,idx)) nodes.push(this) + }) + else { + var excludes = typeof selector == 'string' ? this.filter(selector) : + (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) + this.forEach(function(el){ + if (excludes.indexOf(el) < 0) nodes.push(el) + }) + } + return $(nodes) + }, + has: function(selector){ + return this.filter(function(){ + return isObject(selector) ? + $.contains(this, selector) : + $(this).find(selector).size() + }) + }, + eq: function(idx){ + return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) + }, + first: function(){ + var el = this[0] + return el && !isObject(el) ? el : $(el) + }, + last: function(){ + var el = this[this.length - 1] + return el && !isObject(el) ? el : $(el) + }, + find: function(selector){ + var result, $this = this + if (!selector) result = $() + else if (typeof selector == 'object') + result = $(selector).filter(function(){ + var node = this + return emptyArray.some.call($this, function(parent){ + return $.contains(parent, node) + }) + }) + else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) + else result = this.map(function(){ return zepto.qsa(this, selector) }) + return result + }, + closest: function(selector, context){ + var nodes = [], collection = typeof selector == 'object' && $(selector) + this.each(function(_, node){ + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) + node = node !== context && !isDocument(node) && node.parentNode + if (node && nodes.indexOf(node) < 0) nodes.push(node) + }) + return $(nodes) + }, + parents: function(selector){ + var ancestors = [], nodes = this + while (nodes.length > 0) + nodes = $.map(nodes, function(node){ + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node) + return node + } + }) + return filtered(ancestors, selector) + }, + parent: function(selector){ + return filtered(uniq(this.pluck('parentNode')), selector) + }, + children: function(selector){ + return filtered(this.map(function(){ return children(this) }), selector) + }, + contents: function() { + return this.map(function() { return this.contentDocument || slice.call(this.childNodes) }) + }, + siblings: function(selector){ + return filtered(this.map(function(i, el){ + return filter.call(children(el.parentNode), function(child){ return child!==el }) + }), selector) + }, + empty: function(){ + return this.each(function(){ this.innerHTML = '' }) + }, + // `pluck` is borrowed from Prototype.js + pluck: function(property){ + return $.map(this, function(el){ return el[property] }) + }, + show: function(){ + return this.each(function(){ + this.style.display == "none" && (this.style.display = '') + if (getComputedStyle(this, '').getPropertyValue("display") == "none") + this.style.display = defaultDisplay(this.nodeName) + }) + }, + replaceWith: function(newContent){ + return this.before(newContent).remove() + }, + wrap: function(structure){ + var func = isFunction(structure) + if (this[0] && !func) + var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1 + + return this.each(function(index){ + $(this).wrapAll( + func ? structure.call(this, index) : + clone ? dom.cloneNode(true) : dom + ) + }) + }, + wrapAll: function(structure){ + if (this[0]) { + $(this[0]).before(structure = $(structure)) + var children + // drill down to the inmost element + while ((children = structure.children()).length) structure = children.first() + $(structure).append(this) + } + return this + }, + wrapInner: function(structure){ + var func = isFunction(structure) + return this.each(function(index){ + var self = $(this), contents = self.contents(), + dom = func ? structure.call(this, index) : structure + contents.length ? contents.wrapAll(dom) : self.append(dom) + }) + }, + unwrap: function(){ + this.parent().each(function(){ + $(this).replaceWith($(this).children()) + }) + return this + }, + clone: function(){ + return this.map(function(){ return this.cloneNode(true) }) + }, + hide: function(){ + return this.css("display", "none") + }, + toggle: function(setting){ + return this.each(function(){ + var el = $(this) + ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() + }) + }, + prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, + next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, + html: function(html){ + return 0 in arguments ? + this.each(function(idx){ + var originHtml = this.innerHTML + $(this).empty().append( funcArg(this, html, idx, originHtml) ) + }) : + (0 in this ? this[0].innerHTML : null) + }, + text: function(text){ + return 0 in arguments ? + this.each(function(idx){ + var newText = funcArg(this, text, idx, this.textContent) + this.textContent = newText == null ? '' : ''+newText + }) : + (0 in this ? this.pluck('textContent').join("") : null) + }, + attr: function(name, value){ + var result + return (typeof name == 'string' && !(1 in arguments)) ? + (0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined) : + this.each(function(idx){ + if (this.nodeType !== 1) return + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) + else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) + }) + }, + removeAttr: function(name){ + return this.each(function(){ this.nodeType === 1 && name.split(' ').forEach(function(attribute){ + setAttribute(this, attribute) + }, this)}) + }, + prop: function(name, value){ + name = propMap[name] || name + return (1 in arguments) ? + this.each(function(idx){ + this[name] = funcArg(this, value, idx, this[name]) + }) : + (this[0] && this[0][name]) + }, + removeProp: function(name){ + name = propMap[name] || name + return this.each(function(){ delete this[name] }) + }, + data: function(name, value){ + var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase() + + var data = (1 in arguments) ? + this.attr(attrName, value) : + this.attr(attrName) + + return data !== null ? deserializeValue(data) : undefined + }, + val: function(value){ + if (0 in arguments) { + if (value == null) value = "" + return this.each(function(idx){ + this.value = funcArg(this, value, idx, this.value) + }) + } else { + return this[0] && (this[0].multiple ? + $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') : + this[0].value) + } + }, + offset: function(coordinates){ + if (coordinates) return this.each(function(index){ + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + } + + if ($this.css('position') == 'static') props['position'] = 'relative' + $this.css(props) + }) + if (!this.length) return null + if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0])) + return {top: 0, left: 0} + var obj = this[0].getBoundingClientRect() + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + } + }, + css: function(property, value){ + if (arguments.length < 2) { + var element = this[0] + if (typeof property == 'string') { + if (!element) return + return element.style[camelize(property)] || getComputedStyle(element, '').getPropertyValue(property) + } else if (isArray(property)) { + if (!element) return + var props = {} + var computedStyle = getComputedStyle(element, '') + $.each(property, function(_, prop){ + props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop)) + }) + return props + } + } + + var css = '' + if (type(property) == 'string') { + if (!value && value !== 0) + this.each(function(){ this.style.removeProperty(dasherize(property)) }) + else + css = dasherize(property) + ":" + maybeAddPx(property, value) + } else { + for (key in property) + if (!property[key] && property[key] !== 0) + this.each(function(){ this.style.removeProperty(dasherize(key)) }) + else + css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' + } + + return this.each(function(){ this.style.cssText += ';' + css }) + }, + index: function(element){ + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) + }, + hasClass: function(name){ + if (!name) return false + return emptyArray.some.call(this, function(el){ + return this.test(className(el)) + }, classRE(name)) + }, + addClass: function(name){ + if (!name) return this + return this.each(function(idx){ + if (!('className' in this)) return + classList = [] + var cls = className(this), newName = funcArg(this, name, idx, cls) + newName.split(/\s+/g).forEach(function(klass){ + if (!$(this).hasClass(klass)) classList.push(klass) + }, this) + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) + }) + }, + removeClass: function(name){ + return this.each(function(idx){ + if (!('className' in this)) return + if (name === undefined) return className(this, '') + classList = className(this) + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ + classList = classList.replace(classRE(klass), " ") + }) + className(this, classList.trim()) + }) + }, + toggleClass: function(name, when){ + if (!name) return this + return this.each(function(idx){ + var $this = $(this), names = funcArg(this, name, idx, className(this)) + names.split(/\s+/g).forEach(function(klass){ + (when === undefined ? !$this.hasClass(klass) : when) ? + $this.addClass(klass) : $this.removeClass(klass) + }) + }) + }, + scrollTop: function(value){ + if (!this.length) return + var hasScrollTop = 'scrollTop' in this[0] + if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset + return this.each(hasScrollTop ? + function(){ this.scrollTop = value } : + function(){ this.scrollTo(this.scrollX, value) }) + }, + scrollLeft: function(value){ + if (!this.length) return + var hasScrollLeft = 'scrollLeft' in this[0] + if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset + return this.each(hasScrollLeft ? + function(){ this.scrollLeft = value } : + function(){ this.scrollTo(value, this.scrollY) }) + }, + position: function() { + if (!this.length) return + + var elem = this[0], + // Get *real* offsetParent + offsetParent = this.offsetParent(), + // Get correct offsets + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 + offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 + + // Add offsetParent borders + parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 + parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + } + }, + offsetParent: function() { + return this.map(function(){ + var parent = this.offsetParent || document.body + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") + parent = parent.offsetParent + return parent + }) + } + } + + // for now + $.fn.detach = $.fn.remove + + // Generate the `width` and `height` functions + ;['width', 'height'].forEach(function(dimension){ + var dimensionProperty = + dimension.replace(/./, function(m){ return m[0].toUpperCase() }) + + $.fn[dimension] = function(value){ + var offset, el = this[0] + if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] : + isDocument(el) ? el.documentElement['scroll' + dimensionProperty] : + (offset = this.offset()) && offset[dimension] + else return this.each(function(idx){ + el = $(this) + el.css(dimension, funcArg(this, value, idx, el[dimension]())) + }) + } + }) + + function traverseNode(node, fun) { + fun(node) + for (var i = 0, len = node.childNodes.length; i < len; i++) + traverseNode(node.childNodes[i], fun) + } + + // Generate the `after`, `prepend`, `before`, `append`, + // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. + adjacencyOperators.forEach(function(operator, operatorIndex) { + var inside = operatorIndex % 2 //=> prepend, append + + $.fn[operator] = function(){ + // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings + var argType, nodes = $.map(arguments, function(arg) { + var arr = [] + argType = type(arg) + if (argType == "array") { + arg.forEach(function(el) { + if (el.nodeType !== undefined) return arr.push(el) + else if ($.zepto.isZ(el)) return arr = arr.concat(el.get()) + arr = arr.concat(zepto.fragment(el)) + }) + return arr + } + return argType == "object" || arg == null ? + arg : zepto.fragment(arg) + }), + parent, copyByClone = this.length > 1 + if (nodes.length < 1) return this + + return this.each(function(_, target){ + parent = inside ? target : target.parentNode + + // convert all methods to a "before" operation + target = operatorIndex == 0 ? target.nextSibling : + operatorIndex == 1 ? target.firstChild : + operatorIndex == 2 ? target : + null + + var parentInDocument = $.contains(document.documentElement, parent) + + nodes.forEach(function(node){ + if (copyByClone) node = node.cloneNode(true) + else if (!parent) return $(node).remove() + + parent.insertBefore(node, target) + if (parentInDocument) traverseNode(node, function(el){ + if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && + (!el.type || el.type === 'text/javascript') && !el.src){ + var target = el.ownerDocument ? el.ownerDocument.defaultView : window + target['eval'].call(target, el.innerHTML) + } + }) + }) + }) + } + + // after => insertAfter + // prepend => prependTo + // before => insertBefore + // append => appendTo + $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ + $(html)[operator](this) + return this + } + }) + + zepto.Z.prototype = Z.prototype = $.fn + + // Export internal API functions in the `$.zepto` namespace + zepto.uniq = uniq + zepto.deserializeValue = deserializeValue + $.zepto = zepto + + return $ +})() + +window.Zepto = Zepto +window.$ === undefined && (window.$ = Zepto) + +;(function($){ + var jsonpID = +new Date(), + document = window.document, + key, + name, + rscript = /)<[^<]*)*<\/script>/gi, + scriptTypeRE = /^(?:text|application)\/javascript/i, + xmlTypeRE = /^(?:text|application)\/xml/i, + jsonType = 'application/json', + htmlType = 'text/html', + blankRE = /^\s*$/, + originAnchor = document.createElement('a') + + originAnchor.href = window.location.href + + // trigger a custom event and return false if it was cancelled + function triggerAndReturn(context, eventName, data) { + var event = $.Event(eventName) + $(context).trigger(event, data) + return !event.isDefaultPrevented() + } + + // trigger an Ajax "global" event + function triggerGlobal(settings, context, eventName, data) { + if (settings.global) return triggerAndReturn(context || document, eventName, data) + } + + // Number of active Ajax requests + $.active = 0 + + function ajaxStart(settings) { + if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') + } + function ajaxStop(settings) { + if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') + } + + // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable + function ajaxBeforeSend(xhr, settings) { + var context = settings.context + if (settings.beforeSend.call(context, xhr, settings) === false || + triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) + return false + + triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) + } + function ajaxSuccess(data, xhr, settings, deferred) { + var context = settings.context, status = 'success' + settings.success.call(context, data, status, xhr) + if (deferred) deferred.resolveWith(context, [data, status, xhr]) + triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) + ajaxComplete(status, xhr, settings) + } + // type: "timeout", "error", "abort", "parsererror" + function ajaxError(error, type, xhr, settings, deferred) { + var context = settings.context + settings.error.call(context, xhr, type, error) + if (deferred) deferred.rejectWith(context, [xhr, type, error]) + triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) + ajaxComplete(type, xhr, settings) + } + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + function ajaxComplete(status, xhr, settings) { + var context = settings.context + settings.complete.call(context, xhr, status) + triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) + ajaxStop(settings) + } + + function ajaxDataFilter(data, type, settings) { + if (settings.dataFilter == empty) return data + var context = settings.context + return settings.dataFilter.call(context, data, type) + } + + // Empty function, used as default callback + function empty() {} + + $.ajaxJSONP = function(options, deferred){ + if (!('type' in options)) return $.ajax(options) + + var _callbackName = options.jsonpCallback, + callbackName = ($.isFunction(_callbackName) ? + _callbackName() : _callbackName) || ('Zepto' + (jsonpID++)), + script = document.createElement('script'), + originalCallback = window[callbackName], + responseData, + abort = function(errorType) { + $(script).triggerHandler('error', errorType || 'abort') + }, + xhr = { abort: abort }, abortTimeout + + if (deferred) deferred.promise(xhr) + + $(script).on('load error', function(e, errorType){ + clearTimeout(abortTimeout) + $(script).off().remove() + + if (e.type == 'error' || !responseData) { + ajaxError(null, errorType || 'error', xhr, options, deferred) + } else { + ajaxSuccess(responseData[0], xhr, options, deferred) + } + + window[callbackName] = originalCallback + if (responseData && $.isFunction(originalCallback)) + originalCallback(responseData[0]) + + originalCallback = responseData = undefined + }) + + if (ajaxBeforeSend(xhr, options) === false) { + abort('abort') + return xhr + } + + window[callbackName] = function(){ + responseData = arguments + } + + script.src = options.url.replace(/\?(.+)=\?/, '?$1=' + callbackName) + document.head.appendChild(script) + + if (options.timeout > 0) abortTimeout = setTimeout(function(){ + abort('timeout') + }, options.timeout) + + return xhr + } + + $.ajaxSettings = { + // Default type of request + type: 'GET', + // Callback that is executed before request + beforeSend: empty, + // Callback that is executed if the request succeeds + success: empty, + // Callback that is executed the the server drops error + error: empty, + // Callback that is executed on request complete (both: error and success) + complete: empty, + // The context for the callbacks + context: null, + // Whether to trigger "global" Ajax events + global: true, + // Transport + xhr: function () { + return new window.XMLHttpRequest() + }, + // MIME types mapping + // IIS returns Javascript as "application/x-javascript" + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: jsonType, + xml: 'application/xml, text/xml', + html: htmlType, + text: 'text/plain' + }, + // Whether the request is to another domain + crossDomain: false, + // Default timeout + timeout: 0, + // Whether data should be serialized to string + processData: true, + // Whether the browser should be allowed to cache GET responses + cache: true, + //Used to handle the raw response data of XMLHttpRequest. + //This is a pre-filtering function to sanitize the response. + //The sanitized response should be returned + dataFilter: empty + } + + function mimeToDataType(mime) { + if (mime) mime = mime.split(';', 2)[0] + return mime && ( mime == htmlType ? 'html' : + mime == jsonType ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml' ) || 'text' + } + + function appendQuery(url, query) { + if (query == '') return url + return (url + '&' + query).replace(/[&?]{1,2}/, '?') + } + + // serialize payload and append it to the URL for GET requests + function serializeData(options) { + if (options.processData && options.data && $.type(options.data) != "string") + options.data = $.param(options.data, options.traditional) + if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType)) + options.url = appendQuery(options.url, options.data), options.data = undefined + } + + $.ajax = function(options){ + var settings = $.extend({}, options || {}), + deferred = $.Deferred && $.Deferred(), + urlAnchor, hashIndex + for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] + + ajaxStart(settings) + + if (!settings.crossDomain) { + urlAnchor = document.createElement('a') + urlAnchor.href = settings.url + // cleans up URL for .href (IE only), see https://github.com/madrobby/zepto/pull/1049 + urlAnchor.href = urlAnchor.href + settings.crossDomain = (originAnchor.protocol + '//' + originAnchor.host) !== (urlAnchor.protocol + '//' + urlAnchor.host) + } + + if (!settings.url) settings.url = window.location.toString() + if ((hashIndex = settings.url.indexOf('#')) > -1) settings.url = settings.url.slice(0, hashIndex) + serializeData(settings) + + var dataType = settings.dataType, hasPlaceholder = /\?.+=\?/.test(settings.url) + if (hasPlaceholder) dataType = 'jsonp' + + if (settings.cache === false || ( + (!options || options.cache !== true) && + ('script' == dataType || 'jsonp' == dataType) + )) + settings.url = appendQuery(settings.url, '_=' + Date.now()) + + if ('jsonp' == dataType) { + if (!hasPlaceholder) + settings.url = appendQuery(settings.url, + settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?') + return $.ajaxJSONP(settings, deferred) + } + + var mime = settings.accepts[dataType], + headers = { }, + setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, + protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, + xhr = settings.xhr(), + nativeSetHeader = xhr.setRequestHeader, + abortTimeout + + if (deferred) deferred.promise(xhr) + + if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest') + setHeader('Accept', mime || '*/*') + if (mime = settings.mimeType || mime) { + if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] + xhr.overrideMimeType && xhr.overrideMimeType(mime) + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') + + if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name]) + xhr.setRequestHeader = setHeader + + xhr.onreadystatechange = function(){ + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty + clearTimeout(abortTimeout) + var result, error = false + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) + + if (xhr.responseType == 'arraybuffer' || xhr.responseType == 'blob') + result = xhr.response + else { + result = xhr.responseText + + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + // sanitize response accordingly if data filter callback provided + result = ajaxDataFilter(result, dataType, settings) + if (dataType == 'script') (1,eval)(result) + else if (dataType == 'xml') result = xhr.responseXML + else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) + } catch (e) { error = e } + + if (error) return ajaxError(error, 'parsererror', xhr, settings, deferred) + } + + ajaxSuccess(result, xhr, settings, deferred) + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred) + } + } + } + + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort() + ajaxError(null, 'abort', xhr, settings, deferred) + return xhr + } + + var async = 'async' in settings ? settings.async : true + xhr.open(settings.type, settings.url, async, settings.username, settings.password) + + if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + + for (name in headers) nativeSetHeader.apply(xhr, headers[name]) + + if (settings.timeout > 0) abortTimeout = setTimeout(function(){ + xhr.onreadystatechange = empty + xhr.abort() + ajaxError(null, 'timeout', xhr, settings, deferred) + }, settings.timeout) + + // avoid sending empty string (#319) + xhr.send(settings.data ? settings.data : null) + return xhr + } + + // handle optional data/success arguments + function parseArguments(url, data, success, dataType) { + if ($.isFunction(data)) dataType = success, success = data, data = undefined + if (!$.isFunction(success)) dataType = success, success = undefined + return { + url: url + , data: data + , success: success + , dataType: dataType + } + } + + $.get = function(/* url, data, success, dataType */){ + return $.ajax(parseArguments.apply(null, arguments)) + } + + $.post = function(/* url, data, success, dataType */){ + var options = parseArguments.apply(null, arguments) + options.type = 'POST' + return $.ajax(options) + } + + $.getJSON = function(/* url, data, success */){ + var options = parseArguments.apply(null, arguments) + options.dataType = 'json' + return $.ajax(options) + } + + $.fn.load = function(url, data, success){ + if (!this.length) return this + var self = this, parts = url.split(/\s/), selector, + options = parseArguments(url, data, success), + callback = options.success + if (parts.length > 1) options.url = parts[0], selector = parts[1] + options.success = function(response){ + self.html(selector ? + $('
').html(response.replace(rscript, "")).find(selector) + : response) + callback && callback.apply(self, arguments) + } + $.ajax(options) + return this + } + + var escape = encodeURIComponent + + function serialize(params, obj, traditional, scope){ + var type, array = $.isArray(obj), hash = $.isPlainObject(obj) + $.each(obj, function(key, value) { + type = $.type(value) + if (scope) key = traditional ? scope : + scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' + // handle data in serializeArray() format + if (!scope && array) params.add(value.name, value.value) + // recurse into nested objects + else if (type == "array" || (!traditional && type == "object")) + serialize(params, value, traditional, key) + else params.add(key, value) + }) + } + + $.param = function(obj, traditional){ + var params = [] + params.add = function(key, value) { + if ($.isFunction(value)) value = value() + if (value == null) value = "" + this.push(escape(key) + '=' + escape(value)) + } + serialize(params, obj, traditional) + return params.join('&').replace(/%20/g, '+') + } +})(Zepto) + +;(function($){ + // Create a collection of callbacks to be fired in a sequence, with configurable behaviour + // Option flags: + // - once: Callbacks fired at most one time. + // - memory: Remember the most recent context and arguments + // - stopOnFalse: Cease iterating over callback list + // - unique: Permit adding at most one instance of the same callback + $.Callbacks = function(options) { + options = $.extend({}, options) + + var memory, // Last fire value (for non-forgettable lists) + fired, // Flag to know if list was already fired + firing, // Flag to know if list is currently firing + firingStart, // First callback to fire (used internally by add and fireWith) + firingLength, // End of the loop when firing + firingIndex, // Index of currently firing callback (modified by remove if needed) + list = [], // Actual callback list + stack = !options.once && [], // Stack of fire calls for repeatable lists + fire = function(data) { + memory = options.memory && data + fired = true + firingIndex = firingStart || 0 + firingStart = 0 + firingLength = list.length + firing = true + for ( ; list && firingIndex < firingLength ; ++firingIndex ) { + if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) { + memory = false + break + } + } + firing = false + if (list) { + if (stack) stack.length && fire(stack.shift()) + else if (memory) list.length = 0 + else Callbacks.disable() + } + }, + + Callbacks = { + add: function() { + if (list) { + var start = list.length, + add = function(args) { + $.each(args, function(_, arg){ + if (typeof arg === "function") { + if (!options.unique || !Callbacks.has(arg)) list.push(arg) + } + else if (arg && arg.length && typeof arg !== 'string') add(arg) + }) + } + add(arguments) + if (firing) firingLength = list.length + else if (memory) { + firingStart = start + fire(memory) + } + } + return this + }, + remove: function() { + if (list) { + $.each(arguments, function(_, arg){ + var index + while ((index = $.inArray(arg, list, index)) > -1) { + list.splice(index, 1) + // Handle firing indexes + if (firing) { + if (index <= firingLength) --firingLength + if (index <= firingIndex) --firingIndex + } + } + }) + } + return this + }, + has: function(fn) { + return !!(list && (fn ? $.inArray(fn, list) > -1 : list.length)) + }, + empty: function() { + firingLength = list.length = 0 + return this + }, + disable: function() { + list = stack = memory = undefined + return this + }, + disabled: function() { + return !list + }, + lock: function() { + stack = undefined + if (!memory) Callbacks.disable() + return this + }, + locked: function() { + return !stack + }, + fireWith: function(context, args) { + if (list && (!fired || stack)) { + args = args || [] + args = [context, args.slice ? args.slice() : args] + if (firing) stack.push(args) + else fire(args) + } + return this + }, + fire: function() { + return Callbacks.fireWith(this, arguments) + }, + fired: function() { + return !!fired + } + } + + return Callbacks + } +})(Zepto) + +;(function($){ + var slice = Array.prototype.slice + + function Deferred(func) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", $.Callbacks({once:1, memory:1}), "resolved" ], + [ "reject", "fail", $.Callbacks({once:1, memory:1}), "rejected" ], + [ "notify", "progress", $.Callbacks({memory:1}) ] + ], + state = "pending", + promise = { + state: function() { + return state + }, + always: function() { + deferred.done(arguments).fail(arguments) + return this + }, + then: function(/* fnDone [, fnFailed [, fnProgress]] */) { + var fns = arguments + return Deferred(function(defer){ + $.each(tuples, function(i, tuple){ + var fn = $.isFunction(fns[i]) && fns[i] + deferred[tuple[1]](function(){ + var returned = fn && fn.apply(this, arguments) + if (returned && $.isFunction(returned.promise)) { + returned.promise() + .done(defer.resolve) + .fail(defer.reject) + .progress(defer.notify) + } else { + var context = this === promise ? defer.promise() : this, + values = fn ? [returned] : arguments + defer[tuple[0] + "With"](context, values) + } + }) + }) + fns = null + }).promise() + }, + + promise: function(obj) { + return obj != null ? $.extend( obj, promise ) : promise + } + }, + deferred = {} + + $.each(tuples, function(i, tuple){ + var list = tuple[2], + stateString = tuple[3] + + promise[tuple[1]] = list.add + + if (stateString) { + list.add(function(){ + state = stateString + }, tuples[i^1][2].disable, tuples[2][2].lock) + } + + deferred[tuple[0]] = function(){ + deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments) + return this + } + deferred[tuple[0] + "With"] = list.fireWith + }) + + promise.promise(deferred) + if (func) func.call(deferred, deferred) + return deferred + } + + $.when = function(sub) { + var resolveValues = slice.call(arguments), + len = resolveValues.length, + i = 0, + remain = len !== 1 || (sub && $.isFunction(sub.promise)) ? len : 0, + deferred = remain === 1 ? sub : Deferred(), + progressValues, progressContexts, resolveContexts, + updateFn = function(i, ctx, val){ + return function(value){ + ctx[i] = this + val[i] = arguments.length > 1 ? slice.call(arguments) : value + if (val === progressValues) { + deferred.notifyWith(ctx, val) + } else if (!(--remain)) { + deferred.resolveWith(ctx, val) + } + } + } + + if (len > 1) { + progressValues = new Array(len) + progressContexts = new Array(len) + resolveContexts = new Array(len) + for ( ; i < len; ++i ) { + if (resolveValues[i] && $.isFunction(resolveValues[i].promise)) { + resolveValues[i].promise() + .done(updateFn(i, resolveContexts, resolveValues)) + .fail(deferred.reject) + .progress(updateFn(i, progressContexts, progressValues)) + } else { + --remain + } + } + } + if (!remain) deferred.resolveWith(resolveContexts, resolveValues) + return deferred.promise() + } + + $.Deferred = Deferred +})(Zepto) + +;(function($){ + var _zid = 1, undefined, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function(obj){ return typeof obj == 'string' }, + handlers = {}, + specialEvents={}, + focusinSupported = 'onfocusin' in window, + focus = { focus: 'focusin', blur: 'focusout' }, + hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } + + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' + + function zid(element) { + return element._zid || (element._zid = _zid++) + } + function findHandlers(element, event, fn, selector) { + event = parse(event) + if (event.ns) var matcher = matcherFor(event.ns) + return (handlers[zid(element)] || []).filter(function(handler) { + return handler + && (!event.e || handler.e == event.e) + && (!event.ns || matcher.test(handler.ns)) + && (!fn || zid(handler.fn) === zid(fn)) + && (!selector || handler.sel == selector) + }) + } + function parse(event) { + var parts = ('' + event).split('.') + return {e: parts[0], ns: parts.slice(1).sort().join(' ')} + } + function matcherFor(ns) { + return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') + } + + function eventCapture(handler, captureSetting) { + return handler.del && + (!focusinSupported && (handler.e in focus)) || + !!captureSetting + } + + function realEvent(type) { + return hover[type] || (focusinSupported && focus[type]) || type + } + + function add(element, events, fn, data, selector, delegator, capture){ + var id = zid(element), set = (handlers[id] || (handlers[id] = [])) + events.split(/\s/).forEach(function(event){ + if (event == 'ready') return $(document).ready(fn) + var handler = parse(event) + handler.fn = fn + handler.sel = selector + // emulate mouseenter, mouseleave + if (handler.e in hover) fn = function(e){ + var related = e.relatedTarget + if (!related || (related !== this && !$.contains(this, related))) + return handler.fn.apply(this, arguments) + } + handler.del = delegator + var callback = delegator || fn + handler.proxy = function(e){ + e = compatible(e) + if (e.isImmediatePropagationStopped()) return + e.data = data + var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args)) + if (result === false) e.preventDefault(), e.stopPropagation() + return result + } + handler.i = set.length + set.push(handler) + if ('addEventListener' in element) + element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + } + function remove(element, events, fn, selector, capture){ + var id = zid(element) + ;(events || '').split(/\s/).forEach(function(event){ + findHandlers(element, event, fn, selector).forEach(function(handler){ + delete handlers[id][handler.i] + if ('removeEventListener' in element) + element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) + }) + }) + } + + $.event = { add: add, remove: remove } + + $.proxy = function(fn, context) { + var args = (2 in arguments) && slice.call(arguments, 2) + if (isFunction(fn)) { + var proxyFn = function(){ return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments) } + proxyFn._zid = zid(fn) + return proxyFn + } else if (isString(context)) { + if (args) { + args.unshift(fn[context], fn) + return $.proxy.apply(null, args) + } else { + return $.proxy(fn[context], fn) + } + } else { + throw new TypeError("expected function") + } + } + + $.fn.bind = function(event, data, callback){ + return this.on(event, data, callback) + } + $.fn.unbind = function(event, callback){ + return this.off(event, callback) + } + $.fn.one = function(event, selector, data, callback){ + return this.on(event, selector, data, callback, 1) + } + + var returnTrue = function(){return true}, + returnFalse = function(){return false}, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/, + eventMethods = { + preventDefault: 'isDefaultPrevented', + stopImmediatePropagation: 'isImmediatePropagationStopped', + stopPropagation: 'isPropagationStopped' + } + + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event) + + $.each(eventMethods, function(name, predicate) { + var sourceMethod = source[name] + event[name] = function(){ + this[predicate] = returnTrue + return sourceMethod && sourceMethod.apply(source, arguments) + } + event[predicate] = returnFalse + }) + + event.timeStamp || (event.timeStamp = Date.now()) + + if (source.defaultPrevented !== undefined ? source.defaultPrevented : + 'returnValue' in source ? source.returnValue === false : + source.getPreventDefault && source.getPreventDefault()) + event.isDefaultPrevented = returnTrue + } + return event + } + + function createProxy(event) { + var key, proxy = { originalEvent: event } + for (key in event) + if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] + + return compatible(proxy, event) + } + + $.fn.delegate = function(selector, event, callback){ + return this.on(event, selector, callback) + } + $.fn.undelegate = function(selector, event, callback){ + return this.off(event, selector, callback) + } + + $.fn.live = function(event, callback){ + $(document.body).delegate(this.selector, event, callback) + return this + } + $.fn.die = function(event, callback){ + $(document.body).undelegate(this.selector, event, callback) + return this + } + + $.fn.on = function(event, selector, data, callback, one){ + var autoRemove, delegator, $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.on(type, selector, data, fn, one) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = data, data = selector, selector = undefined + if (callback === undefined || data === false) + callback = data, data = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(_, element){ + if (one) autoRemove = function(e){ + remove(element, e.type, callback) + return callback.apply(this, arguments) + } + + if (selector) delegator = function(e){ + var evt, match = $(e.target).closest(selector, element).get(0) + if (match && match !== element) { + evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))) + } + } + + add(element, event, callback, data, selector, delegator || autoRemove) + }) + } + $.fn.off = function(event, selector, callback){ + var $this = this + if (event && !isString(event)) { + $.each(event, function(type, fn){ + $this.off(type, selector, fn) + }) + return $this + } + + if (!isString(selector) && !isFunction(callback) && callback !== false) + callback = selector, selector = undefined + + if (callback === false) callback = returnFalse + + return $this.each(function(){ + remove(this, event, callback, selector) + }) + } + + $.fn.trigger = function(event, args){ + event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) + event._args = args + return this.each(function(){ + // handle focus(), blur() by calling them directly + if (event.type in focus && typeof this[event.type] == "function") this[event.type]() + // items in the collection might not be DOM elements + else if ('dispatchEvent' in this) this.dispatchEvent(event) + else $(this).triggerHandler(event, args) + }) + } + + // triggers event handlers on current element just as if an event occurred, + // doesn't trigger an actual event, doesn't bubble + $.fn.triggerHandler = function(event, args){ + var e, result + this.each(function(i, element){ + e = createProxy(isString(event) ? $.Event(event) : event) + e._args = args + e.target = element + $.each(findHandlers(element, event.type || event), function(i, handler){ + result = handler.proxy(e) + if (e.isImmediatePropagationStopped()) return false + }) + }) + return result + } + + // shortcut methods for `.bind(event, fn)` for each event type + ;('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(event) { + $.fn[event] = function(callback) { + return (0 in arguments) ? + this.bind(event, callback) : + this.trigger(event) + } + }) + + $.Event = function(type, props) { + if (!isString(type)) props = type, type = props.type + var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true + if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) + event.initEvent(type, bubbles, true) + return compatible(event) + } + +})(Zepto) + +;(function(){ + // getComputedStyle shouldn't freak out when called + // without a valid element as argument + try { + getComputedStyle(undefined) + } catch(e) { + var nativeGetComputedStyle = getComputedStyle + window.getComputedStyle = function(element, pseudoElement){ + try { + return nativeGetComputedStyle(element, pseudoElement) + } catch(e) { + return null + } + } + } +})() + +;(function($){ + var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches + + function visible(elem){ + elem = $(elem) + return !!(elem.width() || elem.height()) && elem.css("display") !== "none" + } + + // Implements a subset from: + // http://api.jquery.com/category/selectors/jquery-selector-extensions/ + // + // Each filter function receives the current index, all nodes in the + // considered set, and a value if there were parentheses. The value + // of `this` is the node currently being considered. The function returns the + // resulting node(s), null, or undefined. + // + // Complex selectors are not supported: + // li:has(label:contains("foo")) + li:has(label:contains("bar")) + // ul.inner:first > li + var filters = $.expr[':'] = { + visible: function(){ if (visible(this)) return this }, + hidden: function(){ if (!visible(this)) return this }, + selected: function(){ if (this.selected) return this }, + checked: function(){ if (this.checked) return this }, + parent: function(){ return this.parentNode }, + first: function(idx){ if (idx === 0) return this }, + last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, + eq: function(idx, _, value){ if (idx === value) return this }, + contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, + has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } + } + + var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), + childRe = /^\s*>/, + classTag = 'Zepto' + (+new Date()) + + function process(sel, fn) { + // quote the hash in `a[href^=#]` expression + sel = sel.replace(/=#\]/g, '="#"]') + var filter, arg, match = filterRe.exec(sel) + if (match && match[2] in filters) { + filter = filters[match[2]], arg = match[3] + sel = match[1] + if (arg) { + var num = Number(arg) + if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') + else arg = num + } + } + return fn(sel, filter, arg) + } + + zepto.qsa = function(node, selector) { + return process(selector, function(sel, filter, arg){ + try { + var taggedParent + if (!sel && filter) sel = '*' + else if (childRe.test(sel)) + // support "> *" child queries by tagging the parent node with a + // unique class and prepending that classname onto the selector + taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel + + var nodes = oldQsa(node, sel) + } catch(e) { + console.error('error performing selector: %o', selector) + throw e + } finally { + if (taggedParent) taggedParent.removeClass(classTag) + } + return !filter ? nodes : + zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) + }) + } + + zepto.matches = function(node, selector){ + return process(selector, function(sel, filter, arg){ + return (!sel || oldMatches(node, sel)) && + (!filter || filter.call(node, null, arg) === node) + }) + } +})(Zepto) +module.exports = Zepto + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { - var _poster2 = _interopRequireDefault(_poster); +"use strict"; - var _log = __webpack_require__(6); - var _log2 = _interopRequireDefault(_log); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _styler = __webpack_require__(15); +var _clapprZepto = __webpack_require__(6); - var _styler2 = _interopRequireDefault(_styler); +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); - var _vendor = __webpack_require__(8); +var _template = __webpack_require__(8); - var _vendor2 = _interopRequireDefault(_vendor); +var _template2 = _interopRequireDefault(_template); - var _template = __webpack_require__(17); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _template2 = _interopRequireDefault(_template); +// 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 _clapprZepto = __webpack_require__(16); +var Styler = { + getStyleFor: function getStyleFor(style) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { baseUrl: '' }; - var _clapprZepto2 = _interopRequireDefault(_clapprZepto); + return (0, _clapprZepto2.default)('').html((0, _template2.default)(style.toString())(options)); + } +}; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.default = Styler; +module.exports = exports['default']; - 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. +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { - 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']; +"use strict"; -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - 'use strict'; +Object.defineProperty(exports, "__esModule", { + value: true +}); +/* eslint-disable no-var */ +// Simple JavaScript Templating +// Paul Miller (http://paulmillr.com) +// http://underscorejs.org +// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + +// By default, Underscore uses ERB-style template delimiters, change the +// following template settings to use alternative delimiters. +var settings = { + evaluate: /<%([\s\S]+?)%>/g, + interpolate: /<%=([\s\S]+?)%>/g, + escape: /<%-([\s\S]+?)%>/g +}; + +// When customizing `templateSettings`, if you don't want to define an +// interpolation, evaluation or escaping regex, we need one that is +// guaranteed not to match. +var noMatch = /(.)^/; + +// Certain characters need to be escaped so that they can be put into a +// string literal. +var escapes = { + '\'': '\'', + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + +// List of HTML entities for escaping. +var htmlEntities = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''' +}; + +var entityRe = new RegExp('[&<>"\']', 'g'); + +var escapeExpr = function escapeExpr(string) { + if (string === null) { + return ''; + } + return ('' + string).replace(entityRe, function (match) { + return htmlEntities[match]; + }); +}; + +var counter = 0; + +// JavaScript micro-templating, similar to John Resig's implementation. +// Underscore templating handles arbitrary delimiters, preserves whitespace, +// and correctly escapes quotes within interpolated code. +var tmpl = function tmpl(text, data) { + var render; + + // Combine delimiters into one regular expression via alternation. + var matcher = new RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = '__p+=\''; + text.replace(matcher, function (match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escaper, function (match) { + return '\\' + escapes[match]; + }); + + if (escape) { + source += '\'+\n((__t=(' + escape + '))==null?\'\':escapeExpr(__t))+\n\''; + } + if (interpolate) { + source += '\'+\n((__t=(' + interpolate + '))==null?\'\':__t)+\n\''; + } + if (evaluate) { + source += '\';\n' + evaluate + '\n__p+=\''; + } + index = offset + match.length; + return match; + }); + source += '\';\n'; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) { + source = 'with(obj||{}){\n' + source + '}\n'; + } + + source = 'var __t,__p=\'\',__j=Array.prototype.join,' + 'print=function(){__p+=__j.call(arguments,\'\');};\n' + source + 'return __p;\n//# sourceURL=/microtemplates/source[' + counter++ + ']'; + + try { + /*jshint -W054 */ + // TODO: find a way to avoid eval + render = new Function(settings.variable || 'obj', 'escapeExpr', source); + } catch (e) { + e.source = source; + throw e; + } + + if (data) { + return render(data, escapeExpr); + } + var template = function template(data) { + return render.call(this, data, escapeExpr); + }; + + // Provide the compiled function source as a convenience for precompilation. + template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + + return template; +}; +tmpl.settings = settings; + +exports.default = tmpl; +module.exports = exports['default']; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { - Object.defineProperty(exports, "__esModule", { - value: true - }); +"use strict"; - 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); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _base_object = __webpack_require__(4); +var _classCallCheck2 = __webpack_require__(0); - var _base_object2 = _interopRequireDefault(_base_object); +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var _events = __webpack_require__(5); +var _possibleConstructorReturn2 = __webpack_require__(1); - var _events2 = _interopRequireDefault(_events); +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - var _browser = __webpack_require__(3); +var _createClass2 = __webpack_require__(3); - var _browser2 = _interopRequireDefault(_browser); +var _createClass3 = _interopRequireDefault(_createClass2); - var _core_factory = __webpack_require__(11); +var _inherits2 = __webpack_require__(2); - var _core_factory2 = _interopRequireDefault(_core_factory); +var _inherits3 = _interopRequireDefault(_inherits2); - var _loader = __webpack_require__(48); +var _utils = __webpack_require__(5); - var _loader2 = _interopRequireDefault(_loader); +var _ui_object = __webpack_require__(21); - var _player_info = __webpack_require__(45); +var _ui_object2 = _interopRequireDefault(_ui_object); - var _player_info2 = _interopRequireDefault(_player_info); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _clapprZepto = __webpack_require__(16); +/** + * An abstraction to represent a generic playback, it's like an interface to be implemented by subclasses. + * @class Playback + * @constructor + * @extends UIObject + * @module base + */ +var Playback = function (_UIObject) { + (0, _inherits3.default)(Playback, _UIObject); + (0, _createClass3.default)(Playback, [{ + key: 'isAudioOnly', - 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. - */ + /** + * Determine if the playback does not contain video/has video but video should be ignored. + * @property isAudioOnly + * @type Boolean + */ + get: function get() { + return false; + } + /** + * Determine if the playback has ended. + * @property ended + * @type Boolean + */ - Player.prototype.getStartTimeOffset = function getStartTimeOffset() { - return this.core.mediaControl.container.getStartTimeOffset(); - }; + }, { + key: 'ended', + get: function get() { + return false; + } - /** - * 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); + /** + * The internationalization plugin. + * @property i18n + * @type {Strings} + */ - exports.default = Player; - module.exports = exports['default']; + }, { + key: 'i18n', + get: function get() { + return this._i18n; + } -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { + /** + * 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 + */ - 'use strict'; + }, { + key: 'buffering', + get: function get() { + return false; + } - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.cancelAnimationFrame = exports.requestAnimationFrame = exports.QueryString = exports.Config = exports.Fullscreen = undefined; + /** + * @method constructor + * @param {Object} options the options object + * @param {Strings} i18n the internationalization component + */ - 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; + function Playback(options, i18n) { + (0, _classCallCheck3.default)(this, Playback); - var _browser = __webpack_require__(3); + var _this = (0, _possibleConstructorReturn3.default)(this, _UIObject.call(this, options)); - var _browser2 = _interopRequireDefault(_browser); + _this.settings = {}; + _this._i18n = i18n; + return _this; + } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** + * Gives user consent to playback (mobile devices). + * @method consent + */ - 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; } + Playback.prototype.consent = function consent() {}; - 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 */ + /** + * plays the playback. + * @method play + */ - 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); + Playback.prototype.play = function play() {}; + + /** + * pauses the playback. + * @method pause + */ + + + Playback.prototype.pause = function pause() {}; + + /** + * stops the playback. + * @method stop + */ - function Surrogate() { - _classCallCheck(this, Surrogate); - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + Playback.prototype.stop = function stop() {}; - var _this = _possibleConstructorReturn(this, _parent.call.apply(_parent, [this].concat(args))); + /** + * seeks the playback to a given `time` in seconds + * @method seek + * @param {Number} time should be a number between 0 and the video duration + */ - if (properties.initialize) { - properties.initialize.apply(_this, args); - } - return _this; - } - return Surrogate; - }(parent); + Playback.prototype.seek = function seek(time) {}; // eslint-disable-line no-unused-vars - assign(Surrogate.prototype, properties); - return Surrogate; - } + /** + * seeks the playback to a given `percentage` in percentage + * @method seekPercentage + * @param {Number} time should be a number between 0 and 100 + */ - 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); - } - }; + Playback.prototype.seekPercentage = function seekPercentage(percentage) {}; // eslint-disable-line no-unused-vars - 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 = {}; + /** + * 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. + */ - function uniqueId(prefix) { - idsCounter[prefix] || (idsCounter[prefix] = 0); - var id = ++idsCounter[prefix]; - return prefix + id; - } - function isNumber(value) { - return value - parseFloat(value) + 1 >= 0; - } + Playback.prototype.getStartTimeOffset = function getStartTimeOffset() { + return 0; + }; - function currentScriptUrl() { - var scripts = document.getElementsByTagName('script'); - return scripts.length ? scripts[scripts.length - 1].src : ''; - } + /** + * gets the duration in seconds + * @method getDuration + * @return {Number} duration (in seconds) of the current source + */ - 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); + Playback.prototype.getDuration = function getDuration() { + return 0; + }; - function getBrowserLanguage() { - return window.navigator && window.navigator.language; - } + /** + * checks if the playback is playing. + * @method isPlaying + * @return {Boolean} `true` if the current playback is playing, otherwise `false` + */ - 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); - } - } + Playback.prototype.isPlaying = function isPlaying() { + return false; + }; - 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 - }; + /** + * checks if the playback is ready. + * @property isReady + * @type {Boolean} `true` if the current playback is ready, otherwise `false` + */ -/***/ }, -/* 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); - } + // eslint-disable-line no-unused-vars + + /** + * gets the playback type (`'vod', 'live', 'aod'`) + * @method getPlaybackType + * @return {String} you should write the playback type otherwise it'll assume `'no_op'` + * @example + * ```javascript + * html5VideoPlayback.getPlaybackType() //vod + * html5AudioPlayback.getPlaybackType() //aod + * html5VideoPlayback.getPlaybackType() //live + * flashHlsPlayback.getPlaybackType() //live + * ``` + */ + Playback.prototype.getPlaybackType = function getPlaybackType() { + return Playback.NO_OP; + }; + + /** + * checks if the playback is in HD. + * @method isHighDefinitionInUse + * @return {Boolean} `true` if the playback is playing in HD, otherwise `false` + */ + + + Playback.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() { + return false; + }; + + /** + * sets the volume for the playback + * @method volume + * @param {Number} value a number between 0 (`muted`) to 100 (`max`) + */ + + + Playback.prototype.volume = function volume(value) {}; // eslint-disable-line no-unused-vars + + /** + * destroys the playback, removing it from DOM + * @method destroy + */ + + + Playback.prototype.destroy = function destroy() { + this.$el.remove(); + }; + + (0, _createClass3.default)(Playback, [{ + key: 'isReady', + get: function get() { + return false; + } + + /** + * checks if the playback has closed caption tracks. + * @property hasClosedCaptionsTracks + * @type {Boolean} + */ + + }, { + key: 'hasClosedCaptionsTracks', + get: function get() { + return this.closedCaptionsTracks.length > 0; + } + + /** + * gets the playback available closed caption tracks. + * @property closedCaptionsTracks + * @type {Array} an array of objects with at least 'id' and 'name' properties + */ + + }, { + key: 'closedCaptionsTracks', + get: function get() { + return []; + } + + /** + * gets the selected closed caption track index. (-1 is disabled) + * @property closedCaptionsTrackId + * @type {Number} + */ + + }, { + key: 'closedCaptionsTrackId', + get: function get() { + return -1; + } + + /** + * sets the selected closed caption track index. (-1 is disabled) + * @property closedCaptionsTrackId + * @type {Number} + */ + , + set: function set(trackId) {} + }]); + return Playback; +}(_ui_object2.default); + +exports.default = Playback; + + +Playback.extend = function (properties) { + return (0, _utils.extend)(Playback, properties); +}; + +/** + * checks if the playback can play a given `source` + * If a mimeType is provided then this will be used instead of inferring the mimetype + * from the source extension. + * @method canPlay + * @static + * @param {String} source the given source ex: `http://example.com/play.mp4` + * @param {String} [mimeType] the given mime type, ex: `'application/vnd.apple.mpegurl'` + * @return {Boolean} `true` if the playback is playable, otherwise `false` + */ +Playback.canPlay = function (source, mimeType) { + // eslint-disable-line no-unused-vars + return false; +}; + +/** + * a playback type for video on demand + * + * @property VOD + * @static + * @type String + */ +Playback.VOD = 'vod'; +/** + * a playback type for audio on demand + * + * @property AOD + * @static + * @type String + */ +Playback.AOD = 'aod'; +/** + * a playback type for live video + * + * @property LIVE + * @static + * @type String + */ +Playback.LIVE = 'live'; +/** + * a default playback type + * + * @property NO_OP + * @static + * @type String + */ +Playback.NO_OP = 'no_op'; +/** + * the plugin type + * + * @property type + * @static + * @type String + */ +Playback.type = 'playback'; +module.exports = exports['default']; + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function(useSourceMap) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + if(item[2]) { + return "@media " + item[2] + "{" + content + "}"; + } else { + return content; + } + }).join(""); }; - 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]) }; + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } }; + return list; +}; - var 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__) { +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } - 'use strict'; + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' + }); - Object.defineProperty(exports, "__esModule", { - value: true - }); + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + return [content].join('\n'); +} - var _utils = __webpack_require__(2); +// Adapted from convert-source-map (MIT) +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - var _events = __webpack_require__(5); + return '/*# ' + data + ' */'; +} - var _events2 = _interopRequireDefault(_events); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 11 */ +/***/ (function(module, exports) { - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var core = module.exports = {version: '2.4.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef - 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; } +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { - 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 store = __webpack_require__(44)('wks') + , uid = __webpack_require__(32) + , Symbol = __webpack_require__(15).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; - /** - * @class BaseObject - * @constructor - * @extends Events - * @module base - */ - var BaseObject = function (_Events) { - _inherits(BaseObject, _Events); +var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; - _createClass(BaseObject, [{ - key: 'options', +$exports.store = store; - /** - * returns the object options - * @property options - * @type Object - */ - get: function get() { - return this._options; - } +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * @method constructor - * @param {Object} options - */ +"use strict"; - }]); - function BaseObject() { - var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; +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]) }; + } + extra = ua.match(/\bEdge\/(\d+)/); + if (extra != null) { + return { name: 'Edge', 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.isEdge = /edge/i.test(navigator.userAgent); +Browser.isChrome = /chrome|CriOS/i.test(navigator.userAgent) && !Browser.isEdge; +Browser.isSafari = /safari/i.test(navigator.userAgent) && !Browser.isChrome && !Browser.isEdge; +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|Mobile Safari|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']; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { - _classCallCheck(this, BaseObject); +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(91) + , defined = __webpack_require__(40); +module.exports = function(it){ + return IObject(defined(it)); +}; - var _this = _possibleConstructorReturn(this, _Events.call(this, options)); +/***/ }), +/* 15 */ +/***/ (function(module, exports) { - _this._options = options; - _this.uniqueId = (0, _utils.uniqueId)('o'); - return _this; - } - /** - * a unique id prefixed with `'o'`, `o1, o232` - * - * @property uniqueId - * @type String - */ +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(23) + , IE8_DOM_DEFINE = __webpack_require__(63) + , toPrimitive = __webpack_require__(47) + , dP = Object.defineProperty; + +exports.f = __webpack_require__(20) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { - return BaseObject; - }(_events2.default); +"use strict"; - exports.default = BaseObject; - module.exports = exports['default']; -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - 'use strict'; +var _classCallCheck2 = __webpack_require__(0); - Object.defineProperty(exports, "__esModule", { - value: true - }); +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - 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 _possibleConstructorReturn2 = __webpack_require__(1); - var _log = __webpack_require__(6); +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - var _log2 = _interopRequireDefault(_log); +var _createClass2 = __webpack_require__(3); - var _utils = __webpack_require__(2); +var _createClass3 = _interopRequireDefault(_createClass2); - var _lodash = __webpack_require__(10); +var _inherits2 = __webpack_require__(2); - var _lodash2 = _interopRequireDefault(_lodash); +var _inherits3 = _interopRequireDefault(_inherits2); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _utils = __webpack_require__(5); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _events = __webpack_require__(4); - var slice = Array.prototype.slice; +var _events2 = _interopRequireDefault(_events); - var eventSplitter = /\s+/; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var eventsApi = function eventsApi(obj, action, name, rest) { - if (!name) { - return true; - } +/** + * @class BaseObject + * @constructor + * @extends Events + * @module base + */ +// Copyright 2014 Globo.com Player authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. - // 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; - } +var BaseObject = function (_Events) { + (0, _inherits3.default)(BaseObject, _Events); + (0, _createClass3.default)(BaseObject, [{ + key: 'options', - // 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; - } + /** + * returns the object options + * @property options + * @type Object + */ + get: function get() { + return this._options; + } - return true; - }; + /** + * @method constructor + * @param {Object} options + */ - 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__) { + function BaseObject() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + (0, _classCallCheck3.default)(this, BaseObject); - 'use strict'; + var _this = (0, _possibleConstructorReturn3.default)(this, _Events.call(this, options)); - module.exports = __webpack_require__(7); + _this._options = options; + _this.uniqueId = (0, _utils.uniqueId)('o'); + return _this; + } + /** + * a unique id prefixed with `'o'`, `o1, o232` + * + * @property uniqueId + * @type String + */ -/***/ }, -/* 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; - }; + return BaseObject; +}(_events2.default); - 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']; +exports.default = BaseObject; +module.exports = exports['default']; -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 18 */ +/***/ (function(module, exports) { - 'use strict'; +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; - Object.defineProperty(exports, "__esModule", { - value: true - }); +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(15) + , core = __webpack_require__(11) + , ctx = __webpack_require__(46) + , hide = __webpack_require__(22) + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , IS_WRAP = type & $export.W + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + , key, own, out; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if(own && key in exports)continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function(C){ + var F = function(a, b, c){ + if(this instanceof C){ + switch(arguments.length){ + case 0: return new C; + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if(IS_PROTO){ + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { - var _kibo = __webpack_require__(9); +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(27)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); - var _kibo2 = _interopRequireDefault(_kibo); +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +"use strict"; - exports.default = { Kibo: _kibo2.default }; - module.exports = exports['default']; -/***/ }, -/* 9 */ -/***/ function(module, exports) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - 'use strict'; +var _classCallCheck2 = __webpack_require__(0); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _possibleConstructorReturn2 = __webpack_require__(1); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _createClass2 = __webpack_require__(3); + +var _createClass3 = _interopRequireDefault(_createClass2); + +var _inherits2 = __webpack_require__(2); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _clapprZepto = __webpack_require__(6); + +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); + +var _utils = __webpack_require__(5); + +var _base_object = __webpack_require__(17); + +var _base_object2 = _interopRequireDefault(_base_object); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var delegateEventSplitter = /^(\S+)\s*(.*)$/; + +/** + * A base class to create ui object. + * @class UIObject + * @constructor + * @extends BaseObject + * @module base + */ +// Copyright 2014 Globo.com Player authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +var UIObject = function (_BaseObject) { + (0, _inherits3.default)(UIObject, _BaseObject); + (0, _createClass3.default)(UIObject, [{ + key: 'tagName', + + /** + * a unique id prefixed with `'c'`, `c1, c232` + * + * @property cid + * @type String + */ + /** + * the dom element itself + * + * @property el + * @type HTMLElement + */ + /** + * the dom element wrapped by `$` + * + * @property $el + * @type HTMLElement + */ + + /** + * gets the tag name for the ui component + * @method tagName + * @default div + * @return {String} tag's name + */ + get: function get() { + return 'div'; + } + /** + * a literal object mapping element's events to methods + * @property events + * @type Object + * @example + * + *```javascript + * + * class MyButton extends UIObject { + * constructor(options) { + * super(options) + * this.myId = 0 + * } + * get events() { return { 'click': 'myClick' } } + * myClick(){ this.myId = 42 } + * } + * + * // when you click on MyButton the method `myClick` will be called + *``` + */ + + }, { + key: 'events', + get: function get() { + return {}; + } + /** + * a literal object mapping attributes and values to the element + * element's attribute name and the value the attribute value + * @property attributes + * @type Object + * @example + * + *```javascript + * + * class MyButton extends UIObject { + * constructor(options) { super(options) } + * get attributes() { return { class: 'my-button'} } + * } + * + * // MyButton.el.className will be 'my-button' + * ``` + */ + + }, { + key: 'attributes', + get: function get() { + return {}; + } + + /** + * it builds an ui component by: + * * creating an id for the component `cid` + * * making sure the element is created `$el` + * * delegating all `events` to the element + * @method constructor + * @param {Object} options the options object + */ + + }]); + + function UIObject(options) { + (0, _classCallCheck3.default)(this, UIObject); + + var _this = (0, _possibleConstructorReturn3.default)(this, _BaseObject.call(this, options)); + + _this.cid = (0, _utils.uniqueId)('c'); + _this._ensureElement(); + _this.delegateEvents(); + return _this; + } + + /** + * selects within the component. + * @method $ + * @param {String} selector a selector to find within the component. + * @return {HTMLElement} an element, if it exists. + * @example + * ```javascript + * fullScreenBarUIComponent.$('.button-full') //will return only `.button-full` within the component + * ``` + */ + + + UIObject.prototype.$ = function $(selector) { + return this.$el.find(selector); + }; + + /** + * render the component, usually attach it to a real existent `element` + * @method render + * @return {UIObject} itself + */ + + + UIObject.prototype.render = function render() { + return this; + }; + + /** + * removes the ui component from DOM + * @method remove + * @return {UIObject} itself + */ + + + UIObject.prototype.remove = function remove() { + this.$el.remove(); + this.stopListening(); + this.undelegateEvents(); + return this; + }; + + /** + * set element to `el` and `$el` + * @method setElement + * @param {HTMLElement} element + * @param {Boolean} delegate whether is delegate or not + * @return {UIObject} itself + */ + + + UIObject.prototype.setElement = function setElement(element, delegate) { + if (this.$el) { + this.undelegateEvents(); + } + this.$el = element instanceof _clapprZepto2.default ? element : (0, _clapprZepto2.default)(element); + this.el = this.$el[0]; + if (delegate !== false) { + this.delegateEvents(); + } + return this; + }; + + /** + * delegates all the original `events` on `element` to its callbacks + * @method delegateEvents + * @param {Object} events + * @return {UIObject} itself + */ + + + UIObject.prototype.delegateEvents = function delegateEvents(events) { + if (!(events || (events = this.events))) { + return this; + } + this.undelegateEvents(); + for (var key in events) { + var method = events[key]; + if (method && method.constructor !== Function) { + method = this[events[key]]; + } + if (!method) { + continue; + } + + var match = key.match(delegateEventSplitter); + var eventName = match[1], + selector = match[2]; + eventName += '.delegateEvents' + this.cid; + if (selector === '') { + this.$el.on(eventName, method.bind(this)); + } else { + this.$el.on(eventName, selector, method.bind(this)); + } + } + return this; + }; + + /** + * undelegats all the `events` + * @method undelegateEvents + * @return {UIObject} itself + */ + + + UIObject.prototype.undelegateEvents = function undelegateEvents() { + this.$el.off('.delegateEvents' + this.cid); + return this; + }; + + /** + * ensures the creation of this ui component + * @method _ensureElement + * @private + */ + + + UIObject.prototype._ensureElement = function _ensureElement() { + if (!this.el) { + var attrs = _clapprZepto2.default.extend({}, this.attributes); + if (this.id) { + attrs.id = this.id; + } + if (this.className) { + attrs['class'] = this.className; + } + var $el = _utils.DomRecycler.create(this.tagName).attr(attrs); + this.setElement($el, false); + } else { + this.setElement(this.el, false); + } + }; + + return UIObject; +}(_base_object2.default); + +exports.default = UIObject; +module.exports = exports['default']; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(16) + , createDesc = __webpack_require__(28); +module.exports = __webpack_require__(20) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { - 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 isObject = __webpack_require__(26); +module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; +}; - var Kibo = function Kibo(element) { - this.element = element || window.document; - this.initialize(); - }; +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { - 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' - }; +"use strict"; - 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, ' '); - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - Kibo.capitalize = function (string) { - return string.toLowerCase().replace(/^./, function (match) { - return match.toUpperCase(); - }); - }; +var _classCallCheck2 = __webpack_require__(0); - Kibo.isString = function (what) { - return Kibo.stringContains(Object.prototype.toString.call(what), 'String'); - }; +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - 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; - }; +var _events = __webpack_require__(4); - 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]; - } - } - }; +var _events2 = _interopRequireDefault(_events); - Kibo.modifiersAndKey = function (keyCombination) { - var result, key; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - if (Kibo.stringContains(keyCombination, 'any')) { - return Kibo.neatString(keyCombination).split(' ').slice(0, 2).join(' '); - } +var events = new _events2.default(); // Copyright 2014 Globo.com Player authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. - result = Kibo.extractModifiers(keyCombination); +/** + * The mediator is a singleton for handling global events. + */ - key = Kibo.extractKey(keyCombination); - if (key && !Kibo.arrayIncludes(Kibo.MODIFIERS, key)) { - result.push(key); - } +var Mediator = function Mediator() { + (0, _classCallCheck3.default)(this, Mediator); +}; - return result.join(' '); - }; +exports.default = Mediator; - Kibo.keyName = function (keyCode) { - return Kibo.KEY_NAMES_BY_CODE[keyCode + '']; - }; - Kibo.keyCode = function (keyName) { - return +Kibo.KEY_CODES_BY_NAME[keyName]; - }; +Mediator.on = function (name, callback, context) { + events.on(name, callback, context); + return; +}; - 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); - }); - }; +Mediator.once = function (name, callback, context) { + events.once(name, callback, context); + return; +}; - 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(); - } - } - } - }; - }; +Mediator.off = function (name, callback, context) { + events.off(name, callback, context); + return; +}; - Kibo.prototype.registerKeys = function (upOrDown, newKeys, func) { - var i, - keys, - registeredKeys = this['keys' + Kibo.capitalize(upOrDown)]; +Mediator.trigger = function (name) { + for (var _len = arguments.length, opts = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + opts[_key - 1] = arguments[_key]; + } - if (Kibo.isString(newKeys)) { - newKeys = [newKeys]; - } + events.trigger.apply(events, [name].concat(opts)); + return; +}; - for (i = 0; i < newKeys.length; i++) { - keys = newKeys[i]; - keys = Kibo.modifiersAndKey(keys + ''); +Mediator.stopListening = function (obj, name, callback) { + events.stopListening(obj, name, callback); + return; +}; +module.exports = exports['default']; - if (registeredKeys[keys]) { - registeredKeys[keys].push(func); - } else { - registeredKeys[keys] = [func]; - } - } +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { - return this; - }; +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(60) + , enumBugKeys = __webpack_require__(45); - // 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; - }; +module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); +}; - Kibo.prototype.off = function (keys) { - return this.unregisterKeys('down', keys, null); - }; +/***/ }), +/* 26 */ +/***/ (function(module, exports) { - Kibo.prototype.delegate = function (upOrDown, keys, func) { - return func !== null || func !== undefined ? this.registerKeys(upOrDown, keys, func) : this.unregisterKeys(upOrDown, keys, func); - }; +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; - Kibo.prototype.down = function (keys, func) { - return this.delegate('down', keys, func); - }; +/***/ }), +/* 27 */ +/***/ (function(module, exports) { - Kibo.prototype.up = function (keys, func) { - return this.delegate('up', keys, func); - }; +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; - Kibo.prototype.lastKey = function (modifier) { - if (!modifier) { - return Kibo.keyName(this.lastKeyCode); - } +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; + +/***/ }), +/* 29 */ +/***/ (function(module, exports) { - return this.lastModifiers[modifier]; - }; +module.exports = {}; - Kibo.prototype.lastModifiersAndKey = function () { - var result, i; +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { - result = []; - for (i = 0; i < Kibo.MODIFIERS.length; i++) { - if (this.lastKey(Kibo.MODIFIERS[i])) { - result.push(Kibo.MODIFIERS[i]); - } - } +"use strict"; - if (!Kibo.arrayIncludes(result, this.lastKey())) { - result.push(this.lastKey()); - } - return result.join(' '); - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - exports.default = Kibo; - module.exports = exports['default']; +var _classCallCheck2 = __webpack_require__(0); -/***/ }, -/* 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; - }; - } +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - /** - * 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); - } +var _possibleConstructorReturn2 = __webpack_require__(1); - /** - * 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'); - } +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - /** - * 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'; - } +var _inherits2 = __webpack_require__(2); - /** - * 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); - } +var _inherits3 = _interopRequireDefault(_inherits2); - /** - * 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; - } +var _utils = __webpack_require__(5); - /** - * 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; - } +var _base_object = __webpack_require__(17); - /** - * 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); - } +var _base_object2 = _interopRequireDefault(_base_object); - module.exports = once; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var CorePlugin = function (_BaseObject) { + (0, _inherits3.default)(CorePlugin, _BaseObject); -/***/ }, -/* 11 */ -/***/ function(module, exports, __webpack_require__) { + function CorePlugin(core) { + (0, _classCallCheck3.default)(this, CorePlugin); - 'use strict'; + var _this = (0, _possibleConstructorReturn3.default)(this, _BaseObject.call(this, core.options)); - module.exports = __webpack_require__(12); + _this.core = core; + _this.enabled = true; + _this.bindEvents(); + return _this; + } -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { + CorePlugin.prototype.bindEvents = function bindEvents() {}; - 'use strict'; + CorePlugin.prototype.enable = function enable() { + if (!this.enabled) { + this.bindEvents(); + this.enabled = true; + } + }; - Object.defineProperty(exports, "__esModule", { - value: true - }); + CorePlugin.prototype.disable = function disable() { + if (this.enabled) { + this.stopListening(); + this.enabled = false; + } + }; - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + CorePlugin.prototype.getExternalInterface = function getExternalInterface() { + return {}; + }; - var _base_object = __webpack_require__(4); + CorePlugin.prototype.destroy = function destroy() { + this.stopListening(); + }; - var _base_object2 = _interopRequireDefault(_base_object); + return CorePlugin; +}(_base_object2.default); - var _core = __webpack_require__(13); +exports.default = CorePlugin; - var _core2 = _interopRequireDefault(_core); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +CorePlugin.extend = function (properties) { + return (0, _utils.extend)(CorePlugin, properties); +}; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +CorePlugin.type = 'core'; +module.exports = exports['default']; - 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; } +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { - 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. +module.exports = { "default": __webpack_require__(89), __esModule: true }; - /** - * 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); +/***/ }), +/* 32 */ +/***/ (function(module, exports) { - _createClass(CoreFactory, [{ - key: 'loader', - get: function get() { - return this.player.loader; - } +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; - /** - * it builds the core factory - * @method constructor - * @param {Player} player the player object - */ +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { - }]); +"use strict"; - function CoreFactory(player) { - _classCallCheck(this, CoreFactory); - var _this = _possibleConstructorReturn(this, _BaseObject.call(this)); +exports.__esModule = true; - _this.player = player; - _this._options = player.options; - return _this; - } +var _iterator = __webpack_require__(95); - /** - * creates a core and its plugins - * @method create - * @return {Core} created core - */ +var _iterator2 = _interopRequireDefault(_iterator); +var _symbol = __webpack_require__(106); - 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; - }; +var _symbol2 = _interopRequireDefault(_symbol); - /** - * given the core plugins (`loader.corePlugins`) it builds each one - * @method addCorePlugins - * @return {Core} the core with all plugins - */ +var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - CoreFactory.prototype.addCorePlugins = function addCorePlugins() { - var _this2 = this; +exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); +} : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); +}; - this.loader.corePlugins.forEach(function (Plugin) { - var plugin = new Plugin(_this2.core); - _this2.core.addPlugin(plugin); - _this2.setupExternalInterface(plugin); - }); - return this.core; - }; +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { - CoreFactory.prototype.setupExternalInterface = function setupExternalInterface(plugin) { - var externalFunctions = plugin.getExternalInterface(); - for (var key in externalFunctions) { - this.player[key] = externalFunctions[key].bind(plugin); - } - }; +"use strict"; - return CoreFactory; - }(_base_object2.default); - exports.default = CoreFactory; - module.exports = exports['default']; +Object.defineProperty(exports, "__esModule", { + value: true +}); -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { +var _classCallCheck2 = __webpack_require__(0); - 'use strict'; +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - module.exports = __webpack_require__(14); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { +// 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. - 'use strict'; +var PlayerInfo = function PlayerInfo() { + (0, _classCallCheck3.default)(this, PlayerInfo); - Object.defineProperty(exports, "__esModule", { - value: true - }); + this.options = {}; + this.playbackPlugins = []; + this.currentSize = { width: 0, height: 0 }; +}; - 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; }; }(); +PlayerInfo._players = {}; - var _utils = __webpack_require__(2); +PlayerInfo.getInstance = function (playerId) { + return PlayerInfo._players[playerId] || (PlayerInfo._players[playerId] = new PlayerInfo()); +}; - var _events = __webpack_require__(5); +exports.default = PlayerInfo; +module.exports = exports["default"]; - var _events2 = _interopRequireDefault(_events); +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { - var _styler = __webpack_require__(15); +"use strict"; - var _styler2 = _interopRequireDefault(_styler); - var _ui_object = __webpack_require__(18); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _ui_object2 = _interopRequireDefault(_ui_object); +var _html5_video = __webpack_require__(152); - var _browser = __webpack_require__(3); +var _html5_video2 = _interopRequireDefault(_html5_video); - var _browser2 = _interopRequireDefault(_browser); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _container_factory = __webpack_require__(20); +exports.default = _html5_video2.default; +module.exports = exports['default']; - var _container_factory2 = _interopRequireDefault(_container_factory); +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { - var _media_control = __webpack_require__(27); +"use strict"; - var _media_control2 = _interopRequireDefault(_media_control); - var _mediator = __webpack_require__(30); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _mediator2 = _interopRequireDefault(_mediator); +var _classCallCheck2 = __webpack_require__(0); - var _player_info = __webpack_require__(45); +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var _player_info2 = _interopRequireDefault(_player_info); +var _possibleConstructorReturn2 = __webpack_require__(1); - var _clapprZepto = __webpack_require__(16); +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - var _clapprZepto2 = _interopRequireDefault(_clapprZepto); +var _inherits2 = __webpack_require__(2); - var _style = __webpack_require__(46); +var _inherits3 = _interopRequireDefault(_inherits2); - var _style2 = _interopRequireDefault(_style); +var _utils = __webpack_require__(5); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _ui_object = __webpack_require__(21); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _ui_object2 = _interopRequireDefault(_ui_object); - 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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - 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 base class for an ui container plugin + * @class UIContainerPlugin + * @constructor + * @extends UIObject + * @module base + */ +// Copyright 2014 Globo.com Player authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. - /** - * 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__) { +var UIContainerPlugin = function (_UIObject) { + (0, _inherits3.default)(UIContainerPlugin, _UIObject); - 'use strict'; + function UIContainerPlugin(container) { + (0, _classCallCheck3.default)(this, UIContainerPlugin); - Object.defineProperty(exports, "__esModule", { - value: true - }); + var _this = (0, _possibleConstructorReturn3.default)(this, _UIObject.call(this, container.options)); - var _clapprZepto = __webpack_require__(16); + _this.container = container; + _this.enabled = true; + _this.bindEvents(); + return _this; + } - var _clapprZepto2 = _interopRequireDefault(_clapprZepto); + UIContainerPlugin.prototype.enable = function enable() { + if (!this.enabled) { + this.bindEvents(); + this.$el.show(); + this.enabled = true; + } + }; - var _template = __webpack_require__(17); + UIContainerPlugin.prototype.disable = function disable() { + this.stopListening(); + this.$el.hide(); + this.enabled = false; + }; - var _template2 = _interopRequireDefault(_template); + UIContainerPlugin.prototype.bindEvents = function bindEvents() {}; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + UIContainerPlugin.prototype.destroy = function destroy() { + this.remove(); + }; - // Copyright 2014 Globo.com Player authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. + return UIContainerPlugin; +}(_ui_object2.default); - var Styler = { - getStyleFor: function getStyleFor(style) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { baseUrl: '' }; +exports.default = UIContainerPlugin; - return (0, _clapprZepto2.default)('').html((0, _template2.default)(style.toString())(options)); - } - }; - exports.default = Styler; - module.exports = exports['default']; +UIContainerPlugin.extend = function (properties) { + return (0, _utils.extend)(UIContainerPlugin, properties); +}; -/***/ }, -/* 16 */ -/***/ function(module, exports) { +UIContainerPlugin.type = 'container'; +module.exports = exports['default']; - /* 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>")),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=/)<[^<]*)*<\/script>/gi,s=/^(?:text|application)\/javascript/i,a=/^(?:text|application)\/xml/i,u="application/json",f="text/html",c=/^\s*$/,l=n.createElement("a");l.href=window.location.href,t.active=0,t.ajaxJSONP=function(i,r){if(!("type"in i))return t.ajax(i);var f,h,o=i.jsonpCallback,s=(t.isFunction(o)?o():o)||"jsonp"+ ++e,a=n.createElement("script"),u=window[s],c=function(e){t(a).triggerHandler("error",e||"abort")},l={abort:c};return r&&r.promise(l),t(a).on("load error",function(e,n){clearTimeout(h),t(a).off().remove(),"error"!=e.type&&f?v(f[0],l,i,r):y(null,n||"error",l,i,r),window[s]=u,f&&t.isFunction(u)&&u(f[0]),u=f=void 0}),g(l,i)===!1?(c("abort"),l):(window[s]=function(){f=arguments},a.src=i.url.replace(/\?(.+)=\?/,"?$1="+s),n.head.appendChild(a),i.timeout>0&&(h=setTimeout(function(){c("timeout")},i.timeout)),l)},t.ajaxSettings={type:"GET",beforeSend:x,success:x,error:x,complete:x,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:u,xml:"application/xml, text/xml",html:f,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},t.ajax=function(e){var a,u,o=t.extend({},e||{}),s=t.Deferred&&t.Deferred();for(i in t.ajaxSettings)void 0===o[i]&&(o[i]=t.ajaxSettings[i]);d(o),o.crossDomain||(a=n.createElement("a"),a.href=o.url,a.href=a.href,o.crossDomain=l.protocol+"//"+l.host!=a.protocol+"//"+a.host),o.url||(o.url=window.location.toString()),(u=o.url.indexOf("#"))>-1&&(o.url=o.url.slice(0,u)),T(o);var f=o.dataType,h=/\?.+=\?/.test(o.url);if(h&&(f="jsonp"),o.cache!==!1&&(e&&e.cache===!0||"script"!=f&&"jsonp"!=f)||(o.url=E(o.url,"_="+Date.now())),"jsonp"==f)return h||(o.url=E(o.url,o.jsonp?o.jsonp+"=?":o.jsonp===!1?"":"callback=?")),t.ajaxJSONP(o,s);var N,p=o.accepts[f],m={},w=function(t,e){m[t.toLowerCase()]=[t,e]},j=/^([\w-]+:)\/\//.test(o.url)?RegExp.$1:window.location.protocol,S=o.xhr(),C=S.setRequestHeader;if(s&&s.promise(S),o.crossDomain||w("X-Requested-With","XMLHttpRequest"),w("Accept",p||"*/*"),(p=o.mimeType||p)&&(p.indexOf(",")>-1&&(p=p.split(",",2)[0]),S.overrideMimeType&&S.overrideMimeType(p)),(o.contentType||o.contentType!==!1&&o.data&&"GET"!=o.type.toUpperCase())&&w("Content-Type",o.contentType||"application/x-www-form-urlencoded"),o.headers)for(r in o.headers)w(r,o.headers[r]);if(S.setRequestHeader=w,S.onreadystatechange=function(){if(4==S.readyState){S.onreadystatechange=x,clearTimeout(N);var e,n=!1;if(S.status>=200&&S.status<300||304==S.status||0==S.status&&"file:"==j){f=f||b(o.mimeType||S.getResponseHeader("content-type")),e=S.responseText;try{"script"==f?(1,eval)(e):"xml"==f?e=S.responseXML:"json"==f&&(e=c.test(e)?null:t.parseJSON(e))}catch(i){n=i}n?y(n,"parsererror",S,o,s):v(e,S,o,s)}else y(S.statusText||null,S.status?"error":"abort",S,o,s)}},g(S,o)===!1)return S.abort(),y(null,"abort",S,o,s),S;if(o.xhrFields)for(r in o.xhrFields)S[r]=o.xhrFields[r];var P="async"in o?o.async:!0;S.open(o.type,o.url,P,o.username,o.password);for(r in m)C.apply(S,m[r]);return o.timeout>0&&(N=setTimeout(function(){S.onreadystatechange=x,S.abort(),y(null,"timeout",S,o,s)},o.timeout)),S.send(o.data?o.data:null),S},t.get=function(){return t.ajax(j.apply(null,arguments))},t.post=function(){var e=j.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=j.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,i){if(!this.length)return this;var a,r=this,s=e.split(/\s/),u=j(e,n,i),f=u.success;return s.length>1&&(u.url=s[0],a=s[1]),u.success=function(e){r.html(a?t("
").html(e.replace(o,"")).find(a):e),f&&f.apply(r,arguments)},t.ajax(u),this};var S=encodeURIComponent;t.param=function(e,n){var i=[];return i.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(S(e)+"="+S(n))},C(i,e,n),i.join("&").replace(/%20/g,"+")}}(Zepto),function(t){t.Callbacks=function(e){e=t.extend({},e);var n,i,r,o,s,a,u=[],f=!e.once&&[],c=function(t){for(n=e.memory&&t,i=!0,a=o||0,o=0,s=u.length,r=!0;u&&s>a;++a)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}r=!1,u&&(f?f.length&&c(f.shift()):n?u.length=0:l.disable())},l={add:function(){if(u){var i=u.length,a=function(n){t.each(n,function(t,n){"function"==typeof n?e.unique&&l.has(n)||u.push(n):n&&n.length&&"string"!=typeof n&&a(n)})};a(arguments),r?s=u.length:n&&(o=i,c(n))}return this},remove:function(){return u&&t.each(arguments,function(e,n){for(var i;(i=t.inArray(n,u,i))>-1;)u.splice(i,1),r&&(s>=i&&--s,a>=i&&--a)}),this},has:function(e){return!(!u||!(e?t.inArray(e,u)>-1:u.length))},empty:function(){return s=u.length=0,this},disable:function(){return u=f=n=void 0,this},disabled:function(){return!u},lock:function(){return f=void 0,n||l.disable(),this},locked:function(){return!f},fireWith:function(t,e){return!u||i&&!f||(e=e||[],e=[t,e.slice?e.slice():e],r?f.push(e):c(e)),this},fire:function(){return l.fireWith(this,arguments)},fired:function(){return!!i}};return l}}(Zepto),function(t){function n(e){var i=[["resolve","done",t.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",t.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",t.Callbacks({memory:1})]],r="pending",o={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return n(function(n){t.each(i,function(i,r){var a=t.isFunction(e[i])&&e[i];s[r[1]](function(){var e=a&&a.apply(this,arguments);if(e&&t.isFunction(e.promise))e.promise().done(n.resolve).fail(n.reject).progress(n.notify);else{var i=this===o?n.promise():this,s=a?[e]:arguments;n[r[0]+"With"](i,s)}})}),e=null}).promise()},promise:function(e){return null!=e?t.extend(e,o):o}},s={};return t.each(i,function(t,e){var n=e[2],a=e[3];o[e[1]]=n.add,a&&n.add(function(){r=a},i[1^t][2].disable,i[2][2].lock),s[e[0]]=function(){return s[e[0]+"With"](this===s?o:this,arguments),this},s[e[0]+"With"]=n.fireWith}),o.promise(s),e&&e.call(s,s),s}var e=Array.prototype.slice;t.when=function(i){var f,c,l,r=e.call(arguments),o=r.length,s=0,a=1!==o||i&&t.isFunction(i.promise)?o:0,u=1===a?i:n(),h=function(t,n,i){return function(r){n[t]=this,i[t]=arguments.length>1?e.call(arguments):r,i===f?u.notifyWith(n,i):--a||u.resolveWith(n,i)}};if(o>1)for(f=new Array(o),c=new Array(o),l=new Array(o);o>s;++s)r[s]&&t.isFunction(r[s].promise)?r[s].promise().done(h(s,l,r)).fail(u.reject).progress(h(s,c,f)):--a;return a||u.resolveWith(l,r),u.promise()},t.Deferred=n}(Zepto),function(t){function u(t,e,n,i){return Math.abs(t-e)>=Math.abs(n-i)?t-e>0?"Left":"Right":n-i>0?"Up":"Down"}function f(){o=null,e.last&&(e.el.trigger("longTap"),e={})}function c(){o&&clearTimeout(o),o=null}function l(){n&&clearTimeout(n),i&&clearTimeout(i),r&&clearTimeout(r),o&&clearTimeout(o),n=i=r=o=null,e={}}function h(t){return("touch"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function p(t,e){return t.type=="pointer"+e||t.type.toLowerCase()=="mspointer"+e}var n,i,r,o,a,e={},s=750;t(document).ready(function(){var d,m,y,w,g=0,v=0;"MSGesture"in window&&(a=new MSGesture,a.target=document.body),t(document).bind("MSGestureEnd",function(t){var n=t.velocityX>1?"Right":t.velocityX<-1?"Left":t.velocityY>1?"Down":t.velocityY<-1?"Up":null;n&&(e.el.trigger("swipe"),e.el.trigger("swipe"+n))}).on("touchstart MSPointerDown pointerdown",function(i){(!(w=p(i,"down"))||h(i))&&(y=w?i:i.touches[0],i.touches&&1===i.touches.length&&e.x2&&(e.x2=void 0,e.y2=void 0),d=Date.now(),m=d-(e.last||d),e.el=t("tagName"in y.target?y.target:y.target.parentNode),n&&clearTimeout(n),e.x1=y.pageX,e.y1=y.pageY,m>0&&250>=m&&(e.isDoubleTap=!0),e.last=d,o=setTimeout(f,s),a&&w&&a.addPointer(i.pointerId))}).on("touchmove MSPointerMove pointermove",function(t){(!(w=p(t,"move"))||h(t))&&(y=w?t:t.touches[0],c(),e.x2=y.pageX,e.y2=y.pageY,g+=Math.abs(e.x1-e.x2),v+=Math.abs(e.y1-e.y2))}).on("touchend MSPointerUp pointerup",function(o){(!(w=p(o,"up"))||h(o))&&(c(),e.x2&&Math.abs(e.x1-e.x2)>30||e.y2&&Math.abs(e.y1-e.y2)>30?r=setTimeout(function(){e.el.trigger("swipe"),e.el.trigger("swipe"+u(e.x1,e.x2,e.y1,e.y2)),e={}},0):"last"in e&&(30>g&&30>v?i=setTimeout(function(){var i=t.Event("tap");i.cancelTouch=l,e.el.trigger(i),e.isDoubleTap?(e.el&&e.el.trigger("doubleTap"),e={}):n=setTimeout(function(){n=null,e.el&&e.el.trigger("singleTap"),e={}},250)},0):e={}),g=v=0)}).on("touchcancel MSPointerCancel pointercancel",l),t(window).on("scroll",l)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(Zepto),function(t){function r(e){return e=t(e),!(!e.width()&&!e.height())&&"none"!==e.css("display")}function f(t,e){t=t.replace(/=#\]/g,'="#"]');var n,i,r=s.exec(t);if(r&&r[2]in o&&(n=o[r[2]],i=r[3],t=r[1],i)){var a=Number(i);i=isNaN(a)?i.replace(/^["']|["']$/g,""):a}return e(t,n,i)}var e=t.zepto,n=e.qsa,i=e.matches,o=t.expr[":"]={visible:function(){return r(this)?this:void 0},hidden:function(){return r(this)?void 0:this},selected:function(){return this.selected?this:void 0},checked:function(){return this.checked?this:void 0},parent:function(){return this.parentNode},first:function(t){return 0===t?this:void 0},last:function(t,e){return t===e.length-1?this:void 0},eq:function(t,e,n){return t===n?this:void 0},contains:function(e,n,i){return t(this).text().indexOf(i)>-1?this:void 0},has:function(t,n,i){return e.qsa(this,i).length?this:void 0}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),a=/^\s*>/,u="Zepto"+ +new Date;e.qsa=function(i,r){return f(r,function(o,s,f){try{var c;!o&&s?o="*":a.test(o)&&(c=t(i).addClass(u),o="."+u+" "+o);var l=n(i,o)}catch(h){throw console.error("error performing selector: %o",r),h}finally{c&&c.removeClass(u)}return s?e.uniq(t.map(l,function(t,e){return s.call(t,e,l,f)})):l})},e.matches=function(t,e){return f(e,function(e,n,r){return!(e&&!i(t,e)||n&&n.call(t,null,r)!==t)})}}(Zepto),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t){try{return e(t)}catch(n){return null}}}}(); - module.exports = Zepto; +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -/***/ }, -/* 17 */ -/***/ function(module, exports) { - - 'use strict'; - - /* eslint-disable no-var */ - // Simple JavaScript Templating - // Paul Miller (http://paulmillr.com) - // http://underscorejs.org - // (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - var settings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g - }; - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - '\'': '\'', - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; +var _classCallCheck2 = __webpack_require__(0); - // List of HTML entities for escaping. - var htmlEntities = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''' - }; +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var entityRe = new RegExp('[&<>"\']', 'g'); +var _possibleConstructorReturn2 = __webpack_require__(1); - var escapeExpr = function escapeExpr(string) { - if (string === null) { - return ''; - } - return ('' + string).replace(entityRe, function (match) { - return htmlEntities[match]; - }); - }; +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - var counter = 0; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - var tmpl = function tmpl(text, data) { - var render; - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = '__p+=\''; - text.replace(matcher, function (match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escaper, function (match) { - return '\\' + escapes[match]; - }); - - if (escape) { - source += '\'+\n((__t=(' + escape + '))==null?\'\':escapeExpr(__t))+\n\''; - } - if (interpolate) { - source += '\'+\n((__t=(' + interpolate + '))==null?\'\':__t)+\n\''; - } - if (evaluate) { - source += '\';\n' + evaluate + '\n__p+=\''; - } - index = offset + match.length; - return match; - }); - source += '\';\n'; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) { - source = 'with(obj||{}){\n' + source + '}\n'; - } - - source = 'var __t,__p=\'\',__j=Array.prototype.join,' + 'print=function(){__p+=__j.call(arguments,\'\');};\n' + source + 'return __p;\n//# sourceURL=/microtemplates/source[' + counter++ + ']'; - - try { - /*jshint -W054 */ - // TODO: find a way to avoid eval - render = new Function(settings.variable || 'obj', 'escapeExpr', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) { - return render(data, escapeExpr); - } - var template = function template(data) { - return render.call(this, data, escapeExpr); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - tmpl.settings = settings; +var _inherits2 = __webpack_require__(2); - module.exports = tmpl; +var _inherits3 = _interopRequireDefault(_inherits2); -/***/ }, -/* 18 */ -/***/ 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 _clapprZepto = __webpack_require__(16); - - var _clapprZepto2 = _interopRequireDefault(_clapprZepto); - - var _lodash = __webpack_require__(19); - - var _lodash2 = _interopRequireDefault(_lodash); - - var _base_object = __webpack_require__(4); - - var _base_object2 = _interopRequireDefault(_base_object); - - 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 delegateEventSplitter = /^(\S+)\s*(.*)$/; - - /** - * A base class to create ui object. - * @class UIObject - * @constructor - * @extends BaseObject - * @module base - */ - - var UIObject = function (_BaseObject) { - _inherits(UIObject, _BaseObject); - - _createClass(UIObject, [{ - key: 'tagName', - - /** - * a unique id prefixed with `'c'`, `c1, c232` - * - * @property cid - * @type String - */ - /** - * the dom element itself - * - * @property el - * @type HTMLElement - */ - /** - * the dom element wrapped by `$` - * - * @property $el - * @type HTMLElement - */ - - /** - * gets the tag name for the ui component - * @method tagName - * @default div - * @return {String} tag's name - */ - get: function get() { - return 'div'; - } - /** - * a literal object mapping element's events to methods - * @property events - * @type Object - * @example - * - *```javascript - * - * class MyButton extends UIObject { - * constructor(options) { - * super(options) - * this.myId = 0 - * } - * get events() { return { 'click': 'myClick' } } - * myClick(){ this.myId = 42 } - * } - * - * // when you click on MyButton the method `myClick` will be called - *``` - */ - - }, { - key: 'events', - get: function get() { - return {}; - } - /** - * a literal object mapping attributes and values to the element - * element's attribute name and the value the attribute value - * @property attributes - * @type Object - * @example - * - *```javascript - * - * class MyButton extends UIObject { - * constructor(options) { super(options) } - * get attributes() { return { class: 'my-button'} } - * } - * - * // MyButton.el.className will be 'my-button' - * ``` - */ - - }, { - key: 'attributes', - get: function get() { - return {}; - } - - /** - * it builds an ui component by: - * * creating an id for the component `cid` - * * making sure the element is created `$el` - * * delegating all `events` to the element - * @method constructor - * @param {Object} options the options object - */ - - }]); - - function UIObject(options) { - _classCallCheck(this, UIObject); - - var _this = _possibleConstructorReturn(this, _BaseObject.call(this, options)); - - _this.cid = (0, _utils.uniqueId)('c'); - _this._ensureElement(); - _this.delegateEvents(); - return _this; - } - - /** - * selects within the component. - * @method $ - * @param {String} selector a selector to find within the component. - * @return {HTMLElement} an element, if it exists. - * @example - * ```javascript - * fullScreenBarUIComponent.$('.button-full') //will return only `.button-full` within the component - * ``` - */ - - - UIObject.prototype.$ = function $(selector) { - return this.$el.find(selector); - }; - - /** - * render the component, usually attach it to a real existent `element` - * @method render - * @return {UIObject} itself - */ - - - UIObject.prototype.render = function render() { - return this; - }; - - /** - * removes the ui component from DOM - * @method remove - * @return {UIObject} itself - */ - - - UIObject.prototype.remove = function remove() { - this.$el.remove(); - this.stopListening(); - this.undelegateEvents(); - return this; - }; - - /** - * set element to `el` and `$el` - * @method setElement - * @param {HTMLElement} element - * @param {Boolean} delegate whether is delegate or not - * @return {UIObject} itself - */ - - - UIObject.prototype.setElement = function setElement(element, delegate) { - if (this.$el) { - this.undelegateEvents(); - } - this.$el = element instanceof _clapprZepto2.default ? element : (0, _clapprZepto2.default)(element); - this.el = this.$el[0]; - if (delegate !== false) { - this.delegateEvents(); - } - return this; - }; - - /** - * delegates all the original `events` on `element` to its callbacks - * @method delegateEvents - * @param {Object} events - * @return {UIObject} itself - */ - - - UIObject.prototype.delegateEvents = function delegateEvents(events) { - if (!(events || (events = (0, _lodash2.default)(this, 'events')))) { - return this; - } - this.undelegateEvents(); - for (var key in events) { - var method = events[key]; - if (method && method.constructor !== Function) { - method = this[events[key]]; - } - if (!method) { - continue; - } - - var match = key.match(delegateEventSplitter); - var eventName = match[1], - selector = match[2]; - //method = _.bind(method, this) - eventName += '.delegateEvents' + this.cid; - if (selector === '') { - this.$el.on(eventName, method.bind(this)); - } else { - this.$el.on(eventName, selector, method.bind(this)); - } - } - return this; - }; - - /** - * undelegats all the `events` - * @method undelegateEvents - * @return {UIObject} itself - */ - - - UIObject.prototype.undelegateEvents = function undelegateEvents() { - this.$el.off('.delegateEvents' + this.cid); - return this; - }; - - /** - * ensures the creation of this ui component - * @method _ensureElement - * @private - */ - - - UIObject.prototype._ensureElement = function _ensureElement() { - if (!this.el) { - var attrs = _clapprZepto2.default.extend({}, (0, _lodash2.default)(this, 'attributes')); - if (this.id) { - attrs.id = (0, _lodash2.default)(this, 'id'); - } - if (this.className) { - attrs['class'] = (0, _lodash2.default)(this, 'className'); - } - var $el = (0, _clapprZepto2.default)('<' + (0, _lodash2.default)(this, 'tagName') + '>').attr(attrs); - this.setElement($el, false); - } else { - this.setElement((0, _lodash2.default)(this, 'el'), false); - } - }; - - return UIObject; - }(_base_object2.default); - - exports.default = UIObject; - module.exports = exports['default']; - -/***/ }, -/* 19 */ -/***/ function(module, exports) { - - /* WEBPACK VAR INJECTION */(function(global) {/** - * 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 to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0; - - /** `Object#toString` result references. */ - var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } +var _base_object = __webpack_require__(17); - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } +var _base_object2 = _interopRequireDefault(_base_object); - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = root['__core-js_shared__']; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Symbol = root.Symbol, - splice = arrayProto.splice; - - /* Built-in method references that are verified to be native. */ - var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } +var _utils = __webpack_require__(5); - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; - } +/** + * The base class for a container plugin + * @class ContainerPlugin + * @constructor + * @extends UIObject + * @module base + */ +var ContainerPlugin = function (_BaseObject) { + (0, _inherits3.default)(ContainerPlugin, _BaseObject); - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } + function ContainerPlugin(container) { + (0, _classCallCheck3.default)(this, ContainerPlugin); - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); - } + var _this = (0, _possibleConstructorReturn3.default)(this, _BaseObject.call(this, container.options)); - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } + _this.container = container; + _this.enabled = true; + _this.bindEvents(); + return _this; + } - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } + ContainerPlugin.prototype.enable = function enable() { + if (!this.enabled) { + this.bindEvents(); + this.enabled = true; + } + }; - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - } + ContainerPlugin.prototype.disable = function disable() { + if (this.enabled) { + this.stopListening(); + this.enabled = false; + } + }; - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; - } + ContainerPlugin.prototype.bindEvents = function bindEvents() {}; - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } + ContainerPlugin.prototype.destroy = function destroy() { + this.stopListening(); + }; - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } + return ContainerPlugin; +}(_base_object2.default); - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } +exports.default = ContainerPlugin; - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } +ContainerPlugin.extend = function (properties) { + return (0, _utils.extend)(ContainerPlugin, properties); +}; - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); - } +ContainerPlugin.type = 'container'; +module.exports = exports['default']; - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } +"use strict"; - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; - } - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } +var _classCallCheck2 = __webpack_require__(0); - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value) { - return isArray(value) ? value : stringToPath(value); - } +var _possibleConstructorReturn2 = __webpack_require__(1); - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } +var _inherits2 = __webpack_require__(2); - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } +var _inherits3 = _interopRequireDefault(_inherits2); - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } +var _utils = __webpack_require__(5); - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } +var _ui_object = __webpack_require__(21); - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoize(function(string) { - string = toString(string); - - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } +var _ui_object2 = _interopRequireDefault(_ui_object); - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } +var UICorePlugin = function (_UIObject) { + (0, _inherits3.default)(UICorePlugin, _UIObject); - // Assign cache to `_.memoize`. - memoize.Cache = MapCache; - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } + function UICorePlugin(core) { + (0, _classCallCheck3.default)(this, UICorePlugin); - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } + var _this = (0, _possibleConstructorReturn3.default)(this, _UIObject.call(this, core.options)); - /** - * 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'); - } + _this.core = core; + _this.enabled = true; + _this.bindEvents(); + _this.render(); + return _this; + } - /** - * 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'; - } + UICorePlugin.prototype.bindEvents = function bindEvents() {}; - /** - * 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); - } + UICorePlugin.prototype.getExternalInterface = function getExternalInterface() { + return {}; + }; - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } + UICorePlugin.prototype.enable = function enable() { + if (!this.enabled) { + this.bindEvents(); + this.$el.show(); + this.enabled = true; + } + }; - /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - path = isKey(path, object) ? [path] : castPath(path); - - var index = -1, - length = path.length; - - // Ensure the loop is entered when path is empty. - if (!length) { - object = undefined; - length = 1; - } - while (++index < length) { - var value = object == null ? undefined : object[toKey(path[index])]; - if (value === undefined) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; - } + UICorePlugin.prototype.disable = function disable() { + this.stopListening(); + this.$el.hide(); + this.enabled = false; + }; - module.exports = result; + UICorePlugin.prototype.destroy = function destroy() { + this.remove(); + }; - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + UICorePlugin.prototype.render = function render() { + return this; + }; -/***/ }, -/* 20 */ -/***/ function(module, exports, __webpack_require__) { + return UICorePlugin; +}(_ui_object2.default); - 'use strict'; +exports.default = UICorePlugin; - module.exports = __webpack_require__(21); -/***/ }, -/* 21 */ -/***/ function(module, exports, __webpack_require__) { +UICorePlugin.extend = function (properties) { + return (0, _utils.extend)(UICorePlugin, properties); +}; - 'use strict'; +UICorePlugin.type = 'core'; +module.exports = exports['default']; - Object.defineProperty(exports, "__esModule", { - value: true - }); +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { - 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; }; }(); +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(40); +module.exports = function(it){ + return Object(defined(it)); +}; - var _base_object = __webpack_require__(4); +/***/ }), +/* 40 */ +/***/ (function(module, exports) { - var _base_object2 = _interopRequireDefault(_base_object); +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; - var _events = __webpack_require__(5); +/***/ }), +/* 41 */ +/***/ (function(module, exports) { - var _events2 = _interopRequireDefault(_events); +var toString = {}.toString; - var _container = __webpack_require__(22); +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; - var _container2 = _interopRequireDefault(_container); +/***/ }), +/* 42 */ +/***/ (function(module, exports) { - var _clapprZepto = __webpack_require__(16); +// 7.1.4 ToInteger +var ceil = Math.ceil + , floor = Math.floor; +module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; - var _clapprZepto2 = _interopRequireDefault(_clapprZepto); +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { - var _lodash = __webpack_require__(26); +var shared = __webpack_require__(44)('keys') + , uid = __webpack_require__(32); +module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); +}; - var _lodash2 = _interopRequireDefault(_lodash); +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var global = __webpack_require__(15) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/***/ }), +/* 45 */ +/***/ (function(module, exports) { - 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; } +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); - 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. +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(94); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(26); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { - /** - * The ContainerFactory is responsible for manage playback bootstrap and create containers. - */ +module.exports = true; - var ContainerFactory = function (_BaseObject) { - _inherits(ContainerFactory, _BaseObject); +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(23) + , dPs = __webpack_require__(99) + , enumBugKeys = __webpack_require__(45) + , IE_PROTO = __webpack_require__(43)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(64)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(100).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { - _createClass(ContainerFactory, [{ - key: 'options', - get: function get() { - return this._options; - }, - set: function set(options) { - this._options = options; - } - }]); +var def = __webpack_require__(16).f + , has = __webpack_require__(18) + , TAG = __webpack_require__(12)('toStringTag'); - function ContainerFactory(options, loader, i18n) { - _classCallCheck(this, ContainerFactory); +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); +}; - var _this = _possibleConstructorReturn(this, _BaseObject.call(this, options)); +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { - _this._i18n = i18n; - _this.loader = loader; - return _this; - } +exports.f = __webpack_require__(12); - ContainerFactory.prototype.createContainers = function createContainers() { - var _this2 = this; +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(15) + , core = __webpack_require__(11) + , LIBRARY = __webpack_require__(48) + , wksExt = __webpack_require__(51) + , defineProperty = __webpack_require__(16).f; +module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); +}; + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { - return _clapprZepto2.default.Deferred(function (promise) { - promise.resolve(_this2.options.sources.map(function (source) { - return _this2.createContainer(source); - })); - }); - }; +exports.f = {}.propertyIsEnumerable; - ContainerFactory.prototype.findPlaybackPlugin = function findPlaybackPlugin(source, mimeType) { - return this.loader.playbackPlugins.filter(function (p) { - return p.canPlay(source, mimeType); - })[0]; - }; +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(53) + , createDesc = __webpack_require__(28) + , toIObject = __webpack_require__(14) + , toPrimitive = __webpack_require__(47) + , has = __webpack_require__(18) + , IE8_DOM_DEFINE = __webpack_require__(63) + , gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(20) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); +}; + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { - ContainerFactory.prototype.createContainer = function createContainer(source) { - var resolvedSource = null, - mimeType = this.options.mimeType; - if ((0, _lodash2.default)(source)) { - resolvedSource = source.source.toString(); - if (source.mimeType) { - mimeType = source.mimeType; - } - } else { - resolvedSource = source.toString(); - } +"use strict"; - if (resolvedSource.match(/^\/\//)) resolvedSource = window.location.protocol + resolvedSource; - var options = _clapprZepto2.default.extend({}, this.options, { - src: resolvedSource, - mimeType: mimeType - }); - var playbackPlugin = this.findPlaybackPlugin(resolvedSource, mimeType); - var playback = new playbackPlugin(options, this._i18n); +Object.defineProperty(exports, "__esModule", { + value: true +}); - options = _clapprZepto2.default.extend({}, options, { playback: playback }); +var _log = __webpack_require__(129); - var container = new _container2.default(options, this._i18n); - var defer = _clapprZepto2.default.Deferred(); - defer.promise(container); - this.addContainerPlugins(container); - this.listenToOnce(container, _events2.default.CONTAINER_READY, function () { - return defer.resolve(container); - }); - return container; - }; +var _log2 = _interopRequireDefault(_log); - ContainerFactory.prototype.addContainerPlugins = function addContainerPlugins(container) { - this.loader.containerPlugins.forEach(function (Plugin) { - container.addPlugin(new Plugin(container)); - }); - }; - - return ContainerFactory; - }(_base_object2.default); - - exports.default = ContainerFactory; - module.exports = exports['default']; - -/***/ }, -/* 22 */ -/***/ function(module, exports, __webpack_require__) { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - 'use strict'; +exports.default = _log2.default; +module.exports = exports['default']; - module.exports = __webpack_require__(23); +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 23 */ -/***/ 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 _events = __webpack_require__(5); - - var _events2 = _interopRequireDefault(_events); - - var _ui_object = __webpack_require__(18); - - var _ui_object2 = _interopRequireDefault(_ui_object); - - var _styler = __webpack_require__(15); - - var _styler2 = _interopRequireDefault(_styler); - - var _style = __webpack_require__(24); - - var _style2 = _interopRequireDefault(_style); - - 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. - - /** - * Container is responsible for the video rendering and state - */ - - /** - * An abstraction to represent a container for a given playback - * TODO: describe its responsabilities - * @class Container - * @constructor - * @extends UIObject - * @module base - */ - var Container = function (_UIObject) { - _inherits(Container, _UIObject); - - _createClass(Container, [{ - key: 'name', - - /** - * container's name - * @method name - * @default Container - * @return {String} container's name - */ - get: function get() { - return 'Container'; - } - }, { - key: 'attributes', - get: function get() { - return { class: 'container', 'data-container': '' }; - } - }, { - key: 'events', - get: function get() { - return { - 'click': 'clicked', - 'dblclick': 'dblClicked', - 'doubleTap': 'dblClicked', - 'contextmenu': 'onContextMenu', - 'mouseenter': 'mouseEnter', - 'mouseleave': 'mouseLeave' - }; - } - - /** - * Determine if the playback has ended. - * @property ended - * @type Boolean - */ - - }, { - key: 'ended', - get: function get() { - return this.playback.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.playback.buffering; - } - - /** - * The internationalization plugin. - * @property i18n - * @type {Strings} - */ - - }, { - key: 'i18n', - get: function get() { - return this._i18n; - } - - /** - * it builds a container - * @method constructor - * @param {Object} options the options object - * @param {Strings} i18n the internationalization component - */ - - }]); - - function Container(options, i18n) { - _classCallCheck(this, Container); - - var _this = _possibleConstructorReturn(this, _UIObject.call(this, options)); - - _this._i18n = i18n; - _this.currentTime = 0; - _this.volume = 100; - _this.playback = options.playback; - _this.settings = _clapprZepto2.default.extend({}, _this.playback.settings); - _this.isReady = false; - _this.mediaControlDisabled = false; - _this.plugins = [_this.playback]; - _this.bindEvents(); - return _this; - } - - /** - * binds playback events to the methods of the container. - * it listens to playback's events and triggers them as container events. - * - * | Playback | - * |----------| - * | progress | - * | timeupdate | - * | ready | - * | buffering | - * | bufferfull | - * | settingsupdate | - * | loadedmetadata | - * | highdefinitionupdate | - * | bitrate | - * | playbackstate | - * | dvr | - * | mediacontrol_disable | - * | mediacontrol_enable | - * | ended | - * | play | - * | pause | - * | error | - * - * ps: the events usually translate from PLABACK_x to CONTAINER_x, you can check all the events at `Event` class. - * - * @method bindEvents - */ - - - Container.prototype.bindEvents = function bindEvents() { - this.listenTo(this.playback, _events2.default.PLAYBACK_PROGRESS, this.progress); - this.listenTo(this.playback, _events2.default.PLAYBACK_TIMEUPDATE, this.timeUpdated); - this.listenTo(this.playback, _events2.default.PLAYBACK_READY, this.ready); - this.listenTo(this.playback, _events2.default.PLAYBACK_BUFFERING, this.onBuffering); - this.listenTo(this.playback, _events2.default.PLAYBACK_BUFFERFULL, this.bufferfull); - this.listenTo(this.playback, _events2.default.PLAYBACK_SETTINGSUPDATE, this.settingsUpdate); - this.listenTo(this.playback, _events2.default.PLAYBACK_LOADEDMETADATA, this.loadedMetadata); - this.listenTo(this.playback, _events2.default.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate); - this.listenTo(this.playback, _events2.default.PLAYBACK_BITRATE, this.updateBitrate); - this.listenTo(this.playback, _events2.default.PLAYBACK_PLAYBACKSTATE, this.playbackStateChanged); - this.listenTo(this.playback, _events2.default.PLAYBACK_DVR, this.playbackDvrStateChanged); - this.listenTo(this.playback, _events2.default.PLAYBACK_MEDIACONTROL_DISABLE, this.disableMediaControl); - this.listenTo(this.playback, _events2.default.PLAYBACK_MEDIACONTROL_ENABLE, this.enableMediaControl); - this.listenTo(this.playback, _events2.default.PLAYBACK_ENDED, this.onEnded); - this.listenTo(this.playback, _events2.default.PLAYBACK_PLAY, this.playing); - this.listenTo(this.playback, _events2.default.PLAYBACK_PAUSE, this.paused); - this.listenTo(this.playback, _events2.default.PLAYBACK_STOP, this.stopped); - this.listenTo(this.playback, _events2.default.PLAYBACK_ERROR, this.error); - }; - - Container.prototype.playbackStateChanged = function playbackStateChanged(state) { - this.trigger(_events2.default.CONTAINER_PLAYBACKSTATE, state); - }; - - Container.prototype.playbackDvrStateChanged = function playbackDvrStateChanged(dvrInUse) { - this.settings = this.playback.settings; - this.dvrInUse = dvrInUse; - this.trigger(_events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, dvrInUse); - }; - - Container.prototype.updateBitrate = function updateBitrate(newBitrate) { - this.trigger(_events2.default.CONTAINER_BITRATE, newBitrate); - }; - - Container.prototype.statsReport = function statsReport(metrics) { - this.trigger(_events2.default.CONTAINER_STATS_REPORT, metrics); - }; - - Container.prototype.getPlaybackType = function getPlaybackType() { - return this.playback.getPlaybackType(); - }; - - /** - * returns `true` if DVR is enable otherwise `false`. - * @method isDvrEnabled - * @return {Boolean} - */ - - - Container.prototype.isDvrEnabled = function isDvrEnabled() { - return !!this.playback.dvrEnabled; - }; - - /** - * returns `true` if DVR is in use otherwise `false`. - * @method isDvrInUse - * @return {Boolean} - */ - - - Container.prototype.isDvrInUse = function isDvrInUse() { - return !!this.dvrInUse; - }; - - /** - * destroys the container - * @method destroy - */ - - - Container.prototype.destroy = function destroy() { - this.trigger(_events2.default.CONTAINER_DESTROYED, this, this.name); - this.stopListening(); - this.plugins.forEach(function (plugin) { - return plugin.destroy(); - }); - this.$el.remove(); - }; - - Container.prototype.setStyle = function setStyle(style) { - this.$el.css(style); - }; - - Container.prototype.animate = function animate(style, duration) { - return this.$el.animate(style, duration).promise(); - }; - - Container.prototype.ready = function ready() { - this.isReady = true; - this.trigger(_events2.default.CONTAINER_READY, this.name); - }; - - Container.prototype.isPlaying = function isPlaying() { - return this.playback.isPlaying(); - }; - - Container.prototype.getStartTimeOffset = function getStartTimeOffset() { - return this.playback.getStartTimeOffset(); - }; - - Container.prototype.getCurrentTime = function getCurrentTime() { - return this.currentTime; - }; - - Container.prototype.getDuration = function getDuration() { - return this.playback.getDuration(); - }; - - Container.prototype.error = function error(errorObj) { - if (!this.isReady) { - this.ready(); - } - this.trigger(_events2.default.CONTAINER_ERROR, { error: errorObj, container: this }, this.name); - }; - - Container.prototype.loadedMetadata = function loadedMetadata(metadata) { - this.trigger(_events2.default.CONTAINER_LOADEDMETADATA, metadata); - }; - - Container.prototype.timeUpdated = function timeUpdated(timeProgress) { - this.currentTime = timeProgress.current; - this.trigger(_events2.default.CONTAINER_TIMEUPDATE, timeProgress, this.name); - }; - - Container.prototype.progress = function progress() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - this.trigger.apply(this, [_events2.default.CONTAINER_PROGRESS].concat(args, [this.name])); - }; - - Container.prototype.playing = function playing() { - this.trigger(_events2.default.CONTAINER_PLAY, this.name); - }; - - Container.prototype.paused = function paused() { - this.trigger(_events2.default.CONTAINER_PAUSE, this.name); - }; - - /** - * plays the playback - * @method play - */ - - - Container.prototype.play = function play() { - this.playback.play(); - }; - - /** - * stops the playback - * @method stop - */ - - - Container.prototype.stop = function stop() { - this.playback.stop(); - this.currentTime = 0; - }; - - /** - * pauses the playback - * @method pause - */ - - - Container.prototype.pause = function pause() { - this.playback.pause(); - }; - - Container.prototype.onEnded = function onEnded() { - this.trigger(_events2.default.CONTAINER_ENDED, this, this.name); - this.currentTime = 0; - }; - - Container.prototype.stopped = function stopped() { - this.trigger(_events2.default.CONTAINER_STOP); - }; - - Container.prototype.clicked = function clicked() { - if (!this.options.chromeless || this.options.allowUserInteraction) { - this.trigger(_events2.default.CONTAINER_CLICK, this, this.name); - } - }; - - Container.prototype.dblClicked = function dblClicked() { - if (!this.options.chromeless || this.options.allowUserInteraction) { - this.trigger(_events2.default.CONTAINER_DBLCLICK, this, this.name); - } - }; - - Container.prototype.onContextMenu = function onContextMenu() { - if (!this.options.chromeless || this.options.allowUserInteraction) { - this.trigger(_events2.default.CONTAINER_CONTEXTMENU, this, this.name); - } - }; - - Container.prototype.seek = function seek(time) { - this.trigger(_events2.default.CONTAINER_SEEK, time, this.name); - this.playback.seek(time); - }; - - Container.prototype.seekPercentage = function seekPercentage(percentage) { - var duration = this.getDuration(); - if (percentage >= 0 && percentage <= 100) { - var time = duration * (percentage / 100); - this.seek(time); - } - }; - - Container.prototype.setVolume = function setVolume(value) { - this.volume = parseInt(value, 10); - this.trigger(_events2.default.CONTAINER_VOLUME, value, this.name); - this.playback.volume(value); - }; - - Container.prototype.fullscreen = function fullscreen() { - this.trigger(_events2.default.CONTAINER_FULLSCREEN, this.name); - }; - - Container.prototype.onBuffering = function onBuffering() { - this.trigger(_events2.default.CONTAINER_STATE_BUFFERING, this.name); - }; - - Container.prototype.bufferfull = function bufferfull() { - this.trigger(_events2.default.CONTAINER_STATE_BUFFERFULL, this.name); - }; - - /** - * adds plugin to the container - * @method addPlugin - * @param {Object} plugin - */ - - - Container.prototype.addPlugin = function addPlugin(plugin) { - this.plugins.push(plugin); - }; - - /** - * checks if a plugin, given its name, exist - * @method hasPlugin - * @param {String} name - * @return {Boolean} - */ - - - Container.prototype.hasPlugin = function hasPlugin(name) { - return !!this.getPlugin(name); - }; - - /** - * get the plugin given its name - * @method getPlugin - * @param {String} name - */ - - - Container.prototype.getPlugin = function getPlugin(name) { - return this.plugins.filter(function (plugin) { - return plugin.name === name; - })[0]; - }; - - Container.prototype.mouseEnter = function mouseEnter() { - if (!this.options.chromeless || this.options.allowUserInteraction) { - this.trigger(_events2.default.CONTAINER_MOUSE_ENTER); - } - }; - - Container.prototype.mouseLeave = function mouseLeave() { - if (!this.options.chromeless || this.options.allowUserInteraction) { - this.trigger(_events2.default.CONTAINER_MOUSE_LEAVE); - } - }; - - Container.prototype.settingsUpdate = function settingsUpdate() { - this.settings = this.playback.settings; - this.trigger(_events2.default.CONTAINER_SETTINGSUPDATE); - }; - - Container.prototype.highDefinitionUpdate = function highDefinitionUpdate(isHD) { - this.trigger(_events2.default.CONTAINER_HIGHDEFINITIONUPDATE, isHD); - }; - - Container.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() { - return this.playback.isHighDefinitionInUse(); - }; - - Container.prototype.disableMediaControl = function disableMediaControl() { - if (!this.mediaControlDisabled) { - this.mediaControlDisabled = true; - this.trigger(_events2.default.CONTAINER_MEDIACONTROL_DISABLE); - } - }; - - Container.prototype.enableMediaControl = function enableMediaControl() { - if (this.mediaControlDisabled) { - this.mediaControlDisabled = false; - this.trigger(_events2.default.CONTAINER_MEDIACONTROL_ENABLE); - } - }; - - Container.prototype.updateStyle = function updateStyle() { - if (!this.options.chromeless || this.options.allowUserInteraction) { - this.$el.removeClass('chromeless'); - } else { - this.$el.addClass('chromeless'); - } - }; - - /** - * enables to configure the container after its creation - * @method configure - * @param {Object} options all the options to change in form of a javascript object - */ - - - Container.prototype.configure = function configure(options) { - this._options = _clapprZepto2.default.extend(this._options, options); - this.updateStyle(); - this.trigger(_events2.default.CONTAINER_OPTIONS_CHANGE); - }; - - Container.prototype.render = function render() { - var s = _styler2.default.getStyleFor(_style2.default); - this.$el.append(s); - this.$el.append(this.playback.render().el); - this.updateStyle(); - return this; - }; - - return Container; - }(_ui_object2.default); - - exports.default = Container; - module.exports = exports['default']; - -/***/ }, -/* 24 */ -/***/ function(module, exports, __webpack_require__) { +"use strict"; - exports = module.exports = __webpack_require__(25)(); - // imports +Object.defineProperty(exports, "__esModule", { + value: true +}); - // module - exports.push([module.id, ".container[data-container] {\n position: absolute;\n background-color: black;\n height: 100%;\n width: 100%; }\n .container[data-container] .chromeless {\n cursor: default; }\n\n[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled {\n cursor: pointer; }\n", ""]); +var _kibo = __webpack_require__(130); - // exports +var _kibo2 = _interopRequireDefault(_kibo); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, -/* 25 */ -/***/ function(module, exports) { - - /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ - // css base code, injected by the css-loader - module.exports = function() { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - var result = []; - for(var i = 0; i < this.length; i++) { - var item = this[i]; - if(item[2]) { - result.push("@media " + item[2] + "{" + item[1] + "}"); - } else { - result.push(item[1]); - } - } - return result.join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; - }; - - -/***/ }, -/* 26 */ -/***/ 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 - */ - - /** `Object#toString` result references. */ - var objectTag = '[object Object]'; - - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } +exports.default = { Kibo: _kibo2.default }; +module.exports = exports['default']; - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } +/***/ }), +/* 57 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports) { - /** Used for built-in method references. */ - var funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Built-in value references. */ - var getPrototype = overArg(Object.getPrototypeOf, Object); - - /** - * 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'; - } +module.exports = "" - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || - objectToString.call(value) != objectTag || isHostObject(value)) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); - } +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { - module.exports = isPlainObject; +"use strict"; -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = __webpack_require__(164); +module.exports = exports['default']; - 'use strict'; +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(18) + , toIObject = __webpack_require__(14) + , arrayIndexOf = __webpack_require__(92)(false) + , IE_PROTO = __webpack_require__(43)('IE_PROTO'); + +module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { - module.exports = __webpack_require__(28); +// 7.1.15 ToLength +var toInteger = __webpack_require__(42) + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(19) + , core = __webpack_require__(11) + , fails = __webpack_require__(27); +module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); +}; + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(process) {'use strict'; +module.exports = !__webpack_require__(20) && !__webpack_require__(27)(function(){ + return Object.defineProperty(__webpack_require__(64)('div'), 'a', {get: function(){ return 7; }}).a != 7; +}); - Object.defineProperty(exports, "__esModule", { - value: true - }); +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { - 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 isObject = __webpack_require__(26) + , document = __webpack_require__(15).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; - var _utils = __webpack_require__(2); +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(97)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(66)(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; +}); - var _vendor = __webpack_require__(8); +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(48) + , $export = __webpack_require__(19) + , redefine = __webpack_require__(67) + , hide = __webpack_require__(22) + , has = __webpack_require__(18) + , Iterators = __webpack_require__(29) + , $iterCreate = __webpack_require__(98) + , setToStringTag = __webpack_require__(50) + , getPrototypeOf = __webpack_require__(101) + , ITERATOR = __webpack_require__(12)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + +var returnThis = function(){ return this; }; + +module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { - var _events = __webpack_require__(5); +module.exports = __webpack_require__(22); - var _events2 = _interopRequireDefault(_events); +/***/ }), +/* 68 */ +/***/ (function(module, exports) { - var _styler = __webpack_require__(15); +exports.f = Object.getOwnPropertySymbols; - var _styler2 = _interopRequireDefault(_styler); +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { - var _ui_object = __webpack_require__(18); +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(60) + , hiddenKeys = __webpack_require__(45).concat('length', 'prototype'); - var _ui_object2 = _interopRequireDefault(_ui_object); +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); +}; - var _browser = __webpack_require__(3); +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { - var _browser2 = _interopRequireDefault(_browser); +module.exports = { "default": __webpack_require__(117), __esModule: true }; - var _mediator = __webpack_require__(30); +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { - var _mediator2 = _interopRequireDefault(_mediator); +module.exports = { "default": __webpack_require__(123), __esModule: true }; - var _template = __webpack_require__(17); +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { - var _template2 = _interopRequireDefault(_template); +"use strict"; - var _playback = __webpack_require__(31); - var _playback2 = _interopRequireDefault(_playback); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _clapprZepto = __webpack_require__(16); +var _core = __webpack_require__(133); - var _clapprZepto2 = _interopRequireDefault(_clapprZepto); +var _core2 = _interopRequireDefault(_core); - var _lodash = __webpack_require__(32); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _lodash2 = _interopRequireDefault(_lodash); +exports.default = _core2.default; +module.exports = exports['default']; - var _mediaControl = __webpack_require__(34); +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { - var _mediaControl2 = _interopRequireDefault(_mediaControl); +"use strict"; - var _mediaControl3 = __webpack_require__(36); - var _mediaControl4 = _interopRequireDefault(_mediaControl3); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _play = __webpack_require__(37); +var _container = __webpack_require__(136); - var _play2 = _interopRequireDefault(_play); +var _container2 = _interopRequireDefault(_container); - var _pause = __webpack_require__(38); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _pause2 = _interopRequireDefault(_pause); +exports.default = _container2.default; +module.exports = exports['default']; - var _stop = __webpack_require__(39); +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { - var _stop2 = _interopRequireDefault(_stop); +"use strict"; - var _volume = __webpack_require__(40); - var _volume2 = _interopRequireDefault(_volume); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _mute = __webpack_require__(41); +var _media_control = __webpack_require__(138); - var _mute2 = _interopRequireDefault(_mute); +var _media_control2 = _interopRequireDefault(_media_control); - var _expand = __webpack_require__(42); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _expand2 = _interopRequireDefault(_expand); +exports.default = _media_control2.default; +module.exports = exports['default']; - var _shrink = __webpack_require__(43); +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { - var _shrink2 = _interopRequireDefault(_shrink); +module.exports = __webpack_require__.p + "a8c874b93b3d848f39a71260c57e3863.cur"; - var _hd = __webpack_require__(44); +/***/ }), +/* 76 */ +/***/ (function(module, exports) { - var _hd2 = _interopRequireDefault(_hd); +module.exports = "" - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +"use strict"; - 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. +Object.defineProperty(exports, "__esModule", { + value: true +}); - /** - * The MediaControl is responsible for displaying the Player controls. - */ +var _loader = __webpack_require__(151); - var MediaControl = function (_UIObject) { - _inherits(MediaControl, _UIObject); +var _loader2 = _interopRequireDefault(_loader); - _createClass(MediaControl, [{ - key: 'name', - get: function get() { - return 'MediaControl'; - } - }, { - key: 'disabled', - get: function get() { - return this.userDisabled || this.container && this.container.getPlaybackType() === _playback2.default.NO_OP; - } - }, { - key: 'attributes', - get: function get() { - return { - 'class': 'media-control', - 'data-media-control': '' - }; - } - }, { - key: 'events', - get: function get() { - return { - 'click [data-play]': 'play', - 'click [data-pause]': 'pause', - 'click [data-playpause]': 'togglePlayPause', - 'click [data-stop]': 'stop', - 'click [data-playstop]': 'togglePlayStop', - 'click [data-fullscreen]': 'toggleFullscreen', - 'click .bar-container[data-seekbar]': 'seek', - 'click .bar-container[data-volume]': 'onVolumeClick', - 'click .drawer-icon[data-volume]': 'toggleMute', - 'mouseenter .drawer-container[data-volume]': 'showVolumeBar', - 'mouseleave .drawer-container[data-volume]': 'hideVolumeBar', - 'mousedown .bar-container[data-volume]': 'startVolumeDrag', - 'mousemove .bar-container[data-volume]': 'mousemoveOnVolumeBar', - 'mousedown .bar-scrubber[data-seekbar]': 'startSeekDrag', - 'mousemove .bar-container[data-seekbar]': 'mousemoveOnSeekBar', - 'mouseleave .bar-container[data-seekbar]': 'mouseleaveOnSeekBar', - 'mouseenter .media-control-layer[data-controls]': 'setUserKeepVisible', - 'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible' - }; - } - }, { - key: 'template', - get: function get() { - return (0, _template2.default)(_mediaControl4.default); - } - }, { - key: 'stylesheet', - get: function get() { - return _styler2.default.getStyleFor(_mediaControl2.default, { baseUrl: this.options.baseUrl }); - } - }, { - key: 'volume', - get: function get() { - return this.container && this.container.isReady ? this.container.volume : this.intendedVolume; - } - }, { - key: 'muted', - get: function get() { - return this.volume === 0; - } - }]); - - function MediaControl(options) { - _classCallCheck(this, MediaControl); - - var _this = _possibleConstructorReturn(this, _UIObject.call(this, options)); - - _this.persistConfig = _this.options.persistConfig; - _this.container = options.container; - _this.currentPositionValue = null; - _this.currentDurationValue = null; - var initialVolume = _this.persistConfig ? _utils.Config.restore('volume') : 100; - _this.setVolume(_this.options.mute ? 0 : initialVolume); - _this.keepVisible = false; - _this.fullScreenOnVideoTagSupported = null; // unknown - _this.addEventListeners(); - _this.settings = { - left: ['play', 'stop', 'pause'], - right: ['volume'], - default: ['position', 'seekbar', 'duration'] - }; - - if (_this.container) { - if (!_clapprZepto2.default.isEmptyObject(_this.container.settings)) { - _this.settings = _clapprZepto2.default.extend({}, _this.container.settings); - } - } else { - _this.settings = {}; - } - - _this.userDisabled = false; - if (_this.container && _this.container.mediaControlDisabled || _this.options.chromeless) { - _this.disable(); - } - _this.stopDragHandler = function (event) { - return _this.stopDrag(event); - }; - _this.updateDragHandler = function (event) { - return _this.updateDrag(event); - }; - (0, _clapprZepto2.default)(document).bind('mouseup', _this.stopDragHandler); - (0, _clapprZepto2.default)(document).bind('mousemove', _this.updateDragHandler); - return _this; - } - - MediaControl.prototype.addEventListeners = function addEventListeners() { - if (this.container) { - _mediator2.default.on(this.options.playerId + ':' + _events2.default.PLAYER_RESIZE, this.playerResize, this); - this.listenTo(this.container, _events2.default.CONTAINER_PLAY, this.changeTogglePlay); - this.listenTo(this.container, _events2.default.CONTAINER_PAUSE, this.changeTogglePlay); - this.listenTo(this.container, _events2.default.CONTAINER_DBLCLICK, this.toggleFullscreen); - this.listenTo(this.container, _events2.default.CONTAINER_TIMEUPDATE, this.onTimeUpdate); - this.listenTo(this.container, _events2.default.CONTAINER_PROGRESS, this.updateProgressBar); - this.listenTo(this.container, _events2.default.CONTAINER_SETTINGSUPDATE, this.settingsUpdate); - this.listenTo(this.container, _events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.settingsUpdate); - this.listenTo(this.container, _events2.default.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate); - this.listenTo(this.container, _events2.default.CONTAINER_MEDIACONTROL_DISABLE, this.disable); - this.listenTo(this.container, _events2.default.CONTAINER_MEDIACONTROL_ENABLE, this.enable); - this.listenTo(this.container, _events2.default.CONTAINER_ENDED, this.ended); - this.listenTo(this.container, _events2.default.CONTAINER_VOLUME, this.onVolumeChanged); - if (this.container.playback.el.nodeName.toLowerCase() === 'video') { - // wait until the metadata has loaded and then check if fullscreen on video tag is supported - this.listenToOnce(this.container, _events2.default.CONTAINER_LOADEDMETADATA, this.onLoadedMetadataOnVideoTag); - } - } - }; - - MediaControl.prototype.disable = function disable() { - this.userDisabled = true; - this.hide(); - this.$el.hide(); - }; - - MediaControl.prototype.enable = function enable() { - if (this.options.chromeless) return; - this.userDisabled = false; - this.show(); - }; - - MediaControl.prototype.play = function play() { - this.container.play(); - }; - - MediaControl.prototype.pause = function pause() { - this.container.pause(); - }; - - MediaControl.prototype.stop = function stop() { - this.container.stop(); - }; - - MediaControl.prototype.onVolumeChanged = function onVolumeChanged() { - this.updateVolumeUI(); - }; - - MediaControl.prototype.onLoadedMetadataOnVideoTag = function onLoadedMetadataOnVideoTag() { - var video = this.container.playback.el; - // video.webkitSupportsFullscreen is deprecated but iOS appears to only use this - // see https://github.com/clappr/clappr/issues/1127 - if (!_utils.Fullscreen.fullscreenEnabled() && video.webkitSupportsFullscreen) { - this.fullScreenOnVideoTagSupported = true; - this.settingsUpdate(); - } - }; - - MediaControl.prototype.updateVolumeUI = function updateVolumeUI() { - if (!this.rendered) { - // this will be called after a render - return; - } - // update volume bar scrubber/fill on bar mode - this.$volumeBarContainer.find('.bar-fill-2').css({}); - var containerWidth = this.$volumeBarContainer.width(); - var barWidth = this.$volumeBarBackground.width(); - var offset = (containerWidth - barWidth) / 2.0; - var pos = barWidth * this.volume / 100.0 + offset; - this.$volumeBarFill.css({ width: this.volume + '%' }); - this.$volumeBarScrubber.css({ left: pos }); - - // update volume bar segments on segmented bar mode - this.$volumeBarContainer.find('.segmented-bar-element').removeClass('fill'); - var item = Math.ceil(this.volume / 10.0); - this.$volumeBarContainer.find('.segmented-bar-element').slice(0, item).addClass('fill'); - this.$volumeIcon.html(''); - this.$volumeIcon.removeClass('muted'); - if (!this.muted) { - this.$volumeIcon.append(_volume2.default); - } else { - this.$volumeIcon.append(_mute2.default); - this.$volumeIcon.addClass('muted'); - } - this.applyButtonStyle(this.$volumeIcon); - }; - - MediaControl.prototype.changeTogglePlay = function changeTogglePlay() { - this.$playPauseToggle.html(''); - this.$playStopToggle.html(''); - if (this.container && this.container.isPlaying()) { - this.$playPauseToggle.append(_pause2.default); - this.$playStopToggle.append(_stop2.default); - this.trigger(_events2.default.MEDIACONTROL_PLAYING); - } else { - this.$playPauseToggle.append(_play2.default); - this.$playStopToggle.append(_play2.default); - this.trigger(_events2.default.MEDIACONTROL_NOTPLAYING); - if (_browser2.default.isMobile) { - this.show(); - } - } - this.applyButtonStyle(this.$playPauseToggle); - this.applyButtonStyle(this.$playStopToggle); - }; - - MediaControl.prototype.mousemoveOnSeekBar = function mousemoveOnSeekBar(event) { - if (this.settings.seekEnabled) { - var offsetX = event.pageX - this.$seekBarContainer.offset().left - this.$seekBarHover.width() / 2; - this.$seekBarHover.css({ left: offsetX }); - } - this.trigger(_events2.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR, event); - }; - - MediaControl.prototype.mouseleaveOnSeekBar = function mouseleaveOnSeekBar(event) { - this.trigger(_events2.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR, event); - }; - - MediaControl.prototype.onVolumeClick = function onVolumeClick(event) { - this.setVolume(this.getVolumeFromUIEvent(event)); - }; - - MediaControl.prototype.mousemoveOnVolumeBar = function mousemoveOnVolumeBar(event) { - if (this.draggingVolumeBar) { - this.setVolume(this.getVolumeFromUIEvent(event)); - } - }; - - MediaControl.prototype.playerResize = function playerResize(size) { - this.$fullscreenToggle.html(''); - if (_utils.Fullscreen.isFullscreen()) { - this.$fullscreenToggle.append(_shrink2.default); - } else { - this.$fullscreenToggle.append(_expand2.default); - } - this.applyButtonStyle(this.$fullscreenToggle); - this.$el.removeClass('w320'); - if (size.width <= 320 || this.options.hideVolumeBar) { - this.$el.addClass('w320'); - } - }; - - MediaControl.prototype.togglePlayPause = function togglePlayPause() { - if (this.container.isPlaying()) { - this.container.pause(); - } else { - this.container.play(); - } - return false; - }; - - MediaControl.prototype.togglePlayStop = function togglePlayStop() { - if (this.container.isPlaying()) { - this.container.stop(); - } else { - this.container.play(); - } - }; - - MediaControl.prototype.startSeekDrag = function startSeekDrag(event) { - if (!this.settings.seekEnabled) return; - this.draggingSeekBar = true; - this.$el.addClass('dragging'); - this.$seekBarLoaded.addClass('media-control-notransition'); - this.$seekBarPosition.addClass('media-control-notransition'); - this.$seekBarScrubber.addClass('media-control-notransition'); - if (event) { - event.preventDefault(); - } - }; - - MediaControl.prototype.startVolumeDrag = function startVolumeDrag(event) { - this.draggingVolumeBar = true; - this.$el.addClass('dragging'); - if (event) { - event.preventDefault(); - } - }; - - MediaControl.prototype.stopDrag = function stopDrag(event) { - if (this.draggingSeekBar) { - this.seek(event); - } - this.$el.removeClass('dragging'); - this.$seekBarLoaded.removeClass('media-control-notransition'); - this.$seekBarPosition.removeClass('media-control-notransition'); - this.$seekBarScrubber.removeClass('media-control-notransition dragging'); - this.draggingSeekBar = false; - this.draggingVolumeBar = false; - }; - - MediaControl.prototype.updateDrag = function updateDrag(event) { - if (this.draggingSeekBar) { - event.preventDefault(); - var offsetX = event.pageX - this.$seekBarContainer.offset().left; - var pos = offsetX / this.$seekBarContainer.width() * 100; - pos = Math.min(100, Math.max(pos, 0)); - this.setSeekPercentage(pos); - } else if (this.draggingVolumeBar) { - event.preventDefault(); - this.setVolume(this.getVolumeFromUIEvent(event)); - } - }; - - MediaControl.prototype.getVolumeFromUIEvent = function getVolumeFromUIEvent(event) { - var offsetY = event.pageX - this.$volumeBarContainer.offset().left; - var volumeFromUI = offsetY / this.$volumeBarContainer.width() * 100; - return volumeFromUI; - }; - - MediaControl.prototype.toggleMute = function toggleMute() { - this.setVolume(this.muted ? 100 : 0); - }; - - MediaControl.prototype.setVolume = function setVolume(value) { - var _this2 = this; - - value = Math.min(100, Math.max(value, 0)); - // this will hold the intended volume - // it may not actually get set to this straight away - // if the container is not ready etc - this.intendedVolume = value; - this.persistConfig && _utils.Config.persist('volume', value); - var setWhenContainerReady = function setWhenContainerReady() { - if (_this2.container.isReady) { - _this2.container.setVolume(value); - } else { - _this2.listenToOnce(_this2.container, _events2.default.CONTAINER_READY, function () { - _this2.container.setVolume(value); - }); - } - }; - - if (!this.container) { - this.listenToOnce(this, _events2.default.MEDIACONTROL_CONTAINERCHANGED, function () { - setWhenContainerReady(); - }); - } else { - setWhenContainerReady(); - } - }; - - MediaControl.prototype.toggleFullscreen = function toggleFullscreen() { - this.trigger(_events2.default.MEDIACONTROL_FULLSCREEN, this.name); - this.container.fullscreen(); - this.resetUserKeepVisible(); - }; - - MediaControl.prototype.setContainer = function setContainer(container) { - if (this.container) { - this.stopListening(this.container); - this.fullScreenOnVideoTagSupported = null; - } - _mediator2.default.off(this.options.playerId + ':' + _events2.default.PLAYER_RESIZE, this.playerResize, this); - this.container = container; - // set the new container to match the volume of the last one - this.setVolume(this.intendedVolume); - this.changeTogglePlay(); - this.addEventListeners(); - this.settingsUpdate(); - this.container.trigger(_events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.container.isDvrInUse()); - if (this.container.mediaControlDisabled) { - this.disable(); - } - this.trigger(_events2.default.MEDIACONTROL_CONTAINERCHANGED); - }; - - MediaControl.prototype.showVolumeBar = function showVolumeBar() { - if (this.hideVolumeId) { - clearTimeout(this.hideVolumeId); - } - this.$volumeBarContainer.removeClass('volume-bar-hide'); - }; - - MediaControl.prototype.hideVolumeBar = function hideVolumeBar() { - var _this3 = this; - - var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 400; - - if (!this.$volumeBarContainer) return; - if (this.draggingVolumeBar) { - this.hideVolumeId = setTimeout(function () { - return _this3.hideVolumeBar(); - }, timeout); - } else { - if (this.hideVolumeId) { - clearTimeout(this.hideVolumeId); - } - this.hideVolumeId = setTimeout(function () { - return _this3.$volumeBarContainer.addClass('volume-bar-hide'); - }, timeout); - } - }; - - MediaControl.prototype.ended = function ended() { - this.changeTogglePlay(); - }; - - MediaControl.prototype.updateProgressBar = function updateProgressBar(progress) { - var loadedStart = progress.start / progress.total * 100; - var loadedEnd = progress.current / progress.total * 100; - this.$seekBarLoaded.css({ left: loadedStart + '%', width: loadedEnd - loadedStart + '%' }); - }; - - MediaControl.prototype.onTimeUpdate = function onTimeUpdate(timeProgress) { - if (this.draggingSeekBar) return; - // TODO why should current time ever be negative? - var position = timeProgress.current < 0 ? timeProgress.total : timeProgress.current; - - this.currentPositionValue = position; - this.currentDurationValue = timeProgress.total; - this.renderSeekBar(); - }; - - MediaControl.prototype.renderSeekBar = function renderSeekBar() { - if (this.currentPositionValue === null || this.currentDurationValue === null) { - // this will be triggered as soon as these beocome available - return; - } - - // default to 100% - this.currentSeekBarPercentage = 100; - if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrInUse()) { - this.currentSeekBarPercentage = this.currentPositionValue / this.currentDurationValue * 100; - } - this.setSeekPercentage(this.currentSeekBarPercentage); - - var newPosition = (0, _utils.formatTime)(this.currentPositionValue); - var newDuration = (0, _utils.formatTime)(this.currentDurationValue); - if (newPosition !== this.displayedPosition) { - this.$position.text(newPosition); - this.displayedPosition = newPosition; - } - if (newDuration !== this.displayedDuration) { - this.$duration.text(newDuration); - this.displayedDuration = newDuration; - } - }; - - MediaControl.prototype.seek = function seek(event) { - if (!this.settings.seekEnabled) return; - var offsetX = event.pageX - this.$seekBarContainer.offset().left; - var pos = offsetX / this.$seekBarContainer.width() * 100; - pos = Math.min(100, Math.max(pos, 0)); - this.container.seekPercentage(pos); - this.setSeekPercentage(pos); - return false; - }; - - MediaControl.prototype.setKeepVisible = function setKeepVisible() { - this.keepVisible = true; - }; - - MediaControl.prototype.resetKeepVisible = function resetKeepVisible() { - this.keepVisible = false; - }; - - MediaControl.prototype.setUserKeepVisible = function setUserKeepVisible() { - this.userKeepVisible = true; - }; - - MediaControl.prototype.resetUserKeepVisible = function resetUserKeepVisible() { - this.userKeepVisible = false; - }; - - MediaControl.prototype.isVisible = function isVisible() { - return !this.$el.hasClass('media-control-hide'); - }; - - MediaControl.prototype.show = function show(event) { - var _this4 = this; - - if (this.disabled) { - return; - } - var timeout = 2000; - if (!event || event.clientX !== this.lastMouseX && event.clientY !== this.lastMouseY || navigator.userAgent.match(/firefox/i)) { - clearTimeout(this.hideId); - this.$el.show(); - this.trigger(_events2.default.MEDIACONTROL_SHOW, this.name); - this.$el.removeClass('media-control-hide'); - this.hideId = setTimeout(function () { - return _this4.hide(); - }, timeout); - if (event) { - this.lastMouseX = event.clientX; - this.lastMouseY = event.clientY; - } - } - }; - - MediaControl.prototype.hide = function hide() { - var _this5 = this; - - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - - if (!this.isVisible() || _browser2.default.isMobile && !this.container.isPlaying()) { - return; - } - var timeout = delay || 2000; - clearTimeout(this.hideId); - if (!this.disabled && this.options.hideMediaControl === false) { - return; - } - if (!this.disabled && (delay || this.userKeepVisible || this.keepVisible || this.draggingSeekBar || this.draggingVolumeBar)) { - this.hideId = setTimeout(function () { - return _this5.hide(); - }, timeout); - } else { - this.trigger(_events2.default.MEDIACONTROL_HIDE, this.name); - this.$el.addClass('media-control-hide'); - this.hideVolumeBar(0); - } - }; - - MediaControl.prototype.settingsUpdate = function settingsUpdate() { - var newSettings = this.getSettings(); - if (newSettings && !this.fullScreenOnVideoTagSupported && !_utils.Fullscreen.fullscreenEnabled()) { - // remove fullscreen from settings if it is present - newSettings.default && (0, _utils.removeArrayItem)(newSettings.default, 'fullscreen'); - newSettings.left && (0, _utils.removeArrayItem)(newSettings.left, 'fullscreen'); - newSettings.right && (0, _utils.removeArrayItem)(newSettings.right, 'fullscreen'); - } - var settingsChanged = JSON.stringify(this.settings) !== JSON.stringify(newSettings); - if (settingsChanged) { - this.settings = newSettings; - this.render(); - } - }; - - MediaControl.prototype.getSettings = function getSettings() { - return (0, _lodash2.default)({}, this.container.settings); - }; - - MediaControl.prototype.highDefinitionUpdate = function highDefinitionUpdate(isHD) { - var method = isHD ? 'addClass' : 'removeClass'; - this.$hdIndicator[method]('enabled'); - }; - - MediaControl.prototype.createCachedElements = function createCachedElements() { - var $layer = this.$el.find('.media-control-layer'); - this.$duration = $layer.find('.media-control-indicator[data-duration]'); - this.$fullscreenToggle = $layer.find('button.media-control-button[data-fullscreen]'); - this.$playPauseToggle = $layer.find('button.media-control-button[data-playpause]'); - this.$playStopToggle = $layer.find('button.media-control-button[data-playstop]'); - this.$position = $layer.find('.media-control-indicator[data-position]'); - this.$seekBarContainer = $layer.find('.bar-container[data-seekbar]'); - this.$seekBarHover = $layer.find('.bar-hover[data-seekbar]'); - this.$seekBarLoaded = $layer.find('.bar-fill-1[data-seekbar]'); - this.$seekBarPosition = $layer.find('.bar-fill-2[data-seekbar]'); - this.$seekBarScrubber = $layer.find('.bar-scrubber[data-seekbar]'); - this.$volumeBarContainer = $layer.find('.bar-container[data-volume]'); - this.$volumeContainer = $layer.find('.drawer-container[data-volume]'); - this.$volumeIcon = $layer.find('.drawer-icon[data-volume]'); - this.$volumeBarBackground = this.$el.find('.bar-background[data-volume]'); - this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]'); - this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]'); - this.$hdIndicator = this.$el.find('button.media-control-button[data-hd-indicator]'); - this.resetIndicators(); - this.initializeIcons(); - }; - - MediaControl.prototype.resetIndicators = function resetIndicators() { - this.displayedPosition = this.$position.text(); - this.displayedDuration = this.$duration.text(); - }; - - MediaControl.prototype.initializeIcons = function initializeIcons() { - var $layer = this.$el.find('.media-control-layer'); - $layer.find('button.media-control-button[data-play]').append(_play2.default); - $layer.find('button.media-control-button[data-pause]').append(_pause2.default); - $layer.find('button.media-control-button[data-stop]').append(_stop2.default); - this.$playPauseToggle.append(_play2.default); - this.$playStopToggle.append(_play2.default); - this.$volumeIcon.append(_volume2.default); - this.$fullscreenToggle.append(_expand2.default); - this.$hdIndicator.append(_hd2.default); - }; - - MediaControl.prototype.setSeekPercentage = function setSeekPercentage(value) { - value = Math.max(Math.min(value, 100.0), 0); - if (this.displayedSeekBarPercentage === value) { - // not changed since last update - return; - } - this.displayedSeekBarPercentage = value; - - this.$seekBarPosition.removeClass('media-control-notransition'); - this.$seekBarScrubber.removeClass('media-control-notransition'); - this.$seekBarPosition.css({ width: value + '%' }); - this.$seekBarScrubber.css({ left: value + '%' }); - }; - - MediaControl.prototype.seekRelative = function seekRelative(delta) { - if (!this.settings.seekEnabled) return; - var currentTime = this.container.getCurrentTime(); - var duration = this.container.getDuration(); - var position = Math.min(Math.max(currentTime + delta, 0), duration); - position = Math.min(position * 100 / duration, 100); - this.container.seekPercentage(position); - }; - - MediaControl.prototype.bindKeyEvents = function bindKeyEvents() { - var _this6 = this; - - this.unbindKeyEvents(); - this.kibo = new _vendor.Kibo(this.options.focusElement); - this.kibo.down(['space'], function () { - return _this6.togglePlayPause(); - }); - this.kibo.down(['left'], function () { - return _this6.seekRelative(-15); - }); - this.kibo.down(['right'], function () { - return _this6.seekRelative(15); - }); - var keys = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; - keys.forEach(function (i) { - _this6.kibo.down(i.toString(), function () { - return _this6.settings.seekEnabled && _this6.container.seekPercentage(i * 10); - }); - }); - }; - - MediaControl.prototype.unbindKeyEvents = function unbindKeyEvents() { - if (this.kibo) { - this.kibo.off('space'); - this.kibo.off('left'); - this.kibo.off('right'); - this.kibo.off([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]); - } - }; - - MediaControl.prototype.parseColors = function parseColors() { - if (this.options.mediacontrol) { - this.buttonsColor = this.options.mediacontrol.buttons; - var seekbarColor = this.options.mediacontrol.seekbar; - this.$el.find('.bar-fill-2[data-seekbar]').css('background-color', seekbarColor); - this.$el.find('.media-control-icon svg path').css('fill', this.buttonsColor); - this.$el.find('.segmented-bar-element[data-volume]').css('boxShadow', 'inset 2px 0 0 ' + this.buttonsColor); - } - }; - - MediaControl.prototype.applyButtonStyle = function applyButtonStyle(element) { - if (this.buttonsColor && element) { - (0, _clapprZepto2.default)(element).find('svg path').css('fill', this.buttonsColor); - } - }; - - MediaControl.prototype.destroy = function destroy() { - this.remove(); - (0, _clapprZepto2.default)(document).unbind('mouseup', this.stopDragHandler); - (0, _clapprZepto2.default)(document).unbind('mousemove', this.updateDragHandler); - this.unbindKeyEvents(); - }; - - MediaControl.prototype.render = function render() { - var _this7 = this; - - var timeout = 1000; - this.$el.html(this.template({ settings: this.settings })); - this.$el.append(this.stylesheet); - this.createCachedElements(); - this.$playPauseToggle.addClass('paused'); - this.$playStopToggle.addClass('stopped'); - - this.changeTogglePlay(); - this.hideId = setTimeout(function () { - return _this7.hide(); - }, timeout); - if (this.disabled) { - this.hide(); - } - - if (_browser2.default.isSafari && _browser2.default.isMobile) { - this.$volumeContainer.css('display', 'none'); - } - - this.$seekBarPosition.addClass('media-control-notransition'); - this.$seekBarScrubber.addClass('media-control-notransition'); - - var previousSeekPercentage = 0; - if (this.displayedSeekBarPercentage) { - previousSeekPercentage = this.displayedSeekBarPercentage; - } - this.displayedSeekBarPercentage = null; - this.setSeekPercentage(previousSeekPercentage); - - process.nextTick(function () { - if (!_this7.settings.seekEnabled) { - _this7.$seekBarContainer.addClass('seek-disabled'); - } - if (!_this7.options.disableKeyboardShortcuts) { - _this7.bindKeyEvents(); - } - _this7.playerResize({ width: _this7.options.width, height: _this7.options.height }); - _this7.hideVolumeBar(0); - }); - - this.parseColors(); - this.highDefinitionUpdate(); - - this.rendered = true; - this.updateVolumeUI(); - this.trigger(_events2.default.MEDIACONTROL_RENDERED); - return this; - }; - - return MediaControl; - }(_ui_object2.default); - - exports.default = MediaControl; - - - MediaControl.extend = function (properties) { - return (0, _utils.extend)(MediaControl, properties); - }; - module.exports = exports['default']; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(29))) +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, -/* 29 */ -/***/ function(module, exports) { +exports.default = _loader2.default; +module.exports = exports['default']; - // shim for using process in browser - var process = module.exports = {}; +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { - // cached from whatever global is present so that test runners that stub it - // don't break things. But we need to wrap it in a try catch in case it is - // wrapped in strict mode code which doesn't define any globals. It's inside a - // function because try/catches deoptimize in certain engines. +module.exports = { "default": __webpack_require__(153), __esModule: true }; - var cachedSetTimeout; - var cachedClearTimeout; +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); - } - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - } ()) - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } +"use strict"; - } - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } +exports.__esModule = true; +var _from = __webpack_require__(78); +var _from2 = _interopRequireDefault(_from); - } - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); - } +exports.default = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } - }; + return arr2; + } else { + return (0, _from2.default)(arr); + } +}; - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { - process.cwd = function () { return '/' }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function() { return 0; }; +"use strict"; -/***/ }, -/* 30 */ -/***/ function(module, exports, __webpack_require__) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - 'use strict'; +var _flash = __webpack_require__(163); - Object.defineProperty(exports, "__esModule", { - value: true - }); +var _flash2 = _interopRequireDefault(_flash); - var _events = __webpack_require__(5); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _events2 = _interopRequireDefault(_events); +exports.default = _flash2.default; +module.exports = exports['default']; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // Copyright 2014 Globo.com Player authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. +"use strict"; - /** - * The mediator is a singleton for handling global events. - */ - var events = new _events2.default(); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var Mediator = function Mediator() { - _classCallCheck(this, Mediator); - }; +var _html5_audio = __webpack_require__(168); - exports.default = Mediator; +var _html5_audio2 = _interopRequireDefault(_html5_audio); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Mediator.on = function (name, callback, context) { - events.on(name, callback, context); - return; - }; +exports.default = _html5_audio2.default; +module.exports = exports['default']; - Mediator.once = function (name, callback, context) { - events.once(name, callback, context); - return; - }; +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { - Mediator.off = function (name, callback, context) { - events.off(name, callback, context); - return; - }; +"use strict"; - Mediator.trigger = function (name) { - for (var _len = arguments.length, opts = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - opts[_key - 1] = arguments[_key]; - } - events.trigger.apply(events, [name].concat(opts)); - return; - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - Mediator.stopListening = function (obj, name, callback) { - events.stopListening(obj, name, callback); - return; - }; - module.exports = exports['default']; +var _flashls = __webpack_require__(169); -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { +var _flashls2 = _interopRequireDefault(_flashls); - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +exports.default = _flashls2.default; +module.exports = exports['default']; - var _utils = __webpack_require__(2); +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { - var _ui_object = __webpack_require__(18); +"use strict"; - var _ui_object2 = _interopRequireDefault(_ui_object); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +Object.defineProperty(exports, "__esModule", { + value: true +}); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _hls = __webpack_require__(172); - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var _hls2 = _interopRequireDefault(_hls); - 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; } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * An abstraction to represent a generic playback, it's like an interface to be implemented by subclasses. - * @class Playback - * @constructor - * @extends UIObject - * @module base - */ - var Playback = function (_UIObject) { - _inherits(Playback, _UIObject); +exports.default = _hls2.default; +module.exports = exports['default']; - _createClass(Playback, [{ - key: 'isAudioOnly', +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Determine if the playback does not contain video/has video but video should be ignored. - * @property isAudioOnly - * @type Boolean - */ - get: function get() { - return false; - } +"use strict"; - /** - * Determine if the playback has ended. - * @property ended - * @type Boolean - */ - }, { - key: 'ended', - get: function get() { - return false; - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - /** - * The internationalization plugin. - * @property i18n - * @type {Strings} - */ +var _html_img = __webpack_require__(174); - }, { - key: 'i18n', - get: function get() { - return this._i18n; - } +var _html_img2 = _interopRequireDefault(_html_img); - /** - * 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 - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - }, { - key: 'buffering', - get: function get() { - return false; - } +exports.default = _html_img2.default; +module.exports = exports['default']; - /** - * @method constructor - * @param {Object} options the options object - * @param {Strings} i18n the internationalization component - */ +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { - }]); +"use strict"; - function Playback(options, i18n) { - _classCallCheck(this, Playback); - var _this = _possibleConstructorReturn(this, _UIObject.call(this, options)); +Object.defineProperty(exports, "__esModule", { + value: true +}); - _this.settings = {}; - _this._i18n = i18n; - return _this; - } +var _no_op = __webpack_require__(176); - /** - * plays the playback. - * @method play - */ +var _no_op2 = _interopRequireDefault(_no_op); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Playback.prototype.play = function play() {}; +exports.default = _no_op2.default; +module.exports = exports['default']; - /** - * pauses the playback. - * @method pause - */ +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; - Playback.prototype.pause = function pause() {}; - - /** - * stops the playback. - * @method stop - */ - - - Playback.prototype.stop = function stop() {}; - - /** - * seeks the playback to a given `time` in seconds - * @method seek - * @param {Number} time should be a number between 0 and the video duration - */ +Object.defineProperty(exports, "__esModule", { + value: true +}); - Playback.prototype.seek = function seek(time) {}; // eslint-disable-line no-unused-vars +var _poster = __webpack_require__(189); - /** - * seeks the playback to a given `percentage` in percentage - * @method seekPercentage - * @param {Number} time should be a number between 0 and 100 - */ +var _poster2 = _interopRequireDefault(_poster); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Playback.prototype.seekPercentage = function seekPercentage(percentage) {}; // eslint-disable-line no-unused-vars +exports.default = _poster2.default; +module.exports = exports['default']; +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * 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. - */ +"use strict"; - Playback.prototype.getStartTimeOffset = function getStartTimeOffset() { - return 0; - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - /** - * gets the duration in seconds - * @method getDuration - * @return {Number} duration (in seconds) of the current source - */ +var _player = __webpack_require__(88); +var _player2 = _interopRequireDefault(_player); - Playback.prototype.getDuration = function getDuration() { - return 0; - }; +var _utils = __webpack_require__(5); - /** - * checks if the playback is playing. - * @method isPlaying - * @return {Boolean} `true` if the current playback is playing, otherwise `false` - */ +var _utils2 = _interopRequireDefault(_utils); +var _events = __webpack_require__(4); - Playback.prototype.isPlaying = function isPlaying() { - return false; - }; +var _events2 = _interopRequireDefault(_events); - /** - * checks if the playback is ready. - * @property isReady - * @type {Boolean} `true` if the current playback is ready, otherwise `false` - */ +var _playback = __webpack_require__(9); +var _playback2 = _interopRequireDefault(_playback); - /** - * gets the playback type (`'vod', 'live', 'aod'`) - * @method getPlaybackType - * @return {String} you should write the playback type otherwise it'll assume `'no_op'` - * @example - * ```javascript - * html5VideoPlayback.getPlaybackType() //vod - * html5AudioPlayback.getPlaybackType() //aod - * html5VideoPlayback.getPlaybackType() //live - * flashHlsPlayback.getPlaybackType() //live - * ``` - */ - Playback.prototype.getPlaybackType = function getPlaybackType() { - return Playback.NO_OP; - }; +var _container_plugin = __webpack_require__(37); - /** - * checks if the playback is in HD. - * @method isHighDefinitionInUse - * @return {Boolean} `true` if the playback is playing in HD, otherwise `false` - */ +var _container_plugin2 = _interopRequireDefault(_container_plugin); +var _core_plugin = __webpack_require__(30); - Playback.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() { - return false; - }; +var _core_plugin2 = _interopRequireDefault(_core_plugin); - /** - * sets the volume for the playback - * @method volume - * @param {Number} value a number between 0 (`muted`) to 100 (`max`) - */ +var _ui_core_plugin = __webpack_require__(38); +var _ui_core_plugin2 = _interopRequireDefault(_ui_core_plugin); - Playback.prototype.volume = function volume(value) {}; // eslint-disable-line no-unused-vars +var _ui_container_plugin = __webpack_require__(36); - /** - * destroys the playback, removing it from DOM - * @method destroy - */ +var _ui_container_plugin2 = _interopRequireDefault(_ui_container_plugin); +var _base_object = __webpack_require__(17); - Playback.prototype.destroy = function destroy() { - this.$el.remove(); - }; +var _base_object2 = _interopRequireDefault(_base_object); - _createClass(Playback, [{ - key: 'isReady', - get: function get() { - return false; - } - }]); +var _ui_object = __webpack_require__(21); - return Playback; - }(_ui_object2.default); +var _ui_object2 = _interopRequireDefault(_ui_object); - exports.default = Playback; +var _browser = __webpack_require__(13); +var _browser2 = _interopRequireDefault(_browser); - Playback.extend = function (properties) { - return (0, _utils.extend)(Playback, properties); - }; +var _container = __webpack_require__(73); - /** - * checks if the playback can play a given `source` - * If a mimeType is provided then this will be used instead of inferring the mimetype - * from the source extension. - * @method canPlay - * @static - * @param {String} source the given source ex: `http://example.com/play.mp4` - * @param {String} [mimeType] the given mime type, ex: `'application/vnd.apple.mpegurl'` - * @return {Boolean} `true` if the playback is playable, otherwise `false` - */ - Playback.canPlay = function (source, mimeType) { - // eslint-disable-line no-unused-vars - return false; - }; +var _container2 = _interopRequireDefault(_container); - /** - * a playback type for video on demand - * - * @property VOD - * @static - * @type String - */ - Playback.VOD = 'vod'; - /** - * a playback type for audio on demand - * - * @property AOD - * @static - * @type String - */ - Playback.AOD = 'aod'; - /** - * a playback type for live video - * - * @property LIVE - * @static - * @type String - */ - Playback.LIVE = 'live'; - /** - * a default playback type - * - * @property NO_OP - * @static - * @type String - */ - Playback.NO_OP = 'no_op'; - /** - * the plugin type - * - * @property type - * @static - * @type String - */ - Playback.type = 'playback'; - module.exports = exports['default']; - -/***/ }, -/* 32 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global, module) {/** - * 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 size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; - - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding('util'); - } catch (e) {} - }()); - - /* Node.js helper references. */ - var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - - /** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ - function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; - } +var _core = __webpack_require__(72); - /** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ - function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; - } +var _core2 = _interopRequireDefault(_core); - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } +var _loader = __webpack_require__(77); - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } +var _loader2 = _interopRequireDefault(_loader); - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } +var _mediator = __webpack_require__(24); - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array ? array.length : 0; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } +var _mediator2 = _interopRequireDefault(_mediator); - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } +var _media_control = __webpack_require__(74); - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } +var _media_control2 = _interopRequireDefault(_media_control); - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } +var _player_info = __webpack_require__(34); - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } +var _player_info2 = _interopRequireDefault(_player_info); - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } +var _base_flash_playback = __webpack_require__(59); - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } +var _base_flash_playback2 = _interopRequireDefault(_base_flash_playback); - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } +var _flash = __webpack_require__(80); - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = root['__core-js_shared__']; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max; - - /* Built-in method references that are verified to be native. */ - var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } +var _flash2 = _interopRequireDefault(_flash); - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - } +var _flashls = __webpack_require__(82); - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; - } +var _flashls2 = _interopRequireDefault(_flashls); - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } +var _hls = __webpack_require__(83); - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); - } +var _hls2 = _interopRequireDefault(_hls); - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } +var _html5_audio = __webpack_require__(81); - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } +var _html5_audio2 = _interopRequireDefault(_html5_audio); - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - } +var _html5_video = __webpack_require__(35); - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; - } +var _html5_video2 = _interopRequireDefault(_html5_video); - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } +var _html_img = __webpack_require__(84); - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } +var _html_img2 = _interopRequireDefault(_html_img); - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } +var _no_op = __webpack_require__(85); - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } +var _no_op2 = _interopRequireDefault(_no_op); - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } +var _poster = __webpack_require__(86); - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); - } +var _poster2 = _interopRequireDefault(_poster); - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } +var _log = __webpack_require__(55); - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } +var _log2 = _interopRequireDefault(_log); - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; - } +var _styler = __webpack_require__(7); - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - this.__data__ = new ListCache(entries); - } +var _styler2 = _interopRequireDefault(_styler); - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - } +var _vendor = __webpack_require__(56); - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - return this.__data__['delete'](key); - } +var _vendor2 = _interopRequireDefault(_vendor); - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } +var _template = __webpack_require__(8); - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } +var _template2 = _interopRequireDefault(_template); - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - return this; - } - cache = this.__data__ = new MapCache(pairs); - } - cache.set(key, value); - return this; - } +var _clapprZepto = __webpack_require__(6); - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); - } - } - return result; - } +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); - /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (typeof key == 'number' && value === undefined && !(key in object))) { - object[key] = value; - } - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; - } - } +var version = "0.2.71"; // 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. - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } +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']; - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); - } - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return result; - } +"use strict"; - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; - } - /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); - } +Object.defineProperty(exports, "__esModule", { + value: true +}); - /** - * The base implementation of `getTag`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - return objectToString.call(value); - } +var _keys = __webpack_require__(31); - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } +var _keys2 = _interopRequireDefault(_keys); - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; - } +var _classCallCheck2 = __webpack_require__(0); - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } +var _possibleConstructorReturn2 = __webpack_require__(1); - /** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - if (!(isArray(source) || isTypedArray(source))) { - var props = baseKeysIn(source); - } - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } - if (isObject(srcValue)) { - stack || (stack = new Stack); - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(object[key], srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }); - } +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = object[key], - srcValue = source[key], - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - newValue = srcValue; - if (isArray(srcValue) || isTypedArray(srcValue)) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else { - isCommon = false; - newValue = baseClone(srcValue, true); - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - isCommon = false; - newValue = baseClone(srcValue, true); - } - else { - newValue = objValue; - } - } - else { - isCommon = false; - } - } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); - } +var _createClass2 = __webpack_require__(3); - /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; - } +var _createClass3 = _interopRequireDefault(_createClass2); - /** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var result = new buffer.constructor(buffer.length); - buffer.copy(result); - return result; - } +var _inherits2 = __webpack_require__(2); - /** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } +var _inherits3 = _interopRequireDefault(_inherits2); - /** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } +var _utils = __webpack_require__(5); - /** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ - function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); - } +var _base_object = __webpack_require__(17); - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } +var _base_object2 = _interopRequireDefault(_base_object); - /** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ - function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); - } +var _events = __webpack_require__(4); - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } +var _events2 = _interopRequireDefault(_events); - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } +var _browser = __webpack_require__(13); - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } +var _browser2 = _interopRequireDefault(_browser); - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - assignValue(object, key, newValue === undefined ? source[key] : newValue); - } - return object; - } +var _core_factory = __webpack_require__(131); - /** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } +var _core_factory2 = _interopRequireDefault(_core_factory); - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } +var _loader = __webpack_require__(77); - /** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); - } +var _loader2 = _interopRequireDefault(_loader); - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } +var _player_info = __webpack_require__(34); - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } +var _player_info2 = _interopRequireDefault(_player_info); - /** - * Creates an array of the own enumerable symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11, - // for data views in Edge < 14, and promises in Node.js. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : undefined; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } +var _clapprZepto = __webpack_require__(6); - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object, isDeep, cloneFunc); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object, isDeep, cloneFunc); - - case symbolTag: - return cloneSymbol(object); - } - } +// 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) { + (0, _inherits3.default)(Player, _BaseObject); + (0, _createClass3.default)(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, + onSubtitleAvailable: _events2.default.PLAYER_SUBTITLE_AVAILABLE + }; + } + + /** + * ## 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) { + (0, _classCallCheck3.default)(this, Player); + + var _this = (0, _possibleConstructorReturn3.default)(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); + this.listenTo(container, _events2.default.CONTAINER_SUBTITLE_AVAILABLE, this._onSubtitleAvailable); + } + return this; + }; + + Player.prototype._registerOptionEventListeners = function _registerOptionEventListeners() { + var _this2 = this; + + var userEvents = this.options.events || {}; + (0, _keys2.default)(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._onSubtitleAvailable = function _onSubtitleAvailable() { + this.trigger(_events2.default.PLAYER_SUBTITLE_AVAILABLE); + }; + + 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; + }; + + /** + * Gives user consent to playback. Required by mobile device after a click event before Player.load(). + * @method consent + * @return {Player} itself + */ + + + Player.prototype.consent = function consent() { + this.core.getCurrentPlayback().consent(); + 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. + */ - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); - } - /** - * Checks if the given arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } + Player.prototype.getStartTimeOffset = function getStartTimeOffset() { + return this.core.mediaControl.container.getStartTimeOffset(); + }; - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } + /** + * 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); - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } +exports.default = Player; +module.exports = exports['default']; - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; - } +__webpack_require__(90); +module.exports = __webpack_require__(11).Object.keys; - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(39) + , $keys = __webpack_require__(25); - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } +__webpack_require__(62)('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; +}); - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(41); +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); +}; - /** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(14) + , toLength = __webpack_require__(61) + , toIndex = __webpack_require__(93); +module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } +var toInteger = __webpack_require__(42) + , max = Math.max + , min = Math.min; +module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; - /** - * 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'); - } +/***/ }), +/* 94 */ +/***/ (function(module, exports) { - /** - * 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'; - } +module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; +}; - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || - objectToString.call(value) != objectTag || isHostObject(value)) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); - } +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - - /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } +module.exports = { "default": __webpack_require__(96), __esModule: true }; - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } +__webpack_require__(65); +__webpack_require__(102); +module.exports = __webpack_require__(51).f('iterator'); - /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; - * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - - /** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */ - function stubArray() { - return []; - } +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(42) + , defined = __webpack_require__(40); +// true -> String#at +// false -> String#codePointAt +module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ - function stubFalse() { - return false; - } +"use strict"; - module.exports = merge; +var create = __webpack_require__(49) + , descriptor = __webpack_require__(28) + , setToStringTag = __webpack_require__(50) + , IteratorPrototype = {}; - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(33)(module))) +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(22)(IteratorPrototype, __webpack_require__(12)('iterator'), function(){ return this; }); -/***/ }, -/* 33 */ -/***/ function(module, exports) { - - module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - module.children = []; - module.webpackPolyfill = 1; - } - return module; - } +module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); +}; +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(16) + , anObject = __webpack_require__(23) + , getKeys = __webpack_require__(25); + +module.exports = __webpack_require__(20) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; +}; + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { +module.exports = __webpack_require__(15).document && document.documentElement; - exports = module.exports = __webpack_require__(25)(); - // imports +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(18) + , toObject = __webpack_require__(39) + , IE_PROTO = __webpack_require__(43)('IE_PROTO') + , ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(103); +var global = __webpack_require__(15) + , hide = __webpack_require__(22) + , Iterators = __webpack_require__(29) + , TO_STRING_TAG = __webpack_require__(12)('toStringTag'); + +for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype; + if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; +} + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(104) + , step = __webpack_require__(105) + , Iterators = __webpack_require__(29) + , toIObject = __webpack_require__(14); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = __webpack_require__(66)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { +module.exports = function(){ /* empty */ }; - // module - exports.push([module.id, ".media-control-notransition {\n -webkit-transition: none !important;\n -moz-transition: none !important;\n transition: none !important; }\n\n.media-control[data-media-control] {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 9999;\n pointer-events: none; }\n .media-control[data-media-control].dragging {\n pointer-events: auto;\n cursor: -webkit-grabbing !important;\n cursor: grabbing !important;\n cursor: url(" + __webpack_require__(35) + "), move; }\n .media-control[data-media-control].dragging * {\n cursor: -webkit-grabbing !important;\n cursor: grabbing !important;\n cursor: url(" + __webpack_require__(35) + "), move; }\n .media-control[data-media-control] .media-control-background[data-background] {\n position: absolute;\n height: 40%;\n width: 100%;\n bottom: 0;\n background: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n -webkit-transition: opacity 0.6s ease-out;\n -moz-transition: opacity 0.6s ease-out;\n transition: opacity 0.6s ease-out; }\n .media-control[data-media-control] .media-control-icon {\n line-height: 0;\n letter-spacing: 0;\n speak: none;\n color: #fff;\n opacity: 0.5;\n vertical-align: middle;\n text-align: left;\n -webkit-transition: all 0.1s ease;\n -moz-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .media-control[data-media-control] .media-control-icon:hover {\n color: white;\n opacity: 0.75;\n text-shadow: rgba(255, 255, 255, 0.8) 0 0 5px; }\n .media-control[data-media-control].media-control-hide .media-control-background[data-background] {\n opacity: 0; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] {\n bottom: -50px; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] {\n position: absolute;\n bottom: 7px;\n width: 100%;\n height: 32px;\n font-size: 0;\n vertical-align: middle;\n pointer-events: auto;\n -webkit-transition: bottom 0.4s ease-out;\n -moz-transition: bottom 0.4s ease-out;\n transition: bottom 0.4s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control] {\n position: absolute;\n top: 0;\n left: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control] {\n height: 100%;\n text-align: center;\n line-height: 32px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control] {\n position: absolute;\n top: 0;\n right: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button {\n background-color: transparent;\n border: 0;\n margin: 0 6px;\n padding: 0;\n cursor: pointer;\n display: inline-block;\n width: 32px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg {\n width: 100%;\n height: 22px; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus {\n outline: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen] {\n float: right;\n background-color: transparent;\n border: 0;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator] {\n cursor: default;\n float: right;\n background-color: transparent;\n border: 0;\n height: 100%;\n display: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled {\n opacity: 1.0;\n display: block; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover {\n opacity: 1.0;\n text-shadow: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position], .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n display: inline-block;\n font-size: 10px;\n color: white;\n cursor: default;\n line-height: 32px;\n position: relative; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position] {\n margin: 0 6px 0 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n color: rgba(255, 255, 255, 0.5);\n margin-right: 6px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before {\n content: \"|\";\n margin-right: 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] {\n position: absolute;\n top: -20px;\n left: 0;\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n height: 25px;\n cursor: pointer; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] {\n width: 100%;\n height: 1px;\n position: relative;\n top: 12px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n -webkit-transition: opacity 0.1s ease;\n -moz-transition: opacity 0.1s ease;\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled {\n cursor: default; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n position: absolute;\n -webkit-transform: translateX(-50%);\n -moz-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n -o-transform: translateX(-50%);\n transform: translateX(-50%);\n top: 2px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] {\n float: right;\n display: inline-block;\n height: 32px;\n cursor: pointer;\n margin: 0 6px;\n box-sizing: border-box; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] {\n float: left;\n bottom: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] {\n background-color: transparent;\n border: 0;\n box-sizing: content-box;\n width: 32px;\n height: 32px;\n opacity: 0.5; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover {\n opacity: 0.75; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg {\n height: 24px;\n position: relative;\n top: 3px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg {\n margin-left: 2px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] {\n float: left;\n position: relative;\n overflow: hidden;\n top: 6px;\n width: 42px;\n height: 18px;\n padding: 3px 0;\n -webkit-transition: width 0.2s ease-out;\n -moz-transition: width 0.2s ease-out;\n transition: width 0.2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] {\n height: 1px;\n position: relative;\n top: 7px;\n margin: 0 3px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n -webkit-transition: opacity 0.1s ease;\n -moz-transition: opacity 0.1s ease;\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] {\n position: absolute;\n -webkit-transform: translateX(-50%);\n -moz-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n -o-transform: translateX(-50%);\n transform: translateX(-50%);\n top: 0px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume] {\n float: left;\n width: 4px;\n padding-left: 2px;\n height: 12px;\n opacity: 0.5;\n box-shadow: inset 2px 0 0 white;\n -webkit-transition: -webkit-transform 0.2s ease-out;\n -moz-transition: -moz-transform 0.2s ease-out;\n transition: transform 0.2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill {\n box-shadow: inset 2px 0 0 #fff;\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1) {\n padding-left: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover {\n -webkit-transform: scaleY(1.5);\n -moz-transform: scaleY(1.5);\n -ms-transform: scaleY(1.5);\n -o-transform: scaleY(1.5);\n transform: scaleY(1.5); }\n .media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide {\n width: 0;\n height: 12px;\n top: 9px;\n padding: 0; }\n", ""]); +/***/ }), +/* 105 */ +/***/ (function(module, exports) { - // exports +module.exports = function(done, value){ + return {value: value, done: !!done}; +}; +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { +module.exports = { "default": __webpack_require__(107), __esModule: true }; - module.exports = __webpack_require__.p + "a8c874b93b3d848f39a71260c57e3863.cur"; +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 36 */ -/***/ function(module, exports) { +__webpack_require__(108); +__webpack_require__(114); +__webpack_require__(115); +__webpack_require__(116); +module.exports = __webpack_require__(11).Symbol; - module.exports = "
\n
\n <% var renderBar = function(name) { %>\n
>\n
>\n
>
\n
>
\n
>
\n
\n
>\n
>
\n
\n
\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n
>\n <% for (var i = 0; i < segments; i++) { %>\n
>
\n <% } %>\n
\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n
>\n
>\n
>
\n >\n
\n <% renderContent(name); %>\n
\n <% }; %>\n <% var renderIndicator = function(name) { %>\n
>
\n <% }; %>\n <% var renderButton = function(name) { %>\n \n <% }; %>\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function(settingsList) {\n settingsList.forEach(function(setting) {\n if(setting === \"seekbar\") {\n renderBar(setting);\n } else if (setting === \"volume\") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\n } else if (setting === \"duration\" || setting === \"position\") {\n renderIndicator(setting);\n } else {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.default && settings.default.length) { %>\n
\n <% render(settings.default); %>\n
\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n
\n <% render(settings.left); %>\n
\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n
\n <% render(settings.right); %>\n
\n <% } %>\n
\n"; +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(15) + , has = __webpack_require__(18) + , DESCRIPTORS = __webpack_require__(20) + , $export = __webpack_require__(19) + , redefine = __webpack_require__(67) + , META = __webpack_require__(109).KEY + , $fails = __webpack_require__(27) + , shared = __webpack_require__(44) + , setToStringTag = __webpack_require__(50) + , uid = __webpack_require__(32) + , wks = __webpack_require__(12) + , wksExt = __webpack_require__(51) + , wksDefine = __webpack_require__(52) + , keyOf = __webpack_require__(110) + , enumKeys = __webpack_require__(111) + , isArray = __webpack_require__(112) + , anObject = __webpack_require__(23) + , toIObject = __webpack_require__(14) + , toPrimitive = __webpack_require__(47) + , createDesc = __webpack_require__(28) + , _create = __webpack_require__(49) + , gOPNExt = __webpack_require__(113) + , $GOPD = __webpack_require__(54) + , $DP = __webpack_require__(16) + , $keys = __webpack_require__(25) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; +}) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; +} : function(it){ + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(69).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(53).f = $propertyIsEnumerable; + __webpack_require__(68).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !__webpack_require__(48)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + +for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + +for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } +}); -/***/ }, -/* 37 */ -/***/ function(module, exports) { +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); - module.exports = "" +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); -/***/ }, -/* 38 */ -/***/ function(module, exports) { +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(22)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); - module.exports = "" +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(32)('meta') + , isObject = __webpack_require__(26) + , has = __webpack_require__(18) + , setDesc = __webpack_require__(16).f + , id = 0; +var isExtensible = Object.isExtensible || function(){ + return true; +}; +var FREEZE = !__webpack_require__(27)(function(){ + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); +}; +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(25) + , toIObject = __webpack_require__(14); +module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; +}; + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(25) + , gOPS = __webpack_require__(68) + , pIE = __webpack_require__(53); +module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; +}; + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 39 */ -/***/ function(module, exports) { +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(41); +module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; +}; + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(14) + , gOPN = __webpack_require__(69).f + , toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports) { + + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(52)('asyncIterator'); + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(52)('observable'); + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(118); +var $Object = __webpack_require__(11).Object; +module.exports = function defineProperty(it, key, desc){ + return $Object.defineProperty(it, key, desc); +}; + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(19); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__webpack_require__(20), 'Object', {defineProperty: __webpack_require__(16).f}); + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(120), __esModule: true }; + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(121); +module.exports = __webpack_require__(11).Object.setPrototypeOf; + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __webpack_require__(19); +$export($export.S, 'Object', {setPrototypeOf: __webpack_require__(122).set}); + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = __webpack_require__(26) + , anObject = __webpack_require__(23); +var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = __webpack_require__(46)(Function.call, __webpack_require__(54).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(124); +var $Object = __webpack_require__(11).Object; +module.exports = function create(P, D){ + return $Object.create(P, D); +}; + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(19) +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', {create: __webpack_require__(49)}); + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(126), __esModule: true }; + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(127); +var $Object = __webpack_require__(11).Object; +module.exports = function getOwnPropertyDescriptor(it, key){ + return $Object.getOwnPropertyDescriptor(it, key); +}; + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = __webpack_require__(14) + , $getOwnPropertyDescriptor = __webpack_require__(54).f; + +__webpack_require__(62)('getOwnPropertyDescriptor', function(){ + return function getOwnPropertyDescriptor(it, key){ + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); - module.exports = "" +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// 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. + +/** + * Array.prototype.find + * + * Original source : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find + * See also : https://tc39.github.io/ecma262/#sec-array.prototype.find + */ +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, 'find', { + // Note: ES6 arrow function syntax is not used on purpose to avoid this to be undefined + value: function value(predicate) { + // 1. Let O be ? ToObject(this value). + if (this == null) { + throw new TypeError('"this" is null or not defined'); + } + + var o = Object(this); + + // 2. Let len be ? ToLength(? Get(O, "length")). + var len = o.length >>> 0; + + // 3. If IsCallable(predicate) is false, throw a TypeError exception. + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + + // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. + var thisArg = arguments[1]; + + // 5. Let k be 0. + var k = 0; + + // 6. Repeat, while k < len + while (k < len) { + // a. Let Pk be ! ToString(k). + // b. Let kValue be ? Get(O, Pk). + // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). + // d. If testResult is true, return kValue. + var kValue = o[k]; + if (predicate.call(thisArg, kValue, k, o)) { + return kValue; + } + // e. Increase k by 1. + k++; + } + + // 7. Return undefined. + return undefined; + } + }); +} + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); -/***/ }, -/* 40 */ -/***/ function(module, exports) { +var _classCallCheck2 = __webpack_require__(0); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _vendor = __webpack_require__(56); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BOLD = 'font-weight: bold; font-size: 13px;'; +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +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; + (0, _classCallCheck3.default)(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']; + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"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']; + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); - module.exports = "" +var _core_factory = __webpack_require__(132); -/***/ }, -/* 41 */ -/***/ function(module, exports) { +var _core_factory2 = _interopRequireDefault(_core_factory); - module.exports = "" +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, -/* 42 */ -/***/ function(module, exports) { +exports.default = _core_factory2.default; +module.exports = exports['default']; - module.exports = "" +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { -/***/ }, -/* 43 */ -/***/ function(module, exports) { +"use strict"; - module.exports = "" -/***/ }, -/* 44 */ -/***/ function(module, exports) { +Object.defineProperty(exports, "__esModule", { + value: true +}); - module.exports = "" +var _classCallCheck2 = __webpack_require__(0); -/***/ }, -/* 45 */ -/***/ function(module, exports) { +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - "use strict"; +var _possibleConstructorReturn2 = __webpack_require__(1); - Object.defineProperty(exports, "__esModule", { - value: true - }); +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _createClass2 = __webpack_require__(3); - // 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 _createClass3 = _interopRequireDefault(_createClass2); - var PlayerInfo = function PlayerInfo() { - _classCallCheck(this, PlayerInfo); +var _inherits2 = __webpack_require__(2); - this.options = {}; - this.playbackPlugins = []; - this.currentSize = { width: 0, height: 0 }; - }; +var _inherits3 = _interopRequireDefault(_inherits2); - PlayerInfo._players = {}; +var _base_object = __webpack_require__(17); - PlayerInfo.getInstance = function (playerId) { - return PlayerInfo._players[playerId] || (PlayerInfo._players[playerId] = new PlayerInfo()); - }; +var _base_object2 = _interopRequireDefault(_base_object); - exports.default = PlayerInfo; - module.exports = exports["default"]; +var _core = __webpack_require__(72); -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { +var _core2 = _interopRequireDefault(_core); - exports = module.exports = __webpack_require__(25)(); - // imports +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** + * The Core Factory is responsible for instantiate the core and it's plugins. + * @class CoreFactory + * @constructor + * @extends BaseObject + * @module components + */ +// 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. - // module - exports.push([module.id, "@font-face {\n font-family: \"Roboto\";\n font-style: normal;\n font-weight: 400;\n src: local(\"Roboto\"), local(\"Roboto-Regular\"), url(" + __webpack_require__(47) + ") format(\"truetype\"); }\n\n[data-player] {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-transform: translate3d(0, 0, 0);\n -moz-transform: translate3d(0, 0, 0);\n -ms-transform: translate3d(0, 0, 0);\n -o-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n position: relative;\n margin: 0;\n padding: 0;\n border: 0;\n font-style: normal;\n font-weight: normal;\n text-align: center;\n overflow: hidden;\n font-size: 100%;\n font-family: \"Roboto\", \"Open Sans\", Arial, sans-serif;\n text-shadow: 0 0 0;\n box-sizing: border-box; }\n [data-player] div, [data-player] span, [data-player] applet, [data-player] object, [data-player] iframe,\n [data-player] h1, [data-player] h2, [data-player] h3, [data-player] h4, [data-player] h5, [data-player] h6, [data-player] p, [data-player] blockquote, [data-player] pre,\n [data-player] a, [data-player] abbr, [data-player] acronym, [data-player] address, [data-player] big, [data-player] cite, [data-player] code,\n [data-player] del, [data-player] dfn, [data-player] em, [data-player] img, [data-player] ins, [data-player] kbd, [data-player] q, [data-player] s, [data-player] samp,\n [data-player] small, [data-player] strike, [data-player] strong, [data-player] sub, [data-player] sup, [data-player] tt, [data-player] var,\n [data-player] b, [data-player] u, [data-player] i, [data-player] center,\n [data-player] dl, [data-player] dt, [data-player] dd, [data-player] ol, [data-player] ul, [data-player] li,\n [data-player] fieldset, [data-player] form, [data-player] label, [data-player] legend,\n [data-player] table, [data-player] caption, [data-player] tbody, [data-player] tfoot, [data-player] thead, [data-player] tr, [data-player] th, [data-player] td,\n [data-player] article, [data-player] aside, [data-player] canvas, [data-player] details, [data-player] embed,\n [data-player] figure, [data-player] figcaption, [data-player] footer, [data-player] header, [data-player] hgroup,\n [data-player] menu, [data-player] nav, [data-player] output, [data-player] ruby, [data-player] section, [data-player] summary,\n [data-player] time, [data-player] mark, [data-player] audio, [data-player] video {\n margin: 0;\n padding: 0;\n border: 0;\n font: inherit;\n font-size: 100%;\n vertical-align: baseline; }\n [data-player] table {\n border-collapse: collapse;\n border-spacing: 0; }\n [data-player] caption, [data-player] th, [data-player] td {\n text-align: left;\n font-weight: normal;\n vertical-align: middle; }\n [data-player] q, [data-player] blockquote {\n quotes: none; }\n [data-player] q:before, [data-player] q:after, [data-player] blockquote:before, [data-player] blockquote:after {\n content: \"\";\n content: none; }\n [data-player] a img {\n border: none; }\n [data-player]:focus {\n outline: 0; }\n [data-player] * {\n max-width: none;\n box-sizing: inherit;\n float: none; }\n [data-player] div {\n display: block; }\n [data-player].fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0;\n left: 0; }\n [data-player].nocursor {\n cursor: none; }\n\n.clappr-style {\n display: none !important; }\n", ""]); +var CoreFactory = function (_BaseObject) { + (0, _inherits3.default)(CoreFactory, _BaseObject); + (0, _createClass3.default)(CoreFactory, [{ + key: 'loader', + get: function get() { + return this.player.loader; + } - // exports + /** + * it builds the core factory + * @method constructor + * @param {Player} player the player object + */ + }]); -/***/ }, -/* 47 */ -/***/ function(module, exports, __webpack_require__) { + function CoreFactory(player) { + (0, _classCallCheck3.default)(this, CoreFactory); - module.exports = __webpack_require__.p + "38861cba61c66739c1452c3a71e39852.ttf"; + var _this = (0, _possibleConstructorReturn3.default)(this, _BaseObject.call(this)); -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { + _this.player = player; + _this._options = player.options; + return _this; + } - 'use strict'; + /** + * creates a core and its plugins + * @method create + * @return {Core} created core + */ - module.exports = __webpack_require__(49); -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { + 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; + }; - 'use strict'; + /** + * given the core plugins (`loader.corePlugins`) it builds each one + * @method addCorePlugins + * @return {Core} the core with all plugins + */ - Object.defineProperty(exports, "__esModule", { - value: true - }); - var _base_object = __webpack_require__(4); + CoreFactory.prototype.addCorePlugins = function addCorePlugins() { + var _this2 = this; - var _base_object2 = _interopRequireDefault(_base_object); + this.loader.corePlugins.forEach(function (Plugin) { + var plugin = new Plugin(_this2.core); + _this2.core.addPlugin(plugin); + _this2.setupExternalInterface(plugin); + }); + return this.core; + }; - var _player_info = __webpack_require__(45); + CoreFactory.prototype.setupExternalInterface = function setupExternalInterface(plugin) { + var externalFunctions = plugin.getExternalInterface(); + for (var key in externalFunctions) { + this.player[key] = externalFunctions[key].bind(plugin); + } + }; - var _player_info2 = _interopRequireDefault(_player_info); + return CoreFactory; +}(_base_object2.default); - var _lodash = __webpack_require__(50); +exports.default = CoreFactory; +module.exports = exports['default']; - var _lodash2 = _interopRequireDefault(_lodash); +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { - var _html5_video = __webpack_require__(51); +"use strict"; - var _html5_video2 = _interopRequireDefault(_html5_video); - var _flash = __webpack_require__(54); +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _flash2 = _interopRequireDefault(_flash); +var _classCallCheck2 = __webpack_require__(0); - var _html5_audio = __webpack_require__(61); +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - var _html5_audio2 = _interopRequireDefault(_html5_audio); +var _possibleConstructorReturn2 = __webpack_require__(1); - var _flashls = __webpack_require__(63); +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - var _flashls2 = _interopRequireDefault(_flashls); +var _createClass2 = __webpack_require__(3); - var _hls = __webpack_require__(67); +var _createClass3 = _interopRequireDefault(_createClass2); - var _hls2 = _interopRequireDefault(_hls); +var _inherits2 = __webpack_require__(2); - var _html_img = __webpack_require__(71); +var _inherits3 = _interopRequireDefault(_inherits2); - var _html_img2 = _interopRequireDefault(_html_img); +var _utils = __webpack_require__(5); - var _no_op = __webpack_require__(74); +var _events = __webpack_require__(4); - var _no_op2 = _interopRequireDefault(_no_op); +var _events2 = _interopRequireDefault(_events); - var _spinner_three_bounce = __webpack_require__(78); +var _styler = __webpack_require__(7); - var _spinner_three_bounce2 = _interopRequireDefault(_spinner_three_bounce); +var _styler2 = _interopRequireDefault(_styler); - var _stats = __webpack_require__(83); +var _ui_object = __webpack_require__(21); - var _stats2 = _interopRequireDefault(_stats); +var _ui_object2 = _interopRequireDefault(_ui_object); - var _watermark = __webpack_require__(86); +var _browser = __webpack_require__(13); - var _watermark2 = _interopRequireDefault(_watermark); +var _browser2 = _interopRequireDefault(_browser); - var _poster = __webpack_require__(90); +var _container_factory = __webpack_require__(134); - var _poster2 = _interopRequireDefault(_poster); +var _container_factory2 = _interopRequireDefault(_container_factory); - var _google_analytics = __webpack_require__(94); +var _media_control = __webpack_require__(74); - var _google_analytics2 = _interopRequireDefault(_google_analytics); +var _media_control2 = _interopRequireDefault(_media_control); - var _click_to_pause = __webpack_require__(96); +var _mediator = __webpack_require__(24); - var _click_to_pause2 = _interopRequireDefault(_click_to_pause); +var _mediator2 = _interopRequireDefault(_mediator); - var _dvr_controls = __webpack_require__(98); +var _player_info = __webpack_require__(34); - var _dvr_controls2 = _interopRequireDefault(_dvr_controls); +var _player_info2 = _interopRequireDefault(_player_info); - var _favicon = __webpack_require__(103); +var _clapprZepto = __webpack_require__(6); - var _favicon2 = _interopRequireDefault(_favicon); +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); - var _seek_time = __webpack_require__(106); +var _style = __webpack_require__(149); - var _seek_time2 = _interopRequireDefault(_seek_time); +var _style2 = _interopRequireDefault(_style); - var _sources = __webpack_require__(110); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _sources2 = _interopRequireDefault(_sources); +/** + * 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) { + (0, _inherits3.default)(Core, _UIObject); + (0, _createClass3.default)(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) { + (0, _classCallCheck3.default)(this, Core); + + var _this = (0, _possibleConstructorReturn3.default)(this, _UIObject.call(this, options)); + + _this.configureDomRecycler(); + _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); + _browser2.default.isMobile && (0, _clapprZepto2.default)(window).bind('resize', function (o) { + _this.handleWindowResize(o); + }); + return _this; + } + + Core.prototype.configureDomRecycler = function configureDomRecycler() { + var recycleVideo = this.options && this.options.playback && this.options.playback.recycleVideo ? true : false; + _utils.DomRecycler.configure({ + recycleVideo: recycleVideo + }); + }; + + 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.handleWindowResize = function handleWindowResize(event) { + var orientation = (0, _clapprZepto2.default)(window).width() > (0, _clapprZepto2.default)(window).height() ? 'landscape' : 'portrait'; + if (this._screenOrientation === orientation) return; + this._screenOrientation = orientation; + + this.trigger(_events2.default.CORE_SCREEN_ORIENTATION_CHANGED, { + event: event, + orientation: this._screenOrientation + }); + }; + + 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); + this.configureDomRecycler(); + 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() { + this.$style && this.$style.remove(); + this.$style = _styler2.default.getStyleFor(_style2.default, { baseUrl: this.options.baseUrl }); + this.$el.append(this.$style); + this.$el.append(this.mediaControl.render().el); + + 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); // 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 = Core; +module.exports = exports['default']; + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); - var _end_video = __webpack_require__(111); +var _container_factory = __webpack_require__(135); - var _end_video2 = _interopRequireDefault(_end_video); +var _container_factory2 = _interopRequireDefault(_container_factory); - var _strings = __webpack_require__(112); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var _strings2 = _interopRequireDefault(_strings); +exports.default = _container_factory2.default; +module.exports = exports['default']; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +"use strict"; - 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. +Object.defineProperty(exports, "__esModule", { + value: true +}); - /* Playback Plugins */ +var _typeof2 = __webpack_require__(33); +var _typeof3 = _interopRequireDefault(_typeof2); - /* Container Plugins */ +var _classCallCheck2 = __webpack_require__(0); +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - /* Core Plugins */ +var _possibleConstructorReturn2 = __webpack_require__(1); +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - /** - * It keeps a list of the default plugins (playback, container, core) and it merges external plugins with its internals. - * @class Loader - * @constructor - * @extends BaseObject - * @module components - */ - var Loader = function (_BaseObject) { - _inherits(Loader, _BaseObject); +var _createClass2 = __webpack_require__(3); - /** - * builds the loader - * @method constructor - * @param {Object} externalPlugins the external plugins - * @param {Number} playerId you can embed multiple instances of clappr, therefore this is the unique id of each one. - */ - function Loader(externalPlugins, playerId) { - _classCallCheck(this, Loader); +var _createClass3 = _interopRequireDefault(_createClass2); - var _this = _possibleConstructorReturn(this, _BaseObject.call(this)); +var _inherits2 = __webpack_require__(2); - _this.playerId = playerId; - _this.playbackPlugins = [_hls2.default, _html5_video2.default, _html5_audio2.default, _flash2.default, _flashls2.default, _html_img2.default, _no_op2.default]; - _this.containerPlugins = [_spinner_three_bounce2.default, _watermark2.default, _poster2.default, _stats2.default, _google_analytics2.default, _click_to_pause2.default]; - _this.corePlugins = [_dvr_controls2.default, _favicon2.default, _seek_time2.default, _sources2.default, _end_video2.default, _strings2.default]; - if (externalPlugins) { - if (!Array.isArray(externalPlugins)) { - _this.validateExternalPluginsType(externalPlugins); - } - _this.addExternalPlugins(externalPlugins); - } - return _this; - } +var _inherits3 = _interopRequireDefault(_inherits2); - /** - * groups by type the external plugins that were passed through `options.plugins` it they're on a flat array - * @method addExternalPlugins - * @private - * @param {Object} an config object or an array of plugins - * @return {Object} plugins the config object with the plugins separated by type - */ +var _base_object = __webpack_require__(17); +var _base_object2 = _interopRequireDefault(_base_object); - Loader.prototype.groupPluginsByType = function groupPluginsByType(plugins) { - if (Array.isArray(plugins)) { - plugins = plugins.reduce(function (memo, plugin) { - memo[plugin.type] || (memo[plugin.type] = []); - memo[plugin.type].push(plugin); - return memo; - }, {}); - } - return plugins; - }; +var _events = __webpack_require__(4); - /** - * adds all the external plugins that were passed through `options.plugins` - * @method addExternalPlugins - * @private - * @param {Object} plugins the config object with all plugins - */ +var _events2 = _interopRequireDefault(_events); +var _container = __webpack_require__(73); - Loader.prototype.addExternalPlugins = function addExternalPlugins(plugins) { - plugins = this.groupPluginsByType(plugins); - var pluginName = function pluginName(plugin) { - return plugin.prototype.name; - }; - if (plugins.playback) { - this.playbackPlugins = (0, _lodash2.default)(plugins.playback.concat(this.playbackPlugins), pluginName); - } - if (plugins.container) { - this.containerPlugins = (0, _lodash2.default)(plugins.container.concat(this.containerPlugins), pluginName); - } - if (plugins.core) { - this.corePlugins = (0, _lodash2.default)(plugins.core.concat(this.corePlugins), pluginName); - } - _player_info2.default.getInstance(this.playerId).playbackPlugins = this.playbackPlugins; - }; - - /** - * validate if the external plugins that were passed through `options.plugins` are associated to the correct type - * @method validateExternalPluginsType - * @private - * @param {Object} plugins the config object with all plugins - */ - - - Loader.prototype.validateExternalPluginsType = function validateExternalPluginsType(plugins) { - var plugintypes = ['playback', 'container', 'core']; - plugintypes.forEach(function (type) { - (plugins[type] || []).forEach(function (el) { - var errorMessage = 'external ' + el.type + ' plugin on ' + type + ' array'; - if (el.type !== type) { - throw new ReferenceError(errorMessage); - } - }); - }); - }; - - return Loader; - }(_base_object2.default); - - exports.default = Loader; - module.exports = exports['default']; - -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(global, module) {/** - * 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 size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; - - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding('util'); - } catch (e) {} - }()); - - /* Node.js helper references. */ - var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - var length = array ? array.length : 0; - return !!length && baseIndexOf(array, value, 0) > -1; - } - - /** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } +var _container2 = _interopRequireDefault(_container); - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } +var _clapprZepto = __webpack_require__(6); - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } +// 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 base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } +/** + * The ContainerFactory is responsible for manage playback bootstrap and create containers. + */ - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } +var ContainerFactory = function (_BaseObject) { + (0, _inherits3.default)(ContainerFactory, _BaseObject); + (0, _createClass3.default)(ContainerFactory, [{ + key: 'options', + get: function get() { + return this._options; + }, + set: function set(options) { + this._options = options; + } + }]); - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } + function ContainerFactory(options, loader, i18n) { + (0, _classCallCheck3.default)(this, ContainerFactory); - /** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } + var _this = (0, _possibleConstructorReturn3.default)(this, _BaseObject.call(this, options)); - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } + _this._i18n = i18n; + _this.loader = loader; + return _this; + } - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } + ContainerFactory.prototype.createContainers = function createContainers() { + var _this2 = this; - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } + return _clapprZepto2.default.Deferred(function (promise) { + promise.resolve(_this2.options.sources.map(function (source) { + return _this2.createContainer(source); + })); + }); + }; - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } + ContainerFactory.prototype.findPlaybackPlugin = function findPlaybackPlugin(source, mimeType) { + return this.loader.playbackPlugins.filter(function (p) { + return p.canPlay(source, mimeType); + })[0]; + }; - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } + ContainerFactory.prototype.createContainer = function createContainer(source) { + var resolvedSource = null, + mimeType = this.options.mimeType; + if ((typeof source === 'undefined' ? 'undefined' : (0, _typeof3.default)(source)) === 'object') { + resolvedSource = source.source.toString(); + if (source.mimeType) { + mimeType = source.mimeType; + } + } else { + resolvedSource = source.toString(); + } - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - - /** Used to detect overreaching core-js shims. */ - var coreJsData = root['__core-js_shared__']; - - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); - - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = overArg(Object.keys, Object); - - /* Built-in method references that are verified to be native. */ - var DataView = getNative(root, 'DataView'), - Map = getNative(root, 'Map'), - Promise = getNative(root, 'Promise'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - - /** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } + if (resolvedSource.match(/^\/\//)) resolvedSource = window.location.protocol + resolvedSource; - /** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - } + var options = _clapprZepto2.default.extend({}, this.options, { + src: resolvedSource, + mimeType: mimeType + }); + var playbackPlugin = this.findPlaybackPlugin(resolvedSource, mimeType); + var playback = new playbackPlugin(options, this._i18n); - /** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; - } + options = _clapprZepto2.default.extend({}, options, { playback: playback }); - /** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } + var container = new _container2.default(options, this._i18n); + var defer = _clapprZepto2.default.Deferred(); + defer.promise(container); + this.addContainerPlugins(container); + this.listenToOnce(container, _events2.default.CONTAINER_READY, function () { + return defer.resolve(container); + }); + return container; + }; - /** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); - } + ContainerFactory.prototype.addContainerPlugins = function addContainerPlugins(container) { + this.loader.containerPlugins.forEach(function (Plugin) { + container.addPlugin(new Plugin(container)); + }); + }; + + return ContainerFactory; +}(_base_object2.default); + +exports.default = ContainerFactory; +module.exports = exports['default']; + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); - /** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ - function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } +var _classCallCheck2 = __webpack_require__(0); - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - - /** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - /** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ - function listCacheClear() { - this.__data__ = []; - } +var _possibleConstructorReturn2 = __webpack_require__(1); - /** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; - } +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _createClass2 = __webpack_require__(3); - /** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; - } +var _createClass3 = _interopRequireDefault(_createClass2); + +var _inherits2 = __webpack_require__(2); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _events = __webpack_require__(4); + +var _events2 = _interopRequireDefault(_events); + +var _ui_object = __webpack_require__(21); + +var _ui_object2 = _interopRequireDefault(_ui_object); + +var _styler = __webpack_require__(7); + +var _styler2 = _interopRequireDefault(_styler); + +var _style = __webpack_require__(137); + +var _style2 = _interopRequireDefault(_style); + +var _clapprZepto = __webpack_require__(6); + +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * An abstraction to represent a container for a given playback + * TODO: describe its responsabilities + * @class Container + * @constructor + * @extends UIObject + * @module base + */ +var Container = function (_UIObject) { + (0, _inherits3.default)(Container, _UIObject); + (0, _createClass3.default)(Container, [{ + key: 'name', + + /** + * container's name + * @method name + * @default Container + * @return {String} container's name + */ + get: function get() { + return 'Container'; + } + }, { + key: 'attributes', + get: function get() { + return { class: 'container', 'data-container': '' }; + } + }, { + key: 'events', + get: function get() { + return { + 'click': 'clicked', + 'dblclick': 'dblClicked', + 'doubleTap': 'dblClicked', + 'contextmenu': 'onContextMenu', + 'mouseenter': 'mouseEnter', + 'mouseleave': 'mouseLeave' + }; + } + + /** + * Determine if the playback has ended. + * @property ended + * @type Boolean + */ + + }, { + key: 'ended', + get: function get() { + return this.playback.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.playback.buffering; + } + + /** + * The internationalization plugin. + * @property i18n + * @type {Strings} + */ + + }, { + key: 'i18n', + get: function get() { + return this._i18n; + } + + /** + * checks if has closed caption tracks. + * @property hasClosedCaptionsTracks + * @type {Boolean} + */ + + }, { + key: 'hasClosedCaptionsTracks', + get: function get() { + return this.playback.hasClosedCaptionsTracks; + } + + /** + * gets the available closed caption tracks. + * @property closedCaptionsTracks + * @type {Array} an array of objects with at least 'id' and 'name' properties + */ + + }, { + key: 'closedCaptionsTracks', + get: function get() { + return this.playback.closedCaptionsTracks; + } + + /** + * gets the selected closed caption track index. (-1 is disabled) + * @property closedCaptionsTrackId + * @type {Number} + */ + + }, { + key: 'closedCaptionsTrackId', + get: function get() { + return this.playback.closedCaptionsTrackId; + } + + /** + * sets the selected closed caption track index. (-1 is disabled) + * @property closedCaptionsTrackId + * @type {Number} + */ + , + set: function set(trackId) { + this.playback.closedCaptionsTrackId = trackId; + } + + /** + * it builds a container + * @method constructor + * @param {Object} options the options object + * @param {Strings} i18n the internationalization component + */ + + }]); + + function Container(options, i18n) { + (0, _classCallCheck3.default)(this, Container); + + var _this = (0, _possibleConstructorReturn3.default)(this, _UIObject.call(this, options)); + + _this._i18n = i18n; + _this.currentTime = 0; + _this.volume = 100; + _this.playback = options.playback; + _this.settings = _clapprZepto2.default.extend({}, _this.playback.settings); + _this.isReady = false; + _this.mediaControlDisabled = false; + _this.plugins = [_this.playback]; + _this.bindEvents(); + return _this; + } + + /** + * binds playback events to the methods of the container. + * it listens to playback's events and triggers them as container events. + * + * | Playback | + * |----------| + * | progress | + * | timeupdate | + * | ready | + * | buffering | + * | bufferfull | + * | settingsupdate | + * | loadedmetadata | + * | highdefinitionupdate | + * | bitrate | + * | playbackstate | + * | dvr | + * | mediacontrol_disable | + * | mediacontrol_enable | + * | ended | + * | play | + * | pause | + * | error | + * + * ps: the events usually translate from PLABACK_x to CONTAINER_x, you can check all the events at `Event` class. + * + * @method bindEvents + */ + + + Container.prototype.bindEvents = function bindEvents() { + this.listenTo(this.playback, _events2.default.PLAYBACK_PROGRESS, this.progress); + this.listenTo(this.playback, _events2.default.PLAYBACK_TIMEUPDATE, this.timeUpdated); + this.listenTo(this.playback, _events2.default.PLAYBACK_READY, this.ready); + this.listenTo(this.playback, _events2.default.PLAYBACK_BUFFERING, this.onBuffering); + this.listenTo(this.playback, _events2.default.PLAYBACK_BUFFERFULL, this.bufferfull); + this.listenTo(this.playback, _events2.default.PLAYBACK_SETTINGSUPDATE, this.settingsUpdate); + this.listenTo(this.playback, _events2.default.PLAYBACK_LOADEDMETADATA, this.loadedMetadata); + this.listenTo(this.playback, _events2.default.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate); + this.listenTo(this.playback, _events2.default.PLAYBACK_BITRATE, this.updateBitrate); + this.listenTo(this.playback, _events2.default.PLAYBACK_PLAYBACKSTATE, this.playbackStateChanged); + this.listenTo(this.playback, _events2.default.PLAYBACK_DVR, this.playbackDvrStateChanged); + this.listenTo(this.playback, _events2.default.PLAYBACK_MEDIACONTROL_DISABLE, this.disableMediaControl); + this.listenTo(this.playback, _events2.default.PLAYBACK_MEDIACONTROL_ENABLE, this.enableMediaControl); + this.listenTo(this.playback, _events2.default.PLAYBACK_ENDED, this.onEnded); + this.listenTo(this.playback, _events2.default.PLAYBACK_PLAY, this.playing); + this.listenTo(this.playback, _events2.default.PLAYBACK_PAUSE, this.paused); + this.listenTo(this.playback, _events2.default.PLAYBACK_STOP, this.stopped); + this.listenTo(this.playback, _events2.default.PLAYBACK_ERROR, this.error); + this.listenTo(this.playback, _events2.default.PLAYBACK_SUBTITLE_AVAILABLE, this.subtitleAvailable); + this.listenTo(this.playback, _events2.default.PLAYBACK_SUBTITLE_CHANGED, this.subtitleChanged); + }; + + Container.prototype.subtitleAvailable = function subtitleAvailable() { + this.trigger(_events2.default.CONTAINER_SUBTITLE_AVAILABLE); + }; + + Container.prototype.subtitleChanged = function subtitleChanged(track) { + this.trigger(_events2.default.CONTAINER_SUBTITLE_CHANGED, track); + }; + + Container.prototype.playbackStateChanged = function playbackStateChanged(state) { + this.trigger(_events2.default.CONTAINER_PLAYBACKSTATE, state); + }; + + Container.prototype.playbackDvrStateChanged = function playbackDvrStateChanged(dvrInUse) { + this.settings = this.playback.settings; + this.dvrInUse = dvrInUse; + this.trigger(_events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, dvrInUse); + }; + + Container.prototype.updateBitrate = function updateBitrate(newBitrate) { + this.trigger(_events2.default.CONTAINER_BITRATE, newBitrate); + }; + + Container.prototype.statsReport = function statsReport(metrics) { + this.trigger(_events2.default.CONTAINER_STATS_REPORT, metrics); + }; + + Container.prototype.getPlaybackType = function getPlaybackType() { + return this.playback.getPlaybackType(); + }; + + /** + * returns `true` if DVR is enable otherwise `false`. + * @method isDvrEnabled + * @return {Boolean} + */ + + + Container.prototype.isDvrEnabled = function isDvrEnabled() { + return !!this.playback.dvrEnabled; + }; + + /** + * returns `true` if DVR is in use otherwise `false`. + * @method isDvrInUse + * @return {Boolean} + */ + + + Container.prototype.isDvrInUse = function isDvrInUse() { + return !!this.dvrInUse; + }; + + /** + * destroys the container + * @method destroy + */ + + + Container.prototype.destroy = function destroy() { + this.trigger(_events2.default.CONTAINER_DESTROYED, this, this.name); + this.stopListening(); + this.plugins.forEach(function (plugin) { + return plugin.destroy(); + }); + this.$el.remove(); + }; + + Container.prototype.setStyle = function setStyle(style) { + this.$el.css(style); + }; + + Container.prototype.animate = function animate(style, duration) { + return this.$el.animate(style, duration).promise(); + }; + + Container.prototype.ready = function ready() { + this.isReady = true; + this.trigger(_events2.default.CONTAINER_READY, this.name); + }; + + Container.prototype.isPlaying = function isPlaying() { + return this.playback.isPlaying(); + }; + + Container.prototype.getStartTimeOffset = function getStartTimeOffset() { + return this.playback.getStartTimeOffset(); + }; + + Container.prototype.getCurrentTime = function getCurrentTime() { + return this.currentTime; + }; + + Container.prototype.getDuration = function getDuration() { + return this.playback.getDuration(); + }; + + Container.prototype.error = function error(errorObj) { + if (!this.isReady) { + this.ready(); + } + this.trigger(_events2.default.CONTAINER_ERROR, { error: errorObj, container: this }, this.name); + }; + + Container.prototype.loadedMetadata = function loadedMetadata(metadata) { + this.trigger(_events2.default.CONTAINER_LOADEDMETADATA, metadata); + }; + + Container.prototype.timeUpdated = function timeUpdated(timeProgress) { + this.currentTime = timeProgress.current; + this.trigger(_events2.default.CONTAINER_TIMEUPDATE, timeProgress, this.name); + }; + + Container.prototype.progress = function progress() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + this.trigger.apply(this, [_events2.default.CONTAINER_PROGRESS].concat(args, [this.name])); + }; + + Container.prototype.playing = function playing() { + this.trigger(_events2.default.CONTAINER_PLAY, this.name); + }; + + Container.prototype.paused = function paused() { + this.trigger(_events2.default.CONTAINER_PAUSE, this.name); + }; + + /** + * plays the playback + * @method play + */ + + + Container.prototype.play = function play() { + this.playback.play(); + }; + + /** + * stops the playback + * @method stop + */ + + + Container.prototype.stop = function stop() { + this.playback.stop(); + this.currentTime = 0; + }; + + /** + * pauses the playback + * @method pause + */ + + + Container.prototype.pause = function pause() { + this.playback.pause(); + }; + + Container.prototype.onEnded = function onEnded() { + this.trigger(_events2.default.CONTAINER_ENDED, this, this.name); + this.currentTime = 0; + }; + + Container.prototype.stopped = function stopped() { + this.trigger(_events2.default.CONTAINER_STOP); + }; + + Container.prototype.clicked = function clicked() { + if (!this.options.chromeless || this.options.allowUserInteraction) { + this.trigger(_events2.default.CONTAINER_CLICK, this, this.name); + } + }; + + Container.prototype.dblClicked = function dblClicked() { + if (!this.options.chromeless || this.options.allowUserInteraction) { + this.trigger(_events2.default.CONTAINER_DBLCLICK, this, this.name); + } + }; + + Container.prototype.onContextMenu = function onContextMenu(event) { + if (!this.options.chromeless || this.options.allowUserInteraction) { + this.trigger(_events2.default.CONTAINER_CONTEXTMENU, event, this.name); + } + }; + + Container.prototype.seek = function seek(time) { + this.trigger(_events2.default.CONTAINER_SEEK, time, this.name); + this.playback.seek(time); + }; + + Container.prototype.seekPercentage = function seekPercentage(percentage) { + var duration = this.getDuration(); + if (percentage >= 0 && percentage <= 100) { + var time = duration * (percentage / 100); + this.seek(time); + } + }; + + Container.prototype.setVolume = function setVolume(value) { + this.volume = parseInt(value, 10); + this.trigger(_events2.default.CONTAINER_VOLUME, value, this.name); + this.playback.volume(value); + }; + + Container.prototype.fullscreen = function fullscreen() { + this.trigger(_events2.default.CONTAINER_FULLSCREEN, this.name); + }; + + Container.prototype.onBuffering = function onBuffering() { + this.trigger(_events2.default.CONTAINER_STATE_BUFFERING, this.name); + }; + + Container.prototype.bufferfull = function bufferfull() { + this.trigger(_events2.default.CONTAINER_STATE_BUFFERFULL, this.name); + }; + + /** + * adds plugin to the container + * @method addPlugin + * @param {Object} plugin + */ + + + Container.prototype.addPlugin = function addPlugin(plugin) { + this.plugins.push(plugin); + }; + + /** + * checks if a plugin, given its name, exist + * @method hasPlugin + * @param {String} name + * @return {Boolean} + */ + + + Container.prototype.hasPlugin = function hasPlugin(name) { + return !!this.getPlugin(name); + }; + + /** + * get the plugin given its name + * @method getPlugin + * @param {String} name + */ + + + Container.prototype.getPlugin = function getPlugin(name) { + return this.plugins.filter(function (plugin) { + return plugin.name === name; + })[0]; + }; + + Container.prototype.mouseEnter = function mouseEnter() { + if (!this.options.chromeless || this.options.allowUserInteraction) { + this.trigger(_events2.default.CONTAINER_MOUSE_ENTER); + } + }; + + Container.prototype.mouseLeave = function mouseLeave() { + if (!this.options.chromeless || this.options.allowUserInteraction) { + this.trigger(_events2.default.CONTAINER_MOUSE_LEAVE); + } + }; + + Container.prototype.settingsUpdate = function settingsUpdate() { + this.settings = this.playback.settings; + this.trigger(_events2.default.CONTAINER_SETTINGSUPDATE); + }; + + Container.prototype.highDefinitionUpdate = function highDefinitionUpdate(isHD) { + this.trigger(_events2.default.CONTAINER_HIGHDEFINITIONUPDATE, isHD); + }; + + Container.prototype.isHighDefinitionInUse = function isHighDefinitionInUse() { + return this.playback.isHighDefinitionInUse(); + }; + + Container.prototype.disableMediaControl = function disableMediaControl() { + if (!this.mediaControlDisabled) { + this.mediaControlDisabled = true; + this.trigger(_events2.default.CONTAINER_MEDIACONTROL_DISABLE); + } + }; + + Container.prototype.enableMediaControl = function enableMediaControl() { + if (this.mediaControlDisabled) { + this.mediaControlDisabled = false; + this.trigger(_events2.default.CONTAINER_MEDIACONTROL_ENABLE); + } + }; + + Container.prototype.updateStyle = function updateStyle() { + if (!this.options.chromeless || this.options.allowUserInteraction) { + this.$el.removeClass('chromeless'); + } else { + this.$el.addClass('chromeless'); + } + }; + + /** + * enables to configure the container after its creation + * @method configure + * @param {Object} options all the options to change in form of a javascript object + */ + + + Container.prototype.configure = function configure(options) { + this._options = _clapprZepto2.default.extend(this._options, options); + this.updateStyle(); + this.trigger(_events2.default.CONTAINER_OPTIONS_CHANGE); + }; + + Container.prototype.render = function render() { + var s = _styler2.default.getStyleFor(_style2.default); + this.$el.append(s); + this.$el.append(this.playback.render().el); + this.updateStyle(); + return this; + }; + + return Container; +}(_ui_object2.default); // Copyright 2014 Globo.com Player authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/** + * Container is responsible for the video rendering and state + */ + +exports.default = Container; +module.exports = exports['default']; + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(10)(undefined); +// imports + + +// module +exports.push([module.i, ".container[data-container] {\n position: absolute;\n background-color: black;\n height: 100%;\n width: 100%; }\n .container[data-container] .chromeless {\n cursor: default; }\n\n[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled {\n cursor: pointer; }\n", ""]); + +// exports + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); - /** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } +var _stringify = __webpack_require__(139); - /** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } +var _stringify2 = _interopRequireDefault(_stringify); - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } +var _classCallCheck2 = __webpack_require__(0); - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; - } +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); - } +var _possibleConstructorReturn2 = __webpack_require__(1); - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } +var _createClass2 = __webpack_require__(3); - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ - function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; - } +var _createClass3 = _interopRequireDefault(_createClass2); - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } - } +var _inherits2 = __webpack_require__(2); - /** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } +var _inherits3 = _interopRequireDefault(_inherits2); - /** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); - } +var _utils = __webpack_require__(5); - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - this.__data__ = new ListCache(entries); - } +var _vendor = __webpack_require__(56); - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = new ListCache; - } +var _events = __webpack_require__(4); - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - return this.__data__['delete'](key); - } +var _events2 = _interopRequireDefault(_events); - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - return this.__data__.get(key); - } +var _styler = __webpack_require__(7); - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - return this.__data__.has(key); - } +var _styler2 = _interopRequireDefault(_styler); - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ - function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - return this; - } - cache = this.__data__ = new MapCache(pairs); - } - cache.set(key, value); - return this; - } +var _ui_object = __webpack_require__(21); - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - /** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ - function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { - result.push(key); - } - } - return result; - } +var _ui_object2 = _interopRequireDefault(_ui_object); - /** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } +var _browser = __webpack_require__(13); - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = isKey(path, object) ? [path] : castPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; - } +var _browser2 = _interopRequireDefault(_browser); - /** - * The base implementation of `getTag`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - return objectToString.call(value); - } +var _mediator = __webpack_require__(24); - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } +var _mediator2 = _interopRequireDefault(_mediator); - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [bitmask] The bitmask of comparison flags. - * The bitmask may be composed of the following flags: - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, bitmask, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); - } +var _template = __webpack_require__(8); - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = getTag(object); - objTag = objTag == argsTag ? objectTag : objTag; - } - if (!othIsArr) { - othTag = getTag(other); - othTag = othTag == argsTag ? objectTag : othTag; - } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), - isSameTag = objTag == othTag; - - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) - : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); - } - if (!(bitmask & PARTIAL_COMPARE_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, equalFunc, customizer, bitmask, stack); - } +var _template2 = _interopRequireDefault(_template); - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) - : result - )) { - return false; - } - } - } - return true; - } +var _playback = __webpack_require__(9); - /** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } +var _playback2 = _interopRequireDefault(_playback); - /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; - } +var _clapprZepto = __webpack_require__(6); - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); - /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; - } +var _mediaControl = __webpack_require__(141); - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } +var _mediaControl2 = _interopRequireDefault(_mediaControl); - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); - }; - } +var _mediaControl3 = __webpack_require__(142); - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } +var _mediaControl4 = _interopRequireDefault(_mediaControl3); - /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } +var _play = __webpack_require__(58); - /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } +var _play2 = _interopRequireDefault(_play); - /** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @returns {Array} Returns the cast property path array. - */ - function castPath(value) { - return isArray(value) ? value : stringToPath(value); - } +var _pause = __webpack_require__(76); - /** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); - }; +var _pause2 = _interopRequireDefault(_pause); - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; - } - var index = -1, - result = true, - seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!seen.has(othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - return seen.add(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, customizer, bitmask, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } +var _stop = __webpack_require__(143); - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= UNORDERED_COMPARE_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; - } +var _stop2 = _interopRequireDefault(_stop); - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} customizer The function to customize comparisons. - * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` - * for more details. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; - } +var _volume = __webpack_require__(144); - /** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; - } +var _volume2 = _interopRequireDefault(_volume); - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; - } +var _mute = __webpack_require__(145); - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } +var _mute2 = _interopRequireDefault(_mute); - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11, - // for data views in Edge < 14, and promises in Node.js. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : undefined; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; - } +var _expand = __webpack_require__(146); - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - path = isKey(path, object) ? [path] : castPath(path); - - var result, - index = -1, - length = path.length; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result) { - return result; - } - var length = object ? object.length : 0; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); - } +var _expand2 = _interopRequireDefault(_expand); - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); - } +var _shrink = __webpack_require__(147); - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); - } +var _shrink2 = _interopRequireDefault(_shrink); - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); - } +var _hd = __webpack_require__(148); - /** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } +var _hd2 = _interopRequireDefault(_hd); - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } +// 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. - /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; - } +/** + * The MediaControl is responsible for displaying the Player controls. + */ - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoize(function(string) { - string = toString(string); - - var result = []; - if (reLeadingDot.test(string)) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - }); - - /** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } +var MediaControl = function (_UIObject) { + (0, _inherits3.default)(MediaControl, _UIObject); + (0, _createClass3.default)(MediaControl, [{ + key: 'name', + get: function get() { + return 'MediaControl'; + } + }, { + key: 'disabled', + get: function get() { + return this.userDisabled || this.container && this.container.getPlaybackType() === _playback2.default.NO_OP; + } + }, { + key: 'attributes', + get: function get() { + return { + 'class': 'media-control', + 'data-media-control': '' + }; + } + }, { + key: 'events', + get: function get() { + return { + 'click [data-play]': 'play', + 'click [data-pause]': 'pause', + 'click [data-playpause]': 'togglePlayPause', + 'click [data-stop]': 'stop', + 'click [data-playstop]': 'togglePlayStop', + 'click [data-fullscreen]': 'toggleFullscreen', + 'click .bar-container[data-seekbar]': 'seek', + 'click .bar-container[data-volume]': 'onVolumeClick', + 'click .drawer-icon[data-volume]': 'toggleMute', + 'mouseenter .drawer-container[data-volume]': 'showVolumeBar', + 'mouseleave .drawer-container[data-volume]': 'hideVolumeBar', + 'mousedown .bar-container[data-volume]': 'startVolumeDrag', + 'mousemove .bar-container[data-volume]': 'mousemoveOnVolumeBar', + 'mousedown .bar-scrubber[data-seekbar]': 'startSeekDrag', + 'mousemove .bar-container[data-seekbar]': 'mousemoveOnSeekBar', + 'mouseleave .bar-container[data-seekbar]': 'mouseleaveOnSeekBar', + 'mouseenter .media-control-layer[data-controls]': 'setUserKeepVisible', + 'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible' + }; + } + }, { + key: 'template', + get: function get() { + return (0, _template2.default)(_mediaControl4.default); + } + }, { + key: 'stylesheet', + get: function get() { + return _styler2.default.getStyleFor(_mediaControl2.default, { baseUrl: this.options.baseUrl }); + } + }, { + key: 'volume', + get: function get() { + return this.container && this.container.isReady ? this.container.volume : this.intendedVolume; + } + }, { + key: 'muted', + get: function get() { + return this.volume === 0; + } + }]); + + function MediaControl(options) { + (0, _classCallCheck3.default)(this, MediaControl); + + var _this = (0, _possibleConstructorReturn3.default)(this, _UIObject.call(this, options)); + + _this.persistConfig = _this.options.persistConfig; + _this.container = options.container; + _this.currentPositionValue = null; + _this.currentDurationValue = null; + var initialVolume = _this.persistConfig ? _utils.Config.restore('volume') : 100; + _this.setVolume(_this.options.mute ? 0 : initialVolume); + _this.keepVisible = false; + _this.fullScreenOnVideoTagSupported = null; // unknown + _this.addEventListeners(); + _this.settings = { + left: ['play', 'stop', 'pause'], + right: ['volume'], + default: ['position', 'seekbar', 'duration'] + }; + + if (_this.container) { + if (!_clapprZepto2.default.isEmptyObject(_this.container.settings)) { + _this.settings = _clapprZepto2.default.extend({}, _this.container.settings); + } + } else { + _this.settings = {}; + } + + _this.userDisabled = false; + if (_this.container && _this.container.mediaControlDisabled || _this.options.chromeless) { + _this.disable(); + } + _this.stopDragHandler = function (event) { + return _this.stopDrag(event); + }; + _this.updateDragHandler = function (event) { + return _this.updateDrag(event); + }; + (0, _clapprZepto2.default)(document).bind('mouseup', _this.stopDragHandler); + (0, _clapprZepto2.default)(document).bind('mousemove', _this.updateDragHandler); + return _this; + } + + MediaControl.prototype.addEventListeners = function addEventListeners() { + if (this.container) { + _mediator2.default.on(this.options.playerId + ':' + _events2.default.PLAYER_RESIZE, this.playerResize, this); + this.listenTo(this.container, _events2.default.CONTAINER_PLAY, this.changeTogglePlay); + this.listenTo(this.container, _events2.default.CONTAINER_PAUSE, this.changeTogglePlay); + this.listenTo(this.container, _events2.default.CONTAINER_STOP, this.changeTogglePlay); + this.listenTo(this.container, _events2.default.CONTAINER_DBLCLICK, this.toggleFullscreen); + this.listenTo(this.container, _events2.default.CONTAINER_TIMEUPDATE, this.onTimeUpdate); + this.listenTo(this.container, _events2.default.CONTAINER_PROGRESS, this.updateProgressBar); + this.listenTo(this.container, _events2.default.CONTAINER_SETTINGSUPDATE, this.settingsUpdate); + this.listenTo(this.container, _events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.settingsUpdate); + this.listenTo(this.container, _events2.default.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate); + this.listenTo(this.container, _events2.default.CONTAINER_MEDIACONTROL_DISABLE, this.disable); + this.listenTo(this.container, _events2.default.CONTAINER_MEDIACONTROL_ENABLE, this.enable); + this.listenTo(this.container, _events2.default.CONTAINER_ENDED, this.ended); + this.listenTo(this.container, _events2.default.CONTAINER_VOLUME, this.onVolumeChanged); + if (this.container.playback.el.nodeName.toLowerCase() === 'video') { + // wait until the metadata has loaded and then check if fullscreen on video tag is supported + this.listenToOnce(this.container, _events2.default.CONTAINER_LOADEDMETADATA, this.onLoadedMetadataOnVideoTag); + } + } + }; + + MediaControl.prototype.disable = function disable() { + this.userDisabled = true; + this.hide(); + this.$el.hide(); + }; + + MediaControl.prototype.enable = function enable() { + if (this.options.chromeless) return; + this.userDisabled = false; + this.show(); + }; + + MediaControl.prototype.play = function play() { + this.container.play(); + }; + + MediaControl.prototype.pause = function pause() { + this.container.pause(); + }; + + MediaControl.prototype.stop = function stop() { + this.container.stop(); + }; + + MediaControl.prototype.onVolumeChanged = function onVolumeChanged() { + this.updateVolumeUI(); + }; + + MediaControl.prototype.onLoadedMetadataOnVideoTag = function onLoadedMetadataOnVideoTag() { + var video = this.container.playback.el; + // video.webkitSupportsFullscreen is deprecated but iOS appears to only use this + // see https://github.com/clappr/clappr/issues/1127 + if (!_utils.Fullscreen.fullscreenEnabled() && video.webkitSupportsFullscreen) { + this.fullScreenOnVideoTagSupported = true; + this.settingsUpdate(); + } + }; + + MediaControl.prototype.updateVolumeUI = function updateVolumeUI() { + if (!this.rendered) { + // this will be called after a render + return; + } + // update volume bar scrubber/fill on bar mode + this.$volumeBarContainer.find('.bar-fill-2').css({}); + var containerWidth = this.$volumeBarContainer.width(); + var barWidth = this.$volumeBarBackground.width(); + var offset = (containerWidth - barWidth) / 2.0; + var pos = barWidth * this.volume / 100.0 + offset; + this.$volumeBarFill.css({ width: this.volume + '%' }); + this.$volumeBarScrubber.css({ left: pos }); + + // update volume bar segments on segmented bar mode + this.$volumeBarContainer.find('.segmented-bar-element').removeClass('fill'); + var item = Math.ceil(this.volume / 10.0); + this.$volumeBarContainer.find('.segmented-bar-element').slice(0, item).addClass('fill'); + this.$volumeIcon.html(''); + this.$volumeIcon.removeClass('muted'); + if (!this.muted) { + this.$volumeIcon.append(_volume2.default); + } else { + this.$volumeIcon.append(_mute2.default); + this.$volumeIcon.addClass('muted'); + } + this.applyButtonStyle(this.$volumeIcon); + }; + + MediaControl.prototype.changeTogglePlay = function changeTogglePlay() { + this.$playPauseToggle.html(''); + this.$playStopToggle.html(''); + if (this.container && this.container.isPlaying()) { + this.$playPauseToggle.append(_pause2.default); + this.$playStopToggle.append(_stop2.default); + this.trigger(_events2.default.MEDIACONTROL_PLAYING); + } else { + this.$playPauseToggle.append(_play2.default); + this.$playStopToggle.append(_play2.default); + this.trigger(_events2.default.MEDIACONTROL_NOTPLAYING); + if (_browser2.default.isMobile) { + this.show(); + } + } + this.applyButtonStyle(this.$playPauseToggle); + this.applyButtonStyle(this.$playStopToggle); + }; + + MediaControl.prototype.mousemoveOnSeekBar = function mousemoveOnSeekBar(event) { + if (this.settings.seekEnabled) { + var offsetX = event.pageX - this.$seekBarContainer.offset().left - this.$seekBarHover.width() / 2; + this.$seekBarHover.css({ left: offsetX }); + } + this.trigger(_events2.default.MEDIACONTROL_MOUSEMOVE_SEEKBAR, event); + }; + + MediaControl.prototype.mouseleaveOnSeekBar = function mouseleaveOnSeekBar(event) { + this.trigger(_events2.default.MEDIACONTROL_MOUSELEAVE_SEEKBAR, event); + }; + + MediaControl.prototype.onVolumeClick = function onVolumeClick(event) { + this.setVolume(this.getVolumeFromUIEvent(event)); + }; + + MediaControl.prototype.mousemoveOnVolumeBar = function mousemoveOnVolumeBar(event) { + if (this.draggingVolumeBar) { + this.setVolume(this.getVolumeFromUIEvent(event)); + } + }; + + MediaControl.prototype.playerResize = function playerResize(size) { + this.$fullscreenToggle.html(''); + if (_utils.Fullscreen.isFullscreen()) { + this.$fullscreenToggle.append(_shrink2.default); + } else { + this.$fullscreenToggle.append(_expand2.default); + } + this.applyButtonStyle(this.$fullscreenToggle); + this.$el.removeClass('w320'); + if (size.width <= 320 || this.options.hideVolumeBar) { + this.$el.addClass('w320'); + } + }; + + MediaControl.prototype.togglePlayPause = function togglePlayPause() { + if (this.container.isPlaying()) { + this.container.pause(); + } else { + this.container.play(); + } + return false; + }; + + MediaControl.prototype.togglePlayStop = function togglePlayStop() { + if (this.container.isPlaying()) { + this.container.stop(); + } else { + this.container.play(); + } + }; + + MediaControl.prototype.startSeekDrag = function startSeekDrag(event) { + if (!this.settings.seekEnabled) return; + this.draggingSeekBar = true; + this.$el.addClass('dragging'); + this.$seekBarLoaded.addClass('media-control-notransition'); + this.$seekBarPosition.addClass('media-control-notransition'); + this.$seekBarScrubber.addClass('media-control-notransition'); + if (event) { + event.preventDefault(); + } + }; + + MediaControl.prototype.startVolumeDrag = function startVolumeDrag(event) { + this.draggingVolumeBar = true; + this.$el.addClass('dragging'); + if (event) { + event.preventDefault(); + } + }; + + MediaControl.prototype.stopDrag = function stopDrag(event) { + if (this.draggingSeekBar) { + this.seek(event); + } + this.$el.removeClass('dragging'); + this.$seekBarLoaded.removeClass('media-control-notransition'); + this.$seekBarPosition.removeClass('media-control-notransition'); + this.$seekBarScrubber.removeClass('media-control-notransition dragging'); + this.draggingSeekBar = false; + this.draggingVolumeBar = false; + }; + + MediaControl.prototype.updateDrag = function updateDrag(event) { + if (this.draggingSeekBar) { + event.preventDefault(); + var offsetX = event.pageX - this.$seekBarContainer.offset().left; + var pos = offsetX / this.$seekBarContainer.width() * 100; + pos = Math.min(100, Math.max(pos, 0)); + this.setSeekPercentage(pos); + } else if (this.draggingVolumeBar) { + event.preventDefault(); + this.setVolume(this.getVolumeFromUIEvent(event)); + } + }; + + MediaControl.prototype.getVolumeFromUIEvent = function getVolumeFromUIEvent(event) { + var offsetY = event.pageX - this.$volumeBarContainer.offset().left; + var volumeFromUI = offsetY / this.$volumeBarContainer.width() * 100; + return volumeFromUI; + }; + + MediaControl.prototype.toggleMute = function toggleMute() { + this.setVolume(this.muted ? 100 : 0); + }; + + MediaControl.prototype.setVolume = function setVolume(value) { + var _this2 = this; + + value = Math.min(100, Math.max(value, 0)); + // this will hold the intended volume + // it may not actually get set to this straight away + // if the container is not ready etc + this.intendedVolume = value; + this.persistConfig && _utils.Config.persist('volume', value); + var setWhenContainerReady = function setWhenContainerReady() { + if (_this2.container.isReady) { + _this2.container.setVolume(value); + } else { + _this2.listenToOnce(_this2.container, _events2.default.CONTAINER_READY, function () { + _this2.container.setVolume(value); + }); + } + }; + + if (!this.container) { + this.listenToOnce(this, _events2.default.MEDIACONTROL_CONTAINERCHANGED, function () { + setWhenContainerReady(); + }); + } else { + setWhenContainerReady(); + } + }; + + MediaControl.prototype.toggleFullscreen = function toggleFullscreen() { + this.trigger(_events2.default.MEDIACONTROL_FULLSCREEN, this.name); + this.container.fullscreen(); + this.resetUserKeepVisible(); + }; + + MediaControl.prototype.setContainer = function setContainer(container) { + if (this.container) { + this.stopListening(this.container); + this.fullScreenOnVideoTagSupported = null; + } + _mediator2.default.off(this.options.playerId + ':' + _events2.default.PLAYER_RESIZE, this.playerResize, this); + this.container = container; + // set the new container to match the volume of the last one + this.setVolume(this.intendedVolume); + this.changeTogglePlay(); + this.addEventListeners(); + this.settingsUpdate(); + this.container.trigger(_events2.default.CONTAINER_PLAYBACKDVRSTATECHANGED, this.container.isDvrInUse()); + if (this.container.mediaControlDisabled) { + this.disable(); + } + this.trigger(_events2.default.MEDIACONTROL_CONTAINERCHANGED); + }; + + MediaControl.prototype.showVolumeBar = function showVolumeBar() { + if (this.hideVolumeId) { + clearTimeout(this.hideVolumeId); + } + this.$volumeBarContainer.removeClass('volume-bar-hide'); + }; + + MediaControl.prototype.hideVolumeBar = function hideVolumeBar() { + var _this3 = this; + + var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 400; + + if (!this.$volumeBarContainer) return; + if (this.draggingVolumeBar) { + this.hideVolumeId = setTimeout(function () { + return _this3.hideVolumeBar(); + }, timeout); + } else { + if (this.hideVolumeId) { + clearTimeout(this.hideVolumeId); + } + this.hideVolumeId = setTimeout(function () { + return _this3.$volumeBarContainer.addClass('volume-bar-hide'); + }, timeout); + } + }; + + MediaControl.prototype.ended = function ended() { + this.changeTogglePlay(); + }; + + MediaControl.prototype.updateProgressBar = function updateProgressBar(progress) { + var loadedStart = progress.start / progress.total * 100; + var loadedEnd = progress.current / progress.total * 100; + this.$seekBarLoaded.css({ left: loadedStart + '%', width: loadedEnd - loadedStart + '%' }); + }; + + MediaControl.prototype.onTimeUpdate = function onTimeUpdate(timeProgress) { + if (this.draggingSeekBar) return; + // TODO why should current time ever be negative? + var position = timeProgress.current < 0 ? timeProgress.total : timeProgress.current; + + this.currentPositionValue = position; + this.currentDurationValue = timeProgress.total; + this.renderSeekBar(); + }; + + MediaControl.prototype.renderSeekBar = function renderSeekBar() { + if (this.currentPositionValue === null || this.currentDurationValue === null) { + // this will be triggered as soon as these beocome available + return; + } + + // default to 100% + this.currentSeekBarPercentage = 100; + if (this.container.getPlaybackType() !== _playback2.default.LIVE || this.container.isDvrInUse()) { + this.currentSeekBarPercentage = this.currentPositionValue / this.currentDurationValue * 100; + } + this.setSeekPercentage(this.currentSeekBarPercentage); + + var newPosition = (0, _utils.formatTime)(this.currentPositionValue); + var newDuration = (0, _utils.formatTime)(this.currentDurationValue); + if (newPosition !== this.displayedPosition) { + this.$position.text(newPosition); + this.displayedPosition = newPosition; + } + if (newDuration !== this.displayedDuration) { + this.$duration.text(newDuration); + this.displayedDuration = newDuration; + } + }; + + MediaControl.prototype.seek = function seek(event) { + if (!this.settings.seekEnabled) return; + var offsetX = event.pageX - this.$seekBarContainer.offset().left; + var pos = offsetX / this.$seekBarContainer.width() * 100; + pos = Math.min(100, Math.max(pos, 0)); + this.container.seekPercentage(pos); + this.setSeekPercentage(pos); + return false; + }; + + MediaControl.prototype.setKeepVisible = function setKeepVisible() { + this.keepVisible = true; + }; + + MediaControl.prototype.resetKeepVisible = function resetKeepVisible() { + this.keepVisible = false; + }; + + MediaControl.prototype.setUserKeepVisible = function setUserKeepVisible() { + this.userKeepVisible = true; + }; + + MediaControl.prototype.resetUserKeepVisible = function resetUserKeepVisible() { + this.userKeepVisible = false; + }; + + MediaControl.prototype.isVisible = function isVisible() { + return !this.$el.hasClass('media-control-hide'); + }; + + MediaControl.prototype.show = function show(event) { + var _this4 = this; + + if (this.disabled) { + return; + } + var timeout = 2000; + if (!event || event.clientX !== this.lastMouseX && event.clientY !== this.lastMouseY || navigator.userAgent.match(/firefox/i)) { + clearTimeout(this.hideId); + this.$el.show(); + this.trigger(_events2.default.MEDIACONTROL_SHOW, this.name); + this.$el.removeClass('media-control-hide'); + this.hideId = setTimeout(function () { + return _this4.hide(); + }, timeout); + if (event) { + this.lastMouseX = event.clientX; + this.lastMouseY = event.clientY; + } + } + }; + + MediaControl.prototype.hide = function hide() { + var _this5 = this; + + var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + if (!this.isVisible() || _browser2.default.isMobile && !this.container.isPlaying()) { + return; + } + var timeout = delay || 2000; + clearTimeout(this.hideId); + if (!this.disabled && this.options.hideMediaControl === false) { + return; + } + if (!this.disabled && (delay || this.userKeepVisible || this.keepVisible || this.draggingSeekBar || this.draggingVolumeBar)) { + this.hideId = setTimeout(function () { + return _this5.hide(); + }, timeout); + } else { + this.trigger(_events2.default.MEDIACONTROL_HIDE, this.name); + this.$el.addClass('media-control-hide'); + this.hideVolumeBar(0); + } + }; + + MediaControl.prototype.settingsUpdate = function settingsUpdate() { + var newSettings = this.getSettings(); + if (newSettings && !this.fullScreenOnVideoTagSupported && !_utils.Fullscreen.fullscreenEnabled()) { + // remove fullscreen from settings if it is present + newSettings.default && (0, _utils.removeArrayItem)(newSettings.default, 'fullscreen'); + newSettings.left && (0, _utils.removeArrayItem)(newSettings.left, 'fullscreen'); + newSettings.right && (0, _utils.removeArrayItem)(newSettings.right, 'fullscreen'); + } + var settingsChanged = (0, _stringify2.default)(this.settings) !== (0, _stringify2.default)(newSettings); + if (settingsChanged) { + this.settings = newSettings; + this.render(); + } + }; + + MediaControl.prototype.getSettings = function getSettings() { + return _clapprZepto2.default.extend(true, {}, this.container.settings); + }; + + MediaControl.prototype.highDefinitionUpdate = function highDefinitionUpdate(isHD) { + var method = isHD ? 'addClass' : 'removeClass'; + this.$hdIndicator[method]('enabled'); + }; + + MediaControl.prototype.createCachedElements = function createCachedElements() { + var $layer = this.$el.find('.media-control-layer'); + this.$duration = $layer.find('.media-control-indicator[data-duration]'); + this.$fullscreenToggle = $layer.find('button.media-control-button[data-fullscreen]'); + this.$playPauseToggle = $layer.find('button.media-control-button[data-playpause]'); + this.$playStopToggle = $layer.find('button.media-control-button[data-playstop]'); + this.$position = $layer.find('.media-control-indicator[data-position]'); + this.$seekBarContainer = $layer.find('.bar-container[data-seekbar]'); + this.$seekBarHover = $layer.find('.bar-hover[data-seekbar]'); + this.$seekBarLoaded = $layer.find('.bar-fill-1[data-seekbar]'); + this.$seekBarPosition = $layer.find('.bar-fill-2[data-seekbar]'); + this.$seekBarScrubber = $layer.find('.bar-scrubber[data-seekbar]'); + this.$volumeBarContainer = $layer.find('.bar-container[data-volume]'); + this.$volumeContainer = $layer.find('.drawer-container[data-volume]'); + this.$volumeIcon = $layer.find('.drawer-icon[data-volume]'); + this.$volumeBarBackground = this.$el.find('.bar-background[data-volume]'); + this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]'); + this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]'); + this.$hdIndicator = this.$el.find('button.media-control-button[data-hd-indicator]'); + this.resetIndicators(); + this.initializeIcons(); + }; + + MediaControl.prototype.resetIndicators = function resetIndicators() { + this.displayedPosition = this.$position.text(); + this.displayedDuration = this.$duration.text(); + }; + + MediaControl.prototype.initializeIcons = function initializeIcons() { + var $layer = this.$el.find('.media-control-layer'); + $layer.find('button.media-control-button[data-play]').append(_play2.default); + $layer.find('button.media-control-button[data-pause]').append(_pause2.default); + $layer.find('button.media-control-button[data-stop]').append(_stop2.default); + this.$playPauseToggle.append(_play2.default); + this.$playStopToggle.append(_play2.default); + this.$volumeIcon.append(_volume2.default); + this.$fullscreenToggle.append(_expand2.default); + this.$hdIndicator.append(_hd2.default); + }; + + MediaControl.prototype.setSeekPercentage = function setSeekPercentage(value) { + value = Math.max(Math.min(value, 100.0), 0); + if (this.displayedSeekBarPercentage === value) { + // not changed since last update + return; + } + this.displayedSeekBarPercentage = value; + + this.$seekBarPosition.removeClass('media-control-notransition'); + this.$seekBarScrubber.removeClass('media-control-notransition'); + this.$seekBarPosition.css({ width: value + '%' }); + this.$seekBarScrubber.css({ left: value + '%' }); + }; + + MediaControl.prototype.seekRelative = function seekRelative(delta) { + if (!this.settings.seekEnabled) return; + var currentTime = this.container.getCurrentTime(); + var duration = this.container.getDuration(); + var position = Math.min(Math.max(currentTime + delta, 0), duration); + position = Math.min(position * 100 / duration, 100); + this.container.seekPercentage(position); + }; + + MediaControl.prototype.bindKeyAndShow = function bindKeyAndShow(key, cb) { + var _this6 = this; + + this.kibo.down(key, function () { + _this6.show(); + return cb(); + }); + }; + + MediaControl.prototype.bindKeyEvents = function bindKeyEvents() { + var _this7 = this; + + this.unbindKeyEvents(); + this.kibo = new _vendor.Kibo(this.options.focusElement); + + this.bindKeyAndShow('space', function () { + return _this7.togglePlayPause(); + }); + this.bindKeyAndShow('left', function () { + return _this7.seekRelative(-5); + }); + this.bindKeyAndShow('right', function () { + return _this7.seekRelative(5); + }); + this.bindKeyAndShow('shift left', function () { + return _this7.seekRelative(-10); + }); + this.bindKeyAndShow('shift right', function () { + return _this7.seekRelative(10); + }); + this.bindKeyAndShow('shift ctrl left', function () { + return _this7.seekRelative(-15); + }); + this.bindKeyAndShow('shift ctrl right', function () { + return _this7.seekRelative(15); + }); + // this.kibo.down(['']) // should it be here? + var keys = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']; + keys.forEach(function (i) { + _this7.bindKeyAndShow(i, function () { + return _this7.settings.seekEnabled && _this7.container.seekPercentage(i * 10); + }); + }); + }; + + MediaControl.prototype.unbindKeyEvents = function unbindKeyEvents() { + if (this.kibo) { + this.kibo.off('space'); + this.kibo.off('left'); + this.kibo.off('right'); + this.kibo.off('shift left'); + this.kibo.off('shift right'); + this.kibo.off('shift ctrl left'); + this.kibo.off('shift ctrl right'); + this.kibo.off(['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']); + } + }; + + MediaControl.prototype.parseColors = function parseColors() { + if (this.options.mediacontrol) { + this.buttonsColor = this.options.mediacontrol.buttons; + var seekbarColor = this.options.mediacontrol.seekbar; + this.$el.find('.bar-fill-2[data-seekbar]').css('background-color', seekbarColor); + this.$el.find('.media-control-icon svg path').css('fill', this.buttonsColor); + this.$el.find('.segmented-bar-element[data-volume]').css('boxShadow', 'inset 2px 0 0 ' + this.buttonsColor); + } + }; + + MediaControl.prototype.applyButtonStyle = function applyButtonStyle(element) { + if (this.buttonsColor && element) { + (0, _clapprZepto2.default)(element).find('svg path').css('fill', this.buttonsColor); + } + }; + + MediaControl.prototype.destroy = function destroy() { + this.remove(); + (0, _clapprZepto2.default)(document).unbind('mouseup', this.stopDragHandler); + (0, _clapprZepto2.default)(document).unbind('mousemove', this.updateDragHandler); + this.unbindKeyEvents(); + }; + + MediaControl.prototype.render = function render() { + var _this8 = this; + + var timeout = 1000; + this.$el.html(this.template({ settings: this.settings })); + this.$el.append(this.stylesheet); + this.createCachedElements(); + this.$playPauseToggle.addClass('paused'); + this.$playStopToggle.addClass('stopped'); + + this.changeTogglePlay(); + this.hideId = setTimeout(function () { + return _this8.hide(); + }, timeout); + if (this.disabled) { + this.hide(); + } + + // Video volume cannot be changed with Safari on mobile devices + // Display mute/unmute icon only if Safari version >= 10 + if (_browser2.default.isSafari && _browser2.default.isMobile) { + if (_browser2.default.version < 10) { + this.$volumeContainer.css('display', 'none'); + } else { + this.$volumeBarContainer.css('display', 'none'); + } + } + + this.$seekBarPosition.addClass('media-control-notransition'); + this.$seekBarScrubber.addClass('media-control-notransition'); + + var previousSeekPercentage = 0; + if (this.displayedSeekBarPercentage) { + previousSeekPercentage = this.displayedSeekBarPercentage; + } + this.displayedSeekBarPercentage = null; + this.setSeekPercentage(previousSeekPercentage); + + process.nextTick(function () { + if (!_this8.settings.seekEnabled) { + _this8.$seekBarContainer.addClass('seek-disabled'); + } + if (!_browser2.default.isMobile && !_this8.options.disableKeyboardShortcuts) { + _this8.bindKeyEvents(); + } + _this8.playerResize({ width: _this8.options.width, height: _this8.options.height }); + _this8.hideVolumeBar(0); + }); + + this.parseColors(); + this.highDefinitionUpdate(); + + this.rendered = true; + this.updateVolumeUI(); + this.trigger(_events2.default.MEDIACONTROL_RENDERED); + return this; + }; + + return MediaControl; +}(_ui_object2.default); + +exports.default = MediaControl; - /** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee=_.identity] - * The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniqBy(array, iteratee) { - return (array && array.length) - ? baseUniq(array, baseIteratee(iteratee, 2)) - : []; - } +MediaControl.extend = function (properties) { + return (0, _utils.extend)(MediaControl, properties); +}; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(57))) - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided, it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoized function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { - // Assign cache to `_.memoize`. - memoize.Cache = MapCache; - - /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } +module.exports = { "default": __webpack_require__(140), __esModule: true }; - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } +var core = __webpack_require__(11) + , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify}); +module.exports = function stringify(it){ // eslint-disable-line no-unused-vars + return $JSON.stringify.apply($JSON, arguments); +}; - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } +exports = module.exports = __webpack_require__(10)(undefined); +// imports - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - /** - * 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'); - } +// module +exports.push([module.i, ".media-control-notransition {\n -webkit-transition: none !important;\n -moz-transition: none !important;\n transition: none !important; }\n\n.media-control[data-media-control] {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 9999;\n pointer-events: none; }\n .media-control[data-media-control].dragging {\n pointer-events: auto;\n cursor: -webkit-grabbing !important;\n cursor: grabbing !important;\n cursor: url(" + __webpack_require__(75) + "), move; }\n .media-control[data-media-control].dragging * {\n cursor: -webkit-grabbing !important;\n cursor: grabbing !important;\n cursor: url(" + __webpack_require__(75) + "), move; }\n .media-control[data-media-control] .media-control-background[data-background] {\n position: absolute;\n height: 40%;\n width: 100%;\n bottom: 0;\n background: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n -webkit-transition: opacity 0.6s ease-out;\n -moz-transition: opacity 0.6s ease-out;\n transition: opacity 0.6s ease-out; }\n .media-control[data-media-control] .media-control-icon {\n line-height: 0;\n letter-spacing: 0;\n speak: none;\n color: #fff;\n opacity: 0.5;\n vertical-align: middle;\n text-align: left;\n -webkit-transition: all 0.1s ease;\n -moz-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .media-control[data-media-control] .media-control-icon:hover {\n color: white;\n opacity: 0.75;\n text-shadow: rgba(255, 255, 255, 0.8) 0 0 5px; }\n .media-control[data-media-control].media-control-hide .media-control-background[data-background] {\n opacity: 0; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] {\n bottom: -50px; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] {\n position: absolute;\n bottom: 7px;\n width: 100%;\n height: 32px;\n font-size: 0;\n vertical-align: middle;\n pointer-events: auto;\n -webkit-transition: bottom 0.4s ease-out;\n -moz-transition: bottom 0.4s ease-out;\n transition: bottom 0.4s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control] {\n position: absolute;\n top: 0;\n left: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control] {\n height: 100%;\n text-align: center;\n line-height: 32px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control] {\n position: absolute;\n top: 0;\n right: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button {\n background-color: transparent;\n border: 0;\n margin: 0 6px;\n padding: 0;\n cursor: pointer;\n display: inline-block;\n width: 32px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg {\n width: 100%;\n height: 22px; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus {\n outline: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen] {\n float: right;\n background-color: transparent;\n border: 0;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator] {\n background-color: transparent;\n border: 0;\n cursor: default;\n display: none;\n float: right;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled {\n display: block;\n opacity: 1.0; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover {\n opacity: 1.0;\n text-shadow: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position], .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n display: inline-block;\n font-size: 10px;\n color: white;\n cursor: default;\n line-height: 32px;\n position: relative; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position] {\n margin: 0 6px 0 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n color: rgba(255, 255, 255, 0.5);\n margin-right: 6px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before {\n content: \"|\";\n margin-right: 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] {\n position: absolute;\n top: -20px;\n left: 0;\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n height: 25px;\n cursor: pointer; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] {\n width: 100%;\n height: 1px;\n position: relative;\n top: 12px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n -webkit-transition: opacity 0.1s ease;\n -moz-transition: opacity 0.1s ease;\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled {\n cursor: default; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n position: absolute;\n -webkit-transform: translateX(-50%);\n -moz-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n -o-transform: translateX(-50%);\n transform: translateX(-50%);\n top: 2px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] {\n float: right;\n display: inline-block;\n height: 32px;\n cursor: pointer;\n margin: 0 6px;\n box-sizing: border-box; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] {\n float: left;\n bottom: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] {\n background-color: transparent;\n border: 0;\n box-sizing: content-box;\n width: 32px;\n height: 32px;\n opacity: 0.5; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover {\n opacity: 0.75; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg {\n height: 24px;\n position: relative;\n top: 3px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg {\n margin-left: 2px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] {\n float: left;\n position: relative;\n overflow: hidden;\n top: 6px;\n width: 42px;\n height: 18px;\n padding: 3px 0;\n -webkit-transition: width 0.2s ease-out;\n -moz-transition: width 0.2s ease-out;\n transition: width 0.2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] {\n height: 1px;\n position: relative;\n top: 7px;\n margin: 0 3px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n -webkit-transition: opacity 0.1s ease;\n -moz-transition: opacity 0.1s ease;\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] {\n position: absolute;\n -webkit-transform: translateX(-50%);\n -moz-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n -o-transform: translateX(-50%);\n transform: translateX(-50%);\n top: 0px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n -webkit-transition: all 0.1s ease-out;\n -moz-transition: all 0.1s ease-out;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume] {\n float: left;\n width: 4px;\n padding-left: 2px;\n height: 12px;\n opacity: 0.5;\n box-shadow: inset 2px 0 0 white;\n -webkit-transition: -webkit-transform 0.2s ease-out;\n -moz-transition: -moz-transform 0.2s ease-out;\n transition: transform 0.2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill {\n box-shadow: inset 2px 0 0 #fff;\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1) {\n padding-left: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover {\n -webkit-transform: scaleY(1.5);\n -moz-transform: scaleY(1.5);\n -ms-transform: scaleY(1.5);\n -o-transform: scaleY(1.5);\n transform: scaleY(1.5); }\n .media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide {\n width: 0;\n height: 12px;\n top: 9px;\n padding: 0; }\n", ""]); - /** - * 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'; - } +// exports - /** - * 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); - } - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - - /** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } +/***/ }), +/* 142 */ +/***/ (function(module, exports) { - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is returned in its place. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } +module.exports = "
\n
\n <% var renderBar = function(name) { %>\n
>\n
>\n
>
\n
>
\n
>
\n
\n
>\n
>
\n
\n
\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n
>\n <% for (var i = 0; i < segments; i++) { %>\n
>
\n <% } %>\n
\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n
>\n
>\n
>
\n >\n
\n <% renderContent(name); %>\n
\n <% }; %>\n <% var renderIndicator = function(name) { %>\n
>
\n <% }; %>\n <% var renderButton = function(name) { %>\n \n <% }; %>\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function(settingsList) {\n settingsList.forEach(function(setting) {\n if(setting === \"seekbar\") {\n renderBar(setting);\n } else if (setting === \"volume\") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\n } else if (setting === \"duration\" || setting === \"position\") {\n renderIndicator(setting);\n } else {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.default && settings.default.length) { %>\n
\n <% render(settings.default); %>\n
\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n
\n <% render(settings.left); %>\n
\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n
\n <% render(settings.right); %>\n
\n <% } %>\n
\n"; - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } +/***/ }), +/* 143 */ +/***/ (function(module, exports) { - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } +module.exports = "" - /** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ - function identity(value) { - return value; - } +/***/ }), +/* 144 */ +/***/ (function(module, exports) { - /** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ - function noop() { - // No operation performed. - } +module.exports = "" - /** - * Creates a function that returns the value at `path` of a given object. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - * @example - * - * var objects = [ - * { 'a': { 'b': 2 } }, - * { 'a': { 'b': 1 } } - * ]; - * - * _.map(objects, _.property('a.b')); - * // => [2, 1] - * - * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); - * // => [1, 2] - */ - function property(path) { - return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); - } +/***/ }), +/* 145 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 146 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 147 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 148 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(10)(undefined); +// imports + + +// module +exports.push([module.i, "@font-face {\n font-family: \"Roboto\";\n font-style: normal;\n font-weight: 400;\n src: local(\"Roboto\"), local(\"Roboto-Regular\"), url(" + __webpack_require__(150) + ") format(\"truetype\"); }\n\n[data-player] {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-transform: translate3d(0, 0, 0);\n -moz-transform: translate3d(0, 0, 0);\n -ms-transform: translate3d(0, 0, 0);\n -o-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n position: relative;\n margin: 0;\n padding: 0;\n border: 0;\n font-style: normal;\n font-weight: normal;\n text-align: center;\n overflow: hidden;\n font-size: 100%;\n font-family: \"Roboto\", \"Open Sans\", Arial, sans-serif;\n text-shadow: 0 0 0;\n box-sizing: border-box; }\n [data-player] div, [data-player] span, [data-player] applet, [data-player] object, [data-player] iframe,\n [data-player] h1, [data-player] h2, [data-player] h3, [data-player] h4, [data-player] h5, [data-player] h6, [data-player] p, [data-player] blockquote, [data-player] pre,\n [data-player] a, [data-player] abbr, [data-player] acronym, [data-player] address, [data-player] big, [data-player] cite, [data-player] code,\n [data-player] del, [data-player] dfn, [data-player] em, [data-player] img, [data-player] ins, [data-player] kbd, [data-player] q, [data-player] s, [data-player] samp,\n [data-player] small, [data-player] strike, [data-player] strong, [data-player] sub, [data-player] sup, [data-player] tt, [data-player] var,\n [data-player] b, [data-player] u, [data-player] i, [data-player] center,\n [data-player] dl, [data-player] dt, [data-player] dd, [data-player] ol, [data-player] ul, [data-player] li,\n [data-player] fieldset, [data-player] form, [data-player] label, [data-player] legend,\n [data-player] table, [data-player] caption, [data-player] tbody, [data-player] tfoot, [data-player] thead, [data-player] tr, [data-player] th, [data-player] td,\n [data-player] article, [data-player] aside, [data-player] canvas, [data-player] details, [data-player] embed,\n [data-player] figure, [data-player] figcaption, [data-player] footer, [data-player] header, [data-player] hgroup,\n [data-player] menu, [data-player] nav, [data-player] output, [data-player] ruby, [data-player] section, [data-player] summary,\n [data-player] time, [data-player] mark, [data-player] audio, [data-player] video {\n margin: 0;\n padding: 0;\n border: 0;\n font: inherit;\n font-size: 100%;\n vertical-align: baseline; }\n [data-player] table {\n border-collapse: collapse;\n border-spacing: 0; }\n [data-player] caption, [data-player] th, [data-player] td {\n text-align: left;\n font-weight: normal;\n vertical-align: middle; }\n [data-player] q, [data-player] blockquote {\n quotes: none; }\n [data-player] q:before, [data-player] q:after, [data-player] blockquote:before, [data-player] blockquote:after {\n content: \"\";\n content: none; }\n [data-player] a img {\n border: none; }\n [data-player]:focus {\n outline: 0; }\n [data-player] * {\n max-width: none;\n box-sizing: inherit;\n float: none; }\n [data-player] div {\n display: block; }\n [data-player].fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0;\n left: 0; }\n [data-player].nocursor {\n cursor: none; }\n\n.clappr-style {\n display: none !important; }\n", ""]); + +// exports + + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__.p + "38861cba61c66739c1452c3a71e39852.ttf"; + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _create = __webpack_require__(71); + +var _create2 = _interopRequireDefault(_create); + +var _classCallCheck2 = __webpack_require__(0); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _possibleConstructorReturn2 = __webpack_require__(1); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _inherits2 = __webpack_require__(2); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _base_object = __webpack_require__(17); + +var _base_object2 = _interopRequireDefault(_base_object); + +var _player_info = __webpack_require__(34); + +var _player_info2 = _interopRequireDefault(_player_info); + +var _html5_video = __webpack_require__(35); + +var _html5_video2 = _interopRequireDefault(_html5_video); + +var _flash = __webpack_require__(80); + +var _flash2 = _interopRequireDefault(_flash); + +var _html5_audio = __webpack_require__(81); + +var _html5_audio2 = _interopRequireDefault(_html5_audio); + +var _flashls = __webpack_require__(82); + +var _flashls2 = _interopRequireDefault(_flashls); + +var _hls = __webpack_require__(83); + +var _hls2 = _interopRequireDefault(_hls); + +var _html_img = __webpack_require__(84); + +var _html_img2 = _interopRequireDefault(_html_img); + +var _no_op = __webpack_require__(85); + +var _no_op2 = _interopRequireDefault(_no_op); + +var _spinner_three_bounce = __webpack_require__(179); + +var _spinner_three_bounce2 = _interopRequireDefault(_spinner_three_bounce); + +var _stats = __webpack_require__(183); + +var _stats2 = _interopRequireDefault(_stats); + +var _watermark = __webpack_require__(185); + +var _watermark2 = _interopRequireDefault(_watermark); + +var _poster = __webpack_require__(86); + +var _poster2 = _interopRequireDefault(_poster); + +var _google_analytics = __webpack_require__(192); + +var _google_analytics2 = _interopRequireDefault(_google_analytics); + +var _click_to_pause = __webpack_require__(194); + +var _click_to_pause2 = _interopRequireDefault(_click_to_pause); + +var _dvr_controls = __webpack_require__(196); + +var _dvr_controls2 = _interopRequireDefault(_dvr_controls); + +var _closed_captions = __webpack_require__(200); + +var _closed_captions2 = _interopRequireDefault(_closed_captions); + +var _favicon = __webpack_require__(205); + +var _favicon2 = _interopRequireDefault(_favicon); + +var _seek_time = __webpack_require__(207); + +var _seek_time2 = _interopRequireDefault(_seek_time); + +var _sources = __webpack_require__(211); + +var _sources2 = _interopRequireDefault(_sources); + +var _end_video = __webpack_require__(212); + +var _end_video2 = _interopRequireDefault(_end_video); + +var _strings = __webpack_require__(213); + +var _strings2 = _interopRequireDefault(_strings); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * It keeps a list of the default plugins (playback, container, core) and it merges external plugins with its internals. + * @class Loader + * @constructor + * @extends BaseObject + * @module components + */ + + +/* Playback Plugins */ +// 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 Loader = function (_BaseObject) { + (0, _inherits3.default)(Loader, _BaseObject); + + /** + * builds the loader + * @method constructor + * @param {Object} externalPlugins the external plugins + * @param {Number} playerId you can embed multiple instances of clappr, therefore this is the unique id of each one. + */ + function Loader(externalPlugins, playerId) { + (0, _classCallCheck3.default)(this, Loader); + + var _this = (0, _possibleConstructorReturn3.default)(this, _BaseObject.call(this)); + + _this.playerId = playerId; + _this.playbackPlugins = [_hls2.default, _html5_video2.default, _html5_audio2.default, _flash2.default, _flashls2.default, _html_img2.default, _no_op2.default]; + _this.containerPlugins = [_spinner_three_bounce2.default, _watermark2.default, _poster2.default, _stats2.default, _google_analytics2.default, _click_to_pause2.default]; + _this.corePlugins = [_dvr_controls2.default, _closed_captions2.default, _favicon2.default, _seek_time2.default, _sources2.default, _end_video2.default, _strings2.default]; + if (externalPlugins) { + if (!Array.isArray(externalPlugins)) { + _this.validateExternalPluginsType(externalPlugins); + } + _this.addExternalPlugins(externalPlugins); + } + return _this; + } + + /** + * groups by type the external plugins that were passed through `options.plugins` it they're on a flat array + * @method addExternalPlugins + * @private + * @param {Object} an config object or an array of plugins + * @return {Object} plugins the config object with the plugins separated by type + */ + + + Loader.prototype.groupPluginsByType = function groupPluginsByType(plugins) { + if (Array.isArray(plugins)) { + plugins = plugins.reduce(function (memo, plugin) { + memo[plugin.type] || (memo[plugin.type] = []); + memo[plugin.type].push(plugin); + return memo; + }, {}); + } + return plugins; + }; + + Loader.prototype.removeDups = function removeDups(list) { + var groupUp = function groupUp(plugins, plugin) { + plugins[plugin.prototype.name] && delete plugins[plugin.prototype.name]; + plugins[plugin.prototype.name] = plugin; + return plugins; + }; + var pluginsMap = list.reduceRight(groupUp, (0, _create2.default)(null)); + + var plugins = []; + for (var key in pluginsMap) { + plugins.unshift(pluginsMap[key]); + } + return plugins; + }; + + /** + * adds all the external plugins that were passed through `options.plugins` + * @method addExternalPlugins + * @private + * @param {Object} plugins the config object with all plugins + */ + + + Loader.prototype.addExternalPlugins = function addExternalPlugins(plugins) { + plugins = this.groupPluginsByType(plugins); + if (plugins.playback) { + this.playbackPlugins = this.removeDups(plugins.playback.concat(this.playbackPlugins)); + } + if (plugins.container) { + this.containerPlugins = this.removeDups(plugins.container.concat(this.containerPlugins)); + } + if (plugins.core) { + this.corePlugins = this.removeDups(plugins.core.concat(this.corePlugins)); + } + + _player_info2.default.getInstance(this.playerId).playbackPlugins = this.playbackPlugins; + }; + + /** + * validate if the external plugins that were passed through `options.plugins` are associated to the correct type + * @method validateExternalPluginsType + * @private + * @param {Object} plugins the config object with all plugins + */ + + + Loader.prototype.validateExternalPluginsType = function validateExternalPluginsType(plugins) { + var plugintypes = ['playback', 'container', 'core']; + plugintypes.forEach(function (type) { + (plugins[type] || []).forEach(function (el) { + var errorMessage = 'external ' + el.type + ' plugin on ' + type + ' array'; + if (el.type !== type) { + throw new ReferenceError(errorMessage); + } + }); + }); + }; + + return Loader; +}(_base_object2.default); + +/* Core Plugins */ + + +/* Container Plugins */ + + +exports.default = Loader; +module.exports = exports['default']; + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _from = __webpack_require__(78); + +var _from2 = _interopRequireDefault(_from); + +var _classCallCheck2 = __webpack_require__(0); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _possibleConstructorReturn2 = __webpack_require__(1); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _createClass2 = __webpack_require__(3); + +var _createClass3 = _interopRequireDefault(_createClass2); + +var _inherits2 = __webpack_require__(2); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _toConsumableArray2 = __webpack_require__(79); + +var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); + +var _keys = __webpack_require__(31); + +var _keys2 = _interopRequireDefault(_keys); + +var _utils = __webpack_require__(5); + +var _playback = __webpack_require__(9); + +var _playback2 = _interopRequireDefault(_playback); + +var _styler = __webpack_require__(7); + +var _styler2 = _interopRequireDefault(_styler); + +var _browser = __webpack_require__(13); + +var _browser2 = _interopRequireDefault(_browser); + +var _events = __webpack_require__(4); + +var _events2 = _interopRequireDefault(_events); + +var _style = __webpack_require__(161); + +var _style2 = _interopRequireDefault(_style); + +var _clapprZepto = __webpack_require__(6); + +var _clapprZepto2 = _interopRequireDefault(_clapprZepto); - module.exports = uniqBy; +var _template = __webpack_require__(8); - /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(33)(module))) +var _template2 = _interopRequireDefault(_template); -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { +var _tracks = __webpack_require__(162); - 'use strict'; +var _tracks2 = _interopRequireDefault(_tracks); - module.exports = __webpack_require__(52); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { +var MIMETYPES = { + 'mp4': ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(function (codec) { + return 'video/mp4; codecs="' + codec + ', mp4a.40.2"'; + }), + 'ogg': ['video/ogg; codecs="theora, vorbis"', 'video/ogg; codecs="dirac"', 'video/ogg; codecs="theora, speex"'], + '3gpp': ['video/3gpp; codecs="mp4v.20.8, samr"'], + 'webm': ['video/webm; codecs="vp8, vorbis"'], + 'mkv': ['video/x-matroska; codecs="theora, vorbis"'], + 'm3u8': ['application/x-mpegurl'] +}; // 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. - /* WEBPACK VAR INJECTION */(function(process) {'use strict'; +MIMETYPES['ogv'] = MIMETYPES['ogg']; +MIMETYPES['3gp'] = MIMETYPES['3gpp']; - Object.defineProperty(exports, "__esModule", { - value: true - }); +var AUDIO_MIMETYPES = { + 'wav': ['audio/wav'], + 'mp3': ['audio/mp3', 'audio/mpeg;codecs="mp3"'], + 'aac': ['audio/mp4;codecs="mp4a.40.5"'], + 'oga': ['audio/ogg'] +}; + +var KNOWN_AUDIO_MIMETYPES = (0, _keys2.default)(AUDIO_MIMETYPES).reduce(function (acc, k) { + return [].concat((0, _toConsumableArray3.default)(acc), (0, _toConsumableArray3.default)(AUDIO_MIMETYPES[k])); +}, []); - 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; }; }(); +// TODO: rename this Playback to HTML5Playback (breaking change, only after 0.3.0) - var _utils = __webpack_require__(2); +var HTML5Video = function (_Playback) { + (0, _inherits3.default)(HTML5Video, _Playback); + (0, _createClass3.default)(HTML5Video, [{ + key: 'name', + get: function get() { + return 'html5_video'; + } + }, { + key: 'tagName', + get: function get() { + return this.isAudioOnly ? 'audio' : 'video'; + } + }, { + key: 'isAudioOnly', + get: function get() { + var resourceUrl = this.options.src; + var mimeTypes = HTML5Video._mimeTypesForUrl(resourceUrl, AUDIO_MIMETYPES, this.options.mimeType); + return this.options.playback && this.options.playback.audioOnly || this.options.audioOnly || KNOWN_AUDIO_MIMETYPES.indexOf(mimeTypes[0]) >= 0; + } + }, { + key: 'attributes', + get: function get() { + return { + 'data-html5-video': '' + }; + } + }, { + key: 'events', + get: function get() { + return { + 'canplay': '_onCanPlay', + 'canplaythrough': '_handleBufferingEvents', + 'durationchange': '_onDurationChange', + 'ended': '_onEnded', + 'error': '_onError', + 'loadeddata': '_onLoadedData', + 'loadedmetadata': '_onLoadedMetadata', + 'pause': '_onPause', + 'playing': '_onPlaying', + 'progress': '_onProgress', + 'seeked': '_handleBufferingEvents', + 'seeking': '_handleBufferingEvents', + 'stalled': '_handleBufferingEvents', + 'timeupdate': '_onTimeUpdate', + 'waiting': '_onWaiting' + }; + } + + /** + * Determine if the playback has ended. + * @property ended + * @type Boolean + */ + + }, { + key: 'ended', + get: function get() { + return this.el.ended; + } + + /** + * Determine if the playback is having to buffer in order for + * playback to be smooth. + * This is related to the PLAYBACK_BUFFERING and PLAYBACK_BUFFERFULL events + * @property buffering + * @type Boolean + */ + + }, { + key: 'buffering', + get: function get() { + return !!this._bufferingState; + } + }]); + + function HTML5Video() { + (0, _classCallCheck3.default)(this, HTML5Video); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var _this = (0, _possibleConstructorReturn3.default)(this, _Playback.call.apply(_Playback, [this].concat(args))); + + _this._destroyed = false; + _this._loadStarted = false; + _this._playheadMoving = false; + _this._playheadMovingTimer = null; + _this._stopped = false; + _this._ccTrackId = -1; + _this._setupSrc(_this.options.src); + // backwards compatibility (TODO: remove on 0.3.0) + _this.options.playback || (_this.options.playback = _this.options || {}); + _this.options.playback.disableContextMenu = _this.options.playback.disableContextMenu || _this.options.disableVideoTagContextMenu; + + var playbackConfig = _this.options.playback; + var preload = playbackConfig.preload || (_browser2.default.isSafari ? 'auto' : _this.options.preload); + + var posterUrl = void 0; // FIXME: poster plugin should always convert poster to object with expected properties ? + if (_this.options.poster) { + if (typeof _this.options.poster === 'string') { + posterUrl = _this.options.poster; + } else if (typeof _this.options.poster.url === 'string') { + posterUrl = _this.options.poster.url; + } + } + + _clapprZepto2.default.extend(_this.el, { + loop: _this.options.loop, + poster: posterUrl, + preload: preload || 'metadata', + controls: (playbackConfig.controls || _this.options.useVideoTagDefaultControls) && 'controls', + crossOrigin: playbackConfig.crossOrigin, + 'x-webkit-playsinline': playbackConfig.playInline + }); + + playbackConfig.playInline && _this.$el.attr({ playsinline: 'playsinline' }); + playbackConfig.crossOrigin && _this.$el.attr({ crossorigin: playbackConfig.crossOrigin }); + + // TODO should settings be private? + _this.settings = { default: ['seekbar'] }; + _this.settings.left = ['playpause', 'position', 'duration']; + _this.settings.right = ['fullscreen', 'volume', 'hd-indicator']; + + playbackConfig.externalTracks && _this._setupExternalTracks(playbackConfig.externalTracks); + + // https://github.com/clappr/clappr/issues/1076 + _this.options.autoPlay && process.nextTick(function () { + return !_this._destroyed && _this.play(); + }); + return _this; + } + + HTML5Video.prototype._setupExternalTracks = function _setupExternalTracks(tracks) { + this._externalTracks = tracks.map(function (track) { + return { + kind: track.kind || 'subtitles', // Default is 'subtitles' + label: track.label, + lang: track.lang, + src: track.src + }; + }); + }; + + /** + * Sets the source url on the