From cfc0e2c9f510de6614d08f8f571b3de21bac1043 Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Sun, 27 May 2018 20:12:25 +0100 Subject: [PATCH] 1.6.2 --- CHANGELOG.md | 5 +++++ dist/ReactPlayer.js | 2 +- dist/ReactPlayer.js.map | 2 +- dist/ReactPlayer.standalone.js | 2 +- dist/ReactPlayer.standalone.js.map | 2 +- package.json | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a55c8924..2bfa3342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v1.6.2](https://github.com/CookPete/react-player/compare/v1.6.1...v1.6.2) +> 27 May 2018 +- Pass instance through to onReady callback [`#407`](https://github.com/CookPete/react-player/issues/407) +- Mute preload players [`16f5fcb`](https://github.com/CookPete/react-player/commit/16f5fcb6bfdda69702d0741c7587218cf7f62d6f) + #### [v1.6.1](https://github.com/CookPete/react-player/compare/v1.6.0...v1.6.1) > 20 May 2018 - Bump HLS.js [`#403`](https://github.com/CookPete/react-player/pull/403) diff --git a/dist/ReactPlayer.js b/dist/ReactPlayer.js index 67f9b2f8..ee287222 100644 --- a/dist/ReactPlayer.js +++ b/dist/ReactPlayer.js @@ -1,2 +1,2 @@ -var ReactPlayer=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=10)}([function(e,t){e.exports=React},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=e.match(k);if(t){var n=t[1];if(n.match(O))return i(n);if(_.test(n))return parseInt(n,10)}return 0}function i(e){for(var t=0,n=O.exec(e);null!==n;){var r=n,o=v(r,3),a=o[1],i=o[2];"h"===i&&(t+=60*parseInt(a,10)*60),"m"===i&&(t+=60*parseInt(a,10)),"s"===i&&(t+=parseInt(a,10)),n=O.exec(e)}return t}function l(){return Math.random().toString(36).substr(2,5)}function u(e){return Object.keys(e).map(function(t){return t+"="+e[t]}).join("&")}function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise(function(r,o){if(E[e])return void E[e].push(r);E[e]=[r];var a=function(t){E[e].forEach(function(e){return e(t)})};if(n){var i=window[n];window[n]=function(){i&&i(),a(window[t])}}(0,b.default)(e,function(e){e&&o(e),n||a(window[t])})})}function c(e,t,n){var r=(0,P.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=w.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=u.value;if(e[c]){var p=c.replace(/Config$/,"");if(r=(0,P.default)(r,o({},p,e[c])),n){var f="ReactPlayer: %c"+c+" %cis deprecated, please use the config prop instead – https://github.com/CookPete/react-player#config-prop";console.warn(f,"font-weight: bold","")}}}}catch(e){i=!0,l=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw l}}return r}function p(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:"player";return r.player?r.player.getInternalPlayer(e):null},r.seekTo=function(e){if(!r.player)return null;r.player.seekTo(e)},r.ref=function(e){r.player=e},i=t,a(r,i)}return i(n,t),s(n,[{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,y.getConfig)(e,f.defaultProps)}},{key:"render",value:function(){if(!e.canPlay(this.props.url))return null;var t=this.props,n=t.style,r=t.width,o=t.height,a=t.wrapper,i=(0,y.omit)(this.props,v,f.DEPRECATED_CONFIG_PROPS);return p.default.createElement(a,u({style:u({},n,{width:r,height:o})},i),p.default.createElement(h.default,u({},this.props,{ref:this.ref,activePlayer:e,config:(0,y.getConfig)(this.props,f.defaultProps)})))}}]),n}(c.Component),t.displayName=e.displayName+"Player",t.propTypes=f.propTypes,t.defaultProps=f.defaultProps,t.canPlay=e.canPlay,n}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t0&&e<1){var n=this.player.getDuration();return n?void this.player.seekTo(n*e):void console.warn("ReactPlayer: could not seek using fraction – duration not yet available")}this.player.seekTo(e)}},{key:"render",value:function(){var e=this.props.activePlayer;return s.default.createElement(e,i({},this.props,{ref:this.ref,onReady:this.onReady,onPlay:this.onPlay,onPause:this.onPause,onEnded:this.onEnded}))}}]),t}(u.Component);p.displayName="Player",p.propTypes=c.propTypes,p.defaultProps=c.defaultProps,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.YouTube=void 0;var l=Object.assign||function(e){for(var t=1;tn?n:t}},{key:"getSource",value:function(e){var t=this.shouldUseHLS(e),n=this.shouldUseDASH(e);if(!(e instanceof Array||e instanceof window.MediaStream||t||n))return P.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.playing,r=e.loop,o=e.controls,a=e.muted,i=e.config,l=e.width,s=e.height,c=this.shouldUseAudio(this.props),f=c?"audio":"video",y={width:"auto"===l?l:"100%",height:"auto"===s?s:"100%"};return p.default.createElement(f,u({ref:this.ref,src:this.getSource(t),style:y,preload:"auto",autoPlay:n,controls:o,muted:a,loop:r},i.file.attributes),t instanceof Array&&t.map(this.renderSourceElement),i.file.tracks.map(this.renderTrack))}}]),t}(c.Component);w.displayName="FilePlayer",w.canPlay=l,t.default=(0,d.default)(w)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"player";return n.player?n.player.getInternalPlayer(e):null},n.seekTo=function(e){if(!n.player)return null;n.player.seekTo(e)},n.wrapperRef=function(e){n.wrapper=e},n.activePlayerRef=function(e){n.player=e},r=t,i(n,r)}return l(ReactPlayer,e),s(ReactPlayer,[{key:"componentDidMount",value:function(){if(this.props.progressFrequency){console.warn("ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead","font-weight: bold","","font-weight: bold","")}}},{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,y.getConfig)(e,f.defaultProps)}},{key:"getActivePlayer",value:function(e){for(var t=[].concat(o(k),o(h.default)),n=0;n2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise(function(r,o){if(E[e])return void E[e].push(r);E[e]=[r];var a=function(t){E[e].forEach(function(e){return e(t)})};if(n){var i=window[n];window[n]=function(){i&&i(),a(window[t])}}(0,b.default)(e,function(e){e&&o(e),n||a(window[t])})})}function c(e,t,n){var r=(0,P.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=w.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=u.value;if(e[c]){var p=c.replace(/Config$/,"");if(r=(0,P.default)(r,o({},p,e[c])),n){var f="ReactPlayer: %c"+c+" %cis deprecated, please use the config prop instead – https://github.com/CookPete/react-player#config-prop";console.warn(f,"font-weight: bold","")}}}}catch(e){i=!0,l=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw l}}return r}function p(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?r-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:"player";return r.player?r.player.getInternalPlayer(e):null},r.seekTo=function(e){if(!r.player)return null;r.player.seekTo(e)},r.ref=function(e){r.player=e},i=t,a(r,i)}return i(n,t),s(n,[{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,y.getConfig)(e,f.defaultProps)}},{key:"render",value:function(){if(!e.canPlay(this.props.url))return null;var t=this.props,n=t.style,r=t.width,o=t.height,a=t.wrapper,i=(0,y.omit)(this.props,v,f.DEPRECATED_CONFIG_PROPS);return p.default.createElement(a,u({style:u({},n,{width:r,height:o})},i),p.default.createElement(h.default,u({},this.props,{ref:this.ref,activePlayer:e,config:(0,y.getConfig)(this.props,f.defaultProps)})))}}]),n}(c.Component),t.displayName=e.displayName+"Player",t.propTypes=f.propTypes,t.defaultProps=f.defaultProps,t.canPlay=e.canPlay,n}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t0&&e<1){var n=this.player.getDuration();return n?void this.player.seekTo(n*e):void console.warn("ReactPlayer: could not seek using fraction – duration not yet available")}this.player.seekTo(e)}},{key:"render",value:function(){var e=this.props.activePlayer;return s.default.createElement(e,i({},this.props,{ref:this.ref,onReady:this.onReady,onPlay:this.onPlay,onPause:this.onPause,onEnded:this.onEnded}))}}]),t}(u.Component);p.displayName="Player",p.propTypes=c.propTypes,p.defaultProps=c.defaultProps,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.YouTube=void 0;var l=Object.assign||function(e){for(var t=1;tn?n:t}},{key:"getSource",value:function(e){var t=this.shouldUseHLS(e),n=this.shouldUseDASH(e);if(!(e instanceof Array||e instanceof window.MediaStream||t||n))return P.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.playing,r=e.loop,o=e.controls,a=e.muted,i=e.config,l=e.width,s=e.height,c=this.shouldUseAudio(this.props),f=c?"audio":"video",y={width:"auto"===l?l:"100%",height:"auto"===s?s:"100%"};return p.default.createElement(f,u({ref:this.ref,src:this.getSource(t),style:y,preload:"auto",autoPlay:n,controls:o,muted:a,loop:r},i.file.attributes),t instanceof Array&&t.map(this.renderSourceElement),i.file.tracks.map(this.renderTrack))}}]),t}(c.Component);w.displayName="FilePlayer",w.canPlay=l,t.default=(0,d.default)(w)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"player";return n.player?n.player.getInternalPlayer(e):null},n.seekTo=function(e){if(!n.player)return null;n.player.seekTo(e)},n.onReady=function(){n.props.onReady(n)},n.wrapperRef=function(e){n.wrapper=e},n.activePlayerRef=function(e){n.player=e},r=t,i(n,r)}return l(ReactPlayer,e),s(ReactPlayer,[{key:"componentDidMount",value:function(){if(this.props.progressFrequency){console.warn("ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead","font-weight: bold","","font-weight: bold","")}}},{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,y.getConfig)(e,f.defaultProps)}},{key:"getActivePlayer",value:function(e){for(var t=[].concat(o(k),o(h.default)),n=0;n 2 && arguments[2] !== undefined ? arguments[2] : null;\n var isLoaded = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {\n return true;\n };\n\n if (window[sdkGlobal] && isLoaded(window[sdkGlobal])) {\n return Promise.resolve(window[sdkGlobal]);\n }\n return new Promise(function (resolve, reject) {\n // If we are already loading the SDK, add the resolve\n // function to the existing array of resolve functions\n if (resolves[url]) {\n resolves[url].push(resolve);\n return;\n }\n resolves[url] = [resolve];\n var onLoaded = function onLoaded(sdk) {\n // When loaded, resolve all pending promises\n resolves[url].forEach(function (resolve) {\n return resolve(sdk);\n });\n };\n if (sdkReady) {\n var previousOnReady = window[sdkReady];\n window[sdkReady] = function () {\n if (previousOnReady) previousOnReady();\n onLoaded(window[sdkGlobal]);\n };\n }\n (0, _loadScript2['default'])(url, function (err) {\n if (err) reject(err);\n if (!sdkReady) {\n onLoaded(window[sdkGlobal]);\n }\n });\n });\n}\n\nfunction getConfig(props, defaultProps, showWarning) {\n var config = (0, _deepmerge2['default'])(defaultProps.config, props.config);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = _props.DEPRECATED_CONFIG_PROPS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var p = _step.value;\n\n if (props[p]) {\n var key = p.replace(/Config$/, '');\n config = (0, _deepmerge2['default'])(config, _defineProperty({}, key, props[p]));\n if (showWarning) {\n var link = 'https://github.com/CookPete/react-player#config-prop';\n var message = 'ReactPlayer: %c' + p + ' %cis deprecated, please use the config prop instead \\u2013 ' + link;\n console.warn(message, 'font-weight: bold', '');\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator['return']) {\n _iterator['return']();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return config;\n}\n\nfunction omit(object) {\n var _ref;\n\n for (var _len = arguments.length, arrays = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n arrays[_key - 1] = arguments[_key];\n }\n\n var omitKeys = (_ref = []).concat.apply(_ref, arrays);\n var output = {};\n var keys = Object.keys(object);\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n if (omitKeys.indexOf(key) === -1) {\n output[key] = object[key];\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2['return']) {\n _iterator2['return']();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return output;\n}\n\nfunction callPlayer(method) {\n var _player;\n\n // Util method for calling a method on this.player\n // but guard against errors and console.warn instead\n if (!this.player || !this.player[method]) {\n var message = 'ReactPlayer: ' + this.constructor.displayName + ' player could not call %c' + method + '%c \\u2013 ';\n if (!this.player) {\n message += 'The player was not available';\n } else if (!this.player[method]) {\n message += 'The method was not available';\n }\n console.warn(message, 'font-weight: bold', '');\n return null;\n }\n\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return (_player = this.player)[method].apply(_player, args);\n}\n\nfunction isObject(val) {\n return val !== null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object';\n}\n\n// Deep comparison of two objects but ignoring\n// functions, for use in shouldComponentUpdate\nfunction isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.keys(a)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3['return']) {\n _iterator3['return']();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return true;\n }\n return a === b;\n}\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nexports['default'] = createSinglePlayer;\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _props2 = __webpack_require__(3);\n\nvar _utils = __webpack_require__(1);\n\nvar _Player = __webpack_require__(4);\n\nvar _Player2 = _interopRequireDefault(_Player);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SUPPORTED_PROPS = Object.keys(_props2.propTypes);\n\nfunction createSinglePlayer(activePlayer) {\n var _class, _temp2;\n\n return _temp2 = _class = function (_Component) {\n _inherits(SinglePlayer, _Component);\n\n function SinglePlayer() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, SinglePlayer);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = SinglePlayer.__proto__ || Object.getPrototypeOf(SinglePlayer)).call.apply(_ref, [this].concat(args))), _this), _this.getDuration = function () {\n if (!_this.player) return null;\n return _this.player.getDuration();\n }, _this.getCurrentTime = function () {\n if (!_this.player) return null;\n return _this.player.getCurrentTime();\n }, _this.getSecondsLoaded = function () {\n if (!_this.player) return null;\n return _this.player.getSecondsLoaded();\n }, _this.getInternalPlayer = function () {\n var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';\n\n if (!_this.player) return null;\n return _this.player.getInternalPlayer(key);\n }, _this.seekTo = function (fraction) {\n if (!_this.player) return null;\n _this.player.seekTo(fraction);\n }, _this.ref = function (player) {\n _this.player = player;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(SinglePlayer, [{\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate(nextProps) {\n return !(0, _utils.isEqual)(this.props, nextProps);\n }\n }, {\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n this.config = (0, _utils.getConfig)(nextProps, _props2.defaultProps);\n }\n }, {\n key: 'render',\n value: function render() {\n if (!activePlayer.canPlay(this.props.url)) {\n return null;\n }\n var _props = this.props,\n style = _props.style,\n width = _props.width,\n height = _props.height,\n Wrapper = _props.wrapper;\n\n var otherProps = (0, _utils.omit)(this.props, SUPPORTED_PROPS, _props2.DEPRECATED_CONFIG_PROPS);\n return _react2['default'].createElement(\n Wrapper,\n _extends({ style: _extends({}, style, { width: width, height: height }) }, otherProps),\n _react2['default'].createElement(_Player2['default'], _extends({}, this.props, {\n ref: this.ref,\n activePlayer: activePlayer,\n config: (0, _utils.getConfig)(this.props, _props2.defaultProps)\n }))\n );\n }\n }]);\n\n return SinglePlayer;\n }(_react.Component), _class.displayName = activePlayer.displayName + 'Player', _class.propTypes = _props2.propTypes, _class.defaultProps = _props2.defaultProps, _class.canPlay = activePlayer.canPlay, _temp2;\n}\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DEPRECATED_CONFIG_PROPS = exports.defaultProps = exports.propTypes = undefined;\n\nvar _propTypes = __webpack_require__(11);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar string = _propTypes2['default'].string,\n bool = _propTypes2['default'].bool,\n number = _propTypes2['default'].number,\n array = _propTypes2['default'].array,\n oneOfType = _propTypes2['default'].oneOfType,\n shape = _propTypes2['default'].shape,\n object = _propTypes2['default'].object,\n func = _propTypes2['default'].func;\nvar propTypes = exports.propTypes = {\n url: oneOfType([string, array, object]),\n playing: bool,\n loop: bool,\n controls: bool,\n volume: number,\n muted: bool,\n playbackRate: number,\n width: oneOfType([string, number]),\n height: oneOfType([string, number]),\n style: object,\n progressInterval: number,\n playsinline: bool,\n wrapper: oneOfType([string, func]),\n config: shape({\n soundcloud: shape({\n options: object\n }),\n youtube: shape({\n playerVars: object,\n preload: bool\n }),\n facebook: shape({\n appId: string\n }),\n dailymotion: shape({\n params: object,\n preload: bool\n }),\n vimeo: shape({\n playerOptions: object,\n preload: bool\n }),\n file: shape({\n attributes: object,\n tracks: array,\n forceVideo: bool,\n forceAudio: bool,\n forceHLS: bool,\n forceDASH: bool,\n hlsOptions: object\n }),\n wistia: shape({\n options: object\n }),\n mixcloud: shape({\n options: object\n }),\n twitch: shape({\n options: object\n })\n }),\n onReady: func,\n onStart: func,\n onPlay: func,\n onPause: func,\n onBuffer: func,\n onEnded: func,\n onError: func,\n onDuration: func,\n onSeek: func,\n onProgress: func\n};\n\nvar defaultProps = exports.defaultProps = {\n playing: false,\n loop: false,\n controls: false,\n volume: null,\n muted: false,\n playbackRate: 1,\n width: '640px',\n height: '360px',\n style: {},\n progressInterval: 1000,\n playsinline: false,\n wrapper: 'div',\n config: {\n soundcloud: {\n options: {\n visual: true, // Undocumented, but makes player fill container and look better\n buying: false,\n liking: false,\n download: false,\n sharing: false,\n show_comments: false,\n show_playcount: false\n }\n },\n youtube: {\n playerVars: {\n playsinline: 1,\n showinfo: 0,\n rel: 0,\n iv_load_policy: 3,\n modestbranding: 1\n },\n preload: false\n },\n facebook: {\n appId: '1309697205772819'\n },\n dailymotion: {\n params: {\n api: 1,\n 'endscreen-enable': false\n },\n preload: false\n },\n vimeo: {\n playerOptions: {\n autopause: false,\n byline: false,\n portrait: false,\n title: false\n },\n preload: false\n },\n file: {\n attributes: {},\n tracks: [],\n forceVideo: false,\n forceAudio: false,\n forceHLS: false,\n forceDASH: false,\n hlsOptions: {}\n },\n wistia: {\n options: {}\n },\n mixcloud: {\n options: {\n hide_cover: 1\n }\n },\n twitch: {\n options: {}\n }\n },\n onReady: function onReady() {},\n onStart: function onStart() {},\n onPlay: function onPlay() {},\n onPause: function onPause() {},\n onBuffer: function onBuffer() {},\n onEnded: function onEnded() {},\n onError: function onError() {},\n onDuration: function onDuration() {},\n onSeek: function onSeek() {},\n onProgress: function onProgress() {}\n};\n\nvar DEPRECATED_CONFIG_PROPS = exports.DEPRECATED_CONFIG_PROPS = ['soundcloudConfig', 'youtubeConfig', 'facebookConfig', 'dailymotionConfig', 'vimeoConfig', 'fileConfig', 'wistiaConfig'];\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _props2 = __webpack_require__(3);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SEEK_ON_PLAY_EXPIRY = 5000;\n\nvar Player = function (_Component) {\n _inherits(Player, _Component);\n\n function Player() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Player);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Player.__proto__ || Object.getPrototypeOf(Player)).call.apply(_ref, [this].concat(args))), _this), _this.mounted = false, _this.isReady = false, _this.isPlaying = false, _this.isLoading = true, _this.loadOnReady = null, _this.startOnPlay = true, _this.seekOnPlay = null, _this.onDurationCalled = false, _this.getInternalPlayer = function (key) {\n if (!_this.player) return null;\n return _this.player[key];\n }, _this.progress = function () {\n if (_this.props.url && _this.player && _this.isReady) {\n var playedSeconds = _this.getCurrentTime() || 0;\n var loadedSeconds = _this.getSecondsLoaded();\n var duration = _this.getDuration();\n if (duration) {\n var progress = {\n playedSeconds: playedSeconds,\n played: playedSeconds / duration\n };\n if (loadedSeconds !== null) {\n progress.loadedSeconds = loadedSeconds;\n progress.loaded = loadedSeconds / duration;\n }\n // Only call onProgress if values have changed\n if (progress.played !== _this.prevPlayed || progress.loaded !== _this.prevLoaded) {\n _this.props.onProgress(progress);\n }\n _this.prevPlayed = progress.played;\n _this.prevLoaded = progress.loaded;\n }\n }\n _this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency || _this.props.progressInterval);\n }, _this.onReady = function () {\n if (!_this.mounted) return;\n _this.isReady = true;\n _this.isLoading = false;\n var _this$props = _this.props,\n onReady = _this$props.onReady,\n playing = _this$props.playing,\n volume = _this$props.volume,\n muted = _this$props.muted;\n\n onReady();\n if (!muted && volume !== null) {\n _this.player.setVolume(volume);\n }\n if (_this.loadOnReady) {\n _this.player.load(_this.loadOnReady, true);\n _this.loadOnReady = null;\n } else if (playing) {\n _this.player.play();\n }\n _this.onDurationCheck();\n }, _this.onPlay = function () {\n _this.isPlaying = true;\n _this.isLoading = false;\n var _this$props2 = _this.props,\n onStart = _this$props2.onStart,\n onPlay = _this$props2.onPlay,\n playbackRate = _this$props2.playbackRate;\n\n if (_this.startOnPlay) {\n if (_this.player.setPlaybackRate) {\n _this.player.setPlaybackRate(playbackRate);\n }\n onStart();\n _this.startOnPlay = false;\n }\n onPlay();\n if (_this.seekOnPlay) {\n _this.seekTo(_this.seekOnPlay);\n _this.seekOnPlay = null;\n }\n _this.onDurationCheck();\n }, _this.onPause = function (e) {\n _this.isPlaying = false;\n if (!_this.isLoading) {\n _this.props.onPause(e);\n }\n }, _this.onEnded = function () {\n var _this$props3 = _this.props,\n activePlayer = _this$props3.activePlayer,\n loop = _this$props3.loop,\n onEnded = _this$props3.onEnded;\n\n if (activePlayer.loopOnEnded && loop) {\n _this.seekTo(0);\n }\n if (!loop) {\n _this.isPlaying = false;\n }\n onEnded();\n }, _this.onDurationCheck = function () {\n clearTimeout(_this.durationCheckTimeout);\n var duration = _this.getDuration();\n if (duration) {\n if (!_this.onDurationCalled) {\n _this.props.onDuration(duration);\n _this.onDurationCalled = true;\n }\n } else {\n _this.durationCheckTimeout = setTimeout(_this.onDurationCheck, 100);\n }\n }, _this.ref = function (player) {\n if (player) {\n _this.player = player;\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n } // Track playing state internally to prevent bugs\n // Use isLoading to prevent onPause when switching URL\n\n\n _createClass(Player, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.mounted = true;\n this.player.load(this.props.url);\n this.progress();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this.progressTimeout);\n clearTimeout(this.durationCheckTimeout);\n if (this.isReady) {\n this.player.stop();\n }\n this.mounted = false;\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n var _this2 = this;\n\n // Invoke player methods based on incoming props\n var _props = this.props,\n url = _props.url,\n playing = _props.playing,\n volume = _props.volume,\n muted = _props.muted,\n playbackRate = _props.playbackRate;\n\n if (url !== nextProps.url) {\n if (this.isLoading) {\n console.warn('ReactPlayer: the attempt to load ' + nextProps.url + ' is being deferred until the player has loaded');\n this.loadOnReady = nextProps.url;\n return;\n }\n this.isLoading = true;\n this.startOnPlay = true;\n this.onDurationCalled = false;\n this.player.load(nextProps.url, this.isReady);\n }\n if (!playing && nextProps.playing && !this.isPlaying) {\n this.player.play();\n }\n if (playing && !nextProps.playing && this.isPlaying) {\n this.player.pause();\n }\n if (volume !== nextProps.volume && nextProps.volume !== null) {\n this.player.setVolume(nextProps.volume);\n }\n if (muted !== nextProps.muted) {\n if (nextProps.muted) {\n this.player.mute();\n } else {\n this.player.unmute();\n if (nextProps.volume !== null) {\n // Set volume next tick to fix a bug with DailyMotion\n setTimeout(function () {\n return _this2.player.setVolume(nextProps.volume);\n });\n }\n }\n }\n if (playbackRate !== nextProps.playbackRate && this.player.setPlaybackRate) {\n this.player.setPlaybackRate(nextProps.playbackRate);\n }\n }\n }, {\n key: 'getDuration',\n value: function getDuration() {\n if (!this.isReady) return null;\n return this.player.getDuration();\n }\n }, {\n key: 'getCurrentTime',\n value: function getCurrentTime() {\n if (!this.isReady) return null;\n return this.player.getCurrentTime();\n }\n }, {\n key: 'getSecondsLoaded',\n value: function getSecondsLoaded() {\n if (!this.isReady) return null;\n return this.player.getSecondsLoaded();\n }\n }, {\n key: 'seekTo',\n value: function seekTo(amount) {\n var _this3 = this;\n\n // When seeking before player is ready, store value and seek later\n if (!this.isReady && amount !== 0) {\n this.seekOnPlay = amount;\n setTimeout(function () {\n _this3.seekOnPlay = null;\n }, SEEK_ON_PLAY_EXPIRY);\n return;\n }\n if (amount > 0 && amount < 1) {\n // Convert fraction to seconds based on duration\n var duration = this.player.getDuration();\n if (!duration) {\n console.warn('ReactPlayer: could not seek using fraction – duration not yet available');\n return;\n }\n this.player.seekTo(duration * amount);\n return;\n }\n this.player.seekTo(amount);\n }\n }, {\n key: 'render',\n value: function render() {\n var Player = this.props.activePlayer;\n return _react2['default'].createElement(Player, _extends({}, this.props, {\n ref: this.ref,\n onReady: this.onReady,\n onPlay: this.onPlay,\n onPause: this.onPause,\n onEnded: this.onEnded\n }));\n }\n }]);\n\n return Player;\n}(_react.Component);\n\nPlayer.displayName = 'Player';\nPlayer.propTypes = _props2.propTypes;\nPlayer.defaultProps = _props2.defaultProps;\nexports['default'] = Player;\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.YouTube = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(1);\n\nvar _singlePlayer = __webpack_require__(2);\n\nvar _singlePlayer2 = _interopRequireDefault(_singlePlayer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SDK_URL = 'https://www.youtube.com/iframe_api';\nvar SDK_GLOBAL = 'YT';\nvar SDK_GLOBAL_READY = 'onYouTubeIframeAPIReady';\nvar MATCH_URL = /(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})/;\n\nvar YouTube = exports.YouTube = function (_Component) {\n _inherits(YouTube, _Component);\n\n function YouTube() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, YouTube);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = YouTube.__proto__ || Object.getPrototypeOf(YouTube)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.onStateChange = function (_ref2) {\n var data = _ref2.data;\n var _this$props = _this.props,\n onPlay = _this$props.onPlay,\n onPause = _this$props.onPause,\n onBuffer = _this$props.onBuffer,\n onEnded = _this$props.onEnded,\n onReady = _this$props.onReady;\n var _window$SDK_GLOBAL$Pl = window[SDK_GLOBAL].PlayerState,\n PLAYING = _window$SDK_GLOBAL$Pl.PLAYING,\n PAUSED = _window$SDK_GLOBAL$Pl.PAUSED,\n BUFFERING = _window$SDK_GLOBAL$Pl.BUFFERING,\n ENDED = _window$SDK_GLOBAL$Pl.ENDED,\n CUED = _window$SDK_GLOBAL$Pl.CUED;\n\n if (data === PLAYING) onPlay();\n if (data === PAUSED) onPause();\n if (data === BUFFERING) onBuffer();\n if (data === ENDED) onEnded();\n if (data === CUED) onReady();\n }, _this.mute = function () {\n _this.callPlayer('mute');\n }, _this.unmute = function () {\n _this.callPlayer('unMute');\n }, _this.ref = function (container) {\n _this.container = container;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(YouTube, [{\n key: 'load',\n value: function load(url, isReady) {\n var _this2 = this;\n\n var _props = this.props,\n playing = _props.playing,\n muted = _props.muted,\n playsinline = _props.playsinline,\n controls = _props.controls,\n config = _props.config,\n _onError = _props.onError;\n\n var id = url && url.match(MATCH_URL)[1];\n if (isReady) {\n this.player.cueVideoById({\n videoId: id,\n startSeconds: (0, _utils.parseStartTime)(url)\n });\n return;\n }\n (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (YT) {\n return YT.loaded;\n }).then(function (YT) {\n if (!_this2.container) return;\n _this2.player = new YT.Player(_this2.container, {\n width: '100%',\n height: '100%',\n videoId: id,\n playerVars: _extends({\n autoplay: playing ? 1 : 0,\n mute: muted ? 1 : 0,\n controls: controls ? 1 : 0,\n start: (0, _utils.parseStartTime)(url),\n origin: window.location.origin,\n playsinline: playsinline\n }, config.youtube.playerVars),\n events: {\n onReady: _this2.props.onReady,\n onStateChange: _this2.onStateChange,\n onError: function onError(event) {\n return _onError(event.data);\n }\n }\n });\n }, _onError);\n }\n }, {\n key: 'play',\n value: function play() {\n this.callPlayer('playVideo');\n }\n }, {\n key: 'pause',\n value: function pause() {\n this.callPlayer('pauseVideo');\n }\n }, {\n key: 'stop',\n value: function stop() {\n if (!document.body.contains(this.callPlayer('getIframe'))) return;\n this.callPlayer('stopVideo');\n }\n }, {\n key: 'seekTo',\n value: function seekTo(amount) {\n this.callPlayer('seekTo', amount);\n }\n }, {\n key: 'setVolume',\n value: function setVolume(fraction) {\n this.callPlayer('setVolume', fraction * 100);\n }\n }, {\n key: 'setPlaybackRate',\n value: function setPlaybackRate(rate) {\n this.callPlayer('setPlaybackRate', rate);\n }\n }, {\n key: 'getDuration',\n value: function getDuration() {\n return this.callPlayer('getDuration');\n }\n }, {\n key: 'getCurrentTime',\n value: function getCurrentTime() {\n return this.callPlayer('getCurrentTime');\n }\n }, {\n key: 'getSecondsLoaded',\n value: function getSecondsLoaded() {\n return this.callPlayer('getVideoLoadedFraction') * this.getDuration();\n }\n }, {\n key: 'render',\n value: function render() {\n var style = _extends({\n width: '100%',\n height: '100%'\n }, this.props.style);\n return _react2['default'].createElement(\n 'div',\n { style: style },\n _react2['default'].createElement('div', { ref: this.ref })\n );\n }\n }]);\n\n return YouTube;\n}(_react.Component);\n\nYouTube.displayName = 'YouTube';\n\nYouTube.canPlay = function (url) {\n return MATCH_URL.test(url);\n};\n\nYouTube.loopOnEnded = true;\nexports['default'] = (0, _singlePlayer2['default'])(YouTube);\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SoundCloud = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(1);\n\nvar _singlePlayer = __webpack_require__(2);\n\nvar _singlePlayer2 = _interopRequireDefault(_singlePlayer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SDK_URL = 'https://w.soundcloud.com/player/api.js';\nvar SDK_GLOBAL = 'SC';\nvar MATCH_URL = /(soundcloud\\.com|snd\\.sc)\\/.+$/;\n\nvar SoundCloud = exports.SoundCloud = function (_Component) {\n _inherits(SoundCloud, _Component);\n\n function SoundCloud() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, SoundCloud);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = SoundCloud.__proto__ || Object.getPrototypeOf(SoundCloud)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.duration = null, _this.currentTime = null, _this.fractionLoaded = null, _this.mute = function () {\n _this.setVolume(0);\n }, _this.unmute = function () {\n if (_this.props.volume !== null) {\n _this.setVolume(_this.props.volume);\n }\n }, _this.ref = function (iframe) {\n _this.iframe = iframe;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(SoundCloud, [{\n key: 'load',\n value: function load(url, isReady) {\n var _this2 = this;\n\n (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (SC) {\n if (!_this2.iframe) return;\n var _SC$Widget$Events = SC.Widget.Events,\n PLAY = _SC$Widget$Events.PLAY,\n PLAY_PROGRESS = _SC$Widget$Events.PLAY_PROGRESS,\n PAUSE = _SC$Widget$Events.PAUSE,\n FINISH = _SC$Widget$Events.FINISH,\n ERROR = _SC$Widget$Events.ERROR;\n\n if (!isReady) {\n _this2.player = SC.Widget(_this2.iframe);\n _this2.player.bind(PLAY, _this2.props.onPlay);\n _this2.player.bind(PAUSE, _this2.props.onPause);\n _this2.player.bind(PLAY_PROGRESS, function (e) {\n _this2.currentTime = e.currentPosition / 1000;\n _this2.fractionLoaded = e.loadedProgress;\n });\n _this2.player.bind(FINISH, function () {\n return _this2.props.onEnded();\n });\n _this2.player.bind(ERROR, function (e) {\n return _this2.props.onError(e);\n });\n }\n _this2.player.load(url, _extends({}, _this2.props.config.soundcloud.options, {\n callback: function callback() {\n _this2.player.getDuration(function (duration) {\n _this2.duration = duration / 1000;\n _this2.props.onReady();\n });\n }\n }));\n });\n }\n }, {\n key: 'play',\n value: function play() {\n this.callPlayer('play');\n }\n }, {\n key: 'pause',\n value: function pause() {\n this.callPlayer('pause');\n }\n }, {\n key: 'stop',\n value: function stop() {\n // Nothing to do\n }\n }, {\n key: 'seekTo',\n value: function seekTo(seconds) {\n this.callPlayer('seekTo', seconds * 1000);\n }\n }, {\n key: 'setVolume',\n value: function setVolume(fraction) {\n this.callPlayer('setVolume', fraction * 100);\n }\n }, {\n key: 'getDuration',\n value: function getDuration() {\n return this.duration;\n }\n }, {\n key: 'getCurrentTime',\n value: function getCurrentTime() {\n return this.currentTime;\n }\n }, {\n key: 'getSecondsLoaded',\n value: function getSecondsLoaded() {\n return this.fractionLoaded * this.duration;\n }\n }, {\n key: 'render',\n value: function render() {\n var style = _extends({\n width: '100%',\n height: '100%'\n }, this.props.style);\n return _react2['default'].createElement('iframe', {\n ref: this.ref,\n src: 'https://w.soundcloud.com/player/?url=' + encodeURIComponent(this.props.url),\n style: style,\n frameBorder: 0\n });\n }\n }]);\n\n return SoundCloud;\n}(_react.Component);\n\nSoundCloud.displayName = 'SoundCloud';\n\nSoundCloud.canPlay = function (url) {\n return MATCH_URL.test(url);\n};\n\nSoundCloud.loopOnEnded = true;\nexports['default'] = (0, _singlePlayer2['default'])(SoundCloud);\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Vimeo = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(1);\n\nvar _singlePlayer = __webpack_require__(2);\n\nvar _singlePlayer2 = _interopRequireDefault(_singlePlayer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SDK_URL = 'https://player.vimeo.com/api/player.js';\nvar SDK_GLOBAL = 'Vimeo';\nvar MATCH_URL = /vimeo\\.com\\/.+/;\nvar MATCH_FILE_URL = /vimeo\\.com\\/external\\/.+\\.mp4/;\n\nvar Vimeo = exports.Vimeo = function (_Component) {\n _inherits(Vimeo, _Component);\n\n function Vimeo() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Vimeo);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Vimeo.__proto__ || Object.getPrototypeOf(Vimeo)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.duration = null, _this.currentTime = null, _this.secondsLoaded = null, _this.mute = function () {\n _this.setVolume(0);\n }, _this.unmute = function () {\n if (_this.props.volume !== null) {\n _this.setVolume(_this.props.volume);\n }\n }, _this.ref = function (container) {\n _this.container = container;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Vimeo, [{\n key: 'load',\n value: function load(url) {\n var _this2 = this;\n\n this.duration = null;\n (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Vimeo) {\n if (!_this2.container) return;\n _this2.player = new Vimeo.Player(_this2.container, _extends({}, _this2.props.config.vimeo.playerOptions, {\n url: url,\n autoplay: _this2.props.playing,\n muted: _this2.props.muted,\n loop: _this2.props.loop\n }));\n _this2.player.ready().then(function () {\n var iframe = _this2.container.querySelector('iframe');\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n })['catch'](_this2.props.onError);\n _this2.player.on('loaded', function () {\n _this2.props.onReady();\n _this2.player.getDuration().then(function (duration) {\n _this2.duration = duration;\n });\n });\n _this2.player.on('play', _this2.props.onPlay);\n _this2.player.on('pause', _this2.props.onPause);\n _this2.player.on('seeked', function (e) {\n return _this2.props.onSeek(e.seconds);\n });\n _this2.player.on('ended', _this2.props.onEnded);\n _this2.player.on('error', _this2.props.onError);\n _this2.player.on('timeupdate', function (_ref2) {\n var seconds = _ref2.seconds;\n\n _this2.currentTime = seconds;\n });\n _this2.player.on('progress', function (_ref3) {\n var seconds = _ref3.seconds;\n\n _this2.secondsLoaded = seconds;\n });\n }, this.props.onError);\n }\n }, {\n key: 'play',\n value: function play() {\n this.callPlayer('play');\n }\n }, {\n key: 'pause',\n value: function pause() {\n this.callPlayer('pause');\n }\n }, {\n key: 'stop',\n value: function stop() {\n this.callPlayer('unload');\n }\n }, {\n key: 'seekTo',\n value: function seekTo(seconds) {\n this.callPlayer('setCurrentTime', seconds);\n }\n }, {\n key: 'setVolume',\n value: function setVolume(fraction) {\n this.callPlayer('setVolume', fraction);\n }\n }, {\n key: 'getDuration',\n value: function getDuration() {\n return this.duration;\n }\n }, {\n key: 'getCurrentTime',\n value: function getCurrentTime() {\n return this.currentTime;\n }\n }, {\n key: 'getSecondsLoaded',\n value: function getSecondsLoaded() {\n return this.secondsLoaded;\n }\n }, {\n key: 'render',\n value: function render() {\n var style = _extends({\n width: '100%',\n height: '100%',\n overflow: 'hidden',\n backgroundColor: 'black'\n }, this.props.style);\n return _react2['default'].createElement('div', {\n key: this.props.url,\n ref: this.ref,\n style: style\n });\n }\n }]);\n\n return Vimeo;\n}(_react.Component);\n\nVimeo.displayName = 'Vimeo';\n\nVimeo.canPlay = function (url) {\n if (MATCH_FILE_URL.test(url)) {\n return false;\n }\n return MATCH_URL.test(url);\n};\n\nexports['default'] = (0, _singlePlayer2['default'])(Vimeo);\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DailyMotion = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(1);\n\nvar _singlePlayer = __webpack_require__(2);\n\nvar _singlePlayer2 = _interopRequireDefault(_singlePlayer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SDK_URL = 'https://api.dmcdn.net/all.js';\nvar SDK_GLOBAL = 'DM';\nvar SDK_GLOBAL_READY = 'dmAsyncInit';\nvar MATCH_URL = /dailymotion\\.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n\nvar DailyMotion = exports.DailyMotion = function (_Component) {\n _inherits(DailyMotion, _Component);\n\n function DailyMotion() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, DailyMotion);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DailyMotion.__proto__ || Object.getPrototypeOf(DailyMotion)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.onDurationChange = function () {\n var duration = _this.getDuration();\n _this.props.onDuration(duration);\n }, _this.mute = function () {\n _this.callPlayer('setMuted', true);\n }, _this.unmute = function () {\n _this.callPlayer('setMuted', false);\n }, _this.ref = function (container) {\n _this.container = container;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(DailyMotion, [{\n key: 'parseId',\n value: function parseId(url) {\n var m = url.match(MATCH_URL);\n return m[4] || m[2];\n }\n }, {\n key: 'load',\n value: function load(url) {\n var _this2 = this;\n\n var _props = this.props,\n controls = _props.controls,\n config = _props.config,\n onError = _props.onError,\n playing = _props.playing;\n\n var id = this.parseId(url);\n if (this.player) {\n this.player.load(id, {\n start: (0, _utils.parseStartTime)(url),\n autoplay: playing\n });\n return;\n }\n (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (DM) {\n return DM.player;\n }).then(function (DM) {\n if (!_this2.container) return;\n var Player = DM.player;\n _this2.player = new Player(_this2.container, {\n width: '100%',\n height: '100%',\n video: id,\n params: _extends({\n controls: controls,\n autoplay: _this2.props.playing,\n mute: _this2.props.muted,\n start: (0, _utils.parseStartTime)(url),\n origin: window.location.origin\n }, config.dailymotion.params),\n events: {\n apiready: _this2.props.onReady,\n seeked: function seeked() {\n return _this2.props.onSeek(_this2.player.currentTime);\n },\n video_end: _this2.props.onEnded,\n durationchange: _this2.onDurationChange,\n pause: _this2.props.onPause,\n playing: _this2.props.onPlay,\n waiting: _this2.props.onBuffer,\n error: function error(event) {\n return onError(event);\n }\n }\n });\n }, onError);\n }\n }, {\n key: 'play',\n value: function play() {\n this.callPlayer('play');\n }\n }, {\n key: 'pause',\n value: function pause() {\n this.callPlayer('pause');\n }\n }, {\n key: 'stop',\n value: function stop() {\n // Nothing to do\n }\n }, {\n key: 'seekTo',\n value: function seekTo(seconds) {\n this.callPlayer('seek', seconds);\n }\n }, {\n key: 'setVolume',\n value: function setVolume(fraction) {\n this.callPlayer('setVolume', fraction);\n }\n }, {\n key: 'getDuration',\n value: function getDuration() {\n return this.player.duration || null;\n }\n }, {\n key: 'getCurrentTime',\n value: function getCurrentTime() {\n return this.player.currentTime;\n }\n }, {\n key: 'getSecondsLoaded',\n value: function getSecondsLoaded() {\n return this.player.bufferedTime;\n }\n }, {\n key: 'render',\n value: function render() {\n var style = _extends({\n width: '100%',\n height: '100%',\n backgroundColor: 'black'\n }, this.props.style);\n return _react2['default'].createElement(\n 'div',\n { style: style },\n _react2['default'].createElement('div', { ref: this.ref })\n );\n }\n }]);\n\n return DailyMotion;\n}(_react.Component);\n\nDailyMotion.displayName = 'DailyMotion';\n\nDailyMotion.canPlay = function (url) {\n return MATCH_URL.test(url);\n};\n\nDailyMotion.loopOnEnded = true;\nexports['default'] = (0, _singlePlayer2['default'])(DailyMotion);\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FilePlayer = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(1);\n\nvar _singlePlayer = __webpack_require__(2);\n\nvar _singlePlayer2 = _interopRequireDefault(_singlePlayer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nvar AUDIO_EXTENSIONS = /\\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\\?)/i;\nvar VIDEO_EXTENSIONS = /\\.(mp4|og[gv]|webm|mov|m4v)($|\\?)/i;\nvar HLS_EXTENSIONS = /\\.(m3u8)($|\\?)/i;\nvar HLS_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/hls.js/0.9.1/hls.min.js';\nvar HLS_GLOBAL = 'Hls';\nvar DASH_EXTENSIONS = /\\.(mpd)($|\\?)/i;\nvar DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.6.5/dash.all.min.js';\nvar DASH_GLOBAL = 'dashjs';\nvar MATCH_DROPBOX_URL = /www\\.dropbox\\.com\\/.+/;\n\nfunction canPlay(url) {\n if (url instanceof Array) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = url[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n\n if (typeof item === 'string' && canPlay(item)) {\n return true;\n }\n if (canPlay(item.src)) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator['return']) {\n _iterator['return']();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return false;\n }\n if (url instanceof window.MediaStream) {\n return true;\n }\n return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url);\n}\n\nvar FilePlayer = exports.FilePlayer = function (_Component) {\n _inherits(FilePlayer, _Component);\n\n function FilePlayer() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, FilePlayer);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FilePlayer.__proto__ || Object.getPrototypeOf(FilePlayer)).call.apply(_ref, [this].concat(args))), _this), _this.onSeek = function (e) {\n _this.props.onSeek(e.target.currentTime);\n }, _this.mute = function () {\n _this.player.muted = true;\n }, _this.unmute = function () {\n _this.player.muted = false;\n }, _this.renderSourceElement = function (source, index) {\n if (typeof source === 'string') {\n return _react2['default'].createElement('source', { key: index, src: source });\n }\n return _react2['default'].createElement('source', _extends({ key: index }, source));\n }, _this.renderTrack = function (track, index) {\n return _react2['default'].createElement('track', _extends({ key: index }, track));\n }, _this.ref = function (player) {\n _this.player = player;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(FilePlayer, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.addListeners();\n if (IOS) {\n this.player.load();\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(nextProps)) {\n this.removeListeners();\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(prevProps)) {\n this.addListeners();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.removeListeners();\n }\n }, {\n key: 'addListeners',\n value: function addListeners() {\n var _props = this.props,\n onReady = _props.onReady,\n onPlay = _props.onPlay,\n onPause = _props.onPause,\n onEnded = _props.onEnded,\n onError = _props.onError,\n playsinline = _props.playsinline;\n\n this.player.addEventListener('canplay', onReady);\n this.player.addEventListener('play', onPlay);\n this.player.addEventListener('pause', onPause);\n this.player.addEventListener('seeked', this.onSeek);\n this.player.addEventListener('ended', onEnded);\n this.player.addEventListener('error', onError);\n if (playsinline) {\n this.player.setAttribute('playsinline', '');\n this.player.setAttribute('webkit-playsinline', '');\n }\n }\n }, {\n key: 'removeListeners',\n value: function removeListeners() {\n var _props2 = this.props,\n onReady = _props2.onReady,\n onPlay = _props2.onPlay,\n onPause = _props2.onPause,\n onEnded = _props2.onEnded,\n onError = _props2.onError;\n\n this.player.removeEventListener('canplay', onReady);\n this.player.removeEventListener('play', onPlay);\n this.player.removeEventListener('pause', onPause);\n this.player.removeEventListener('seeked', this.onSeek);\n this.player.removeEventListener('ended', onEnded);\n this.player.removeEventListener('error', onError);\n }\n }, {\n key: 'shouldUseAudio',\n value: function shouldUseAudio(props) {\n if (props.config.file.forceVideo) {\n return false;\n }\n if (props.config.file.attributes.poster) {\n return false; // Use