UNPKG

react-player

Version:

A react component for playing a variety of URLs, including file paths, YouTube, Facebook, SoundCloud, Streamable, Vidme, Vimeo and Wistia

1 lines 68.1 kB
var ReactPlayer=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t){e.exports=React},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e){var t=e.match(b);if(t){var r=t[1];if(r.match(m))return a(r);if(g.test(r))return parseInt(r,10)}return 0}function a(e){for(var t=0,r=m.exec(e);null!==r;){var n=r,o=f(n,3),i=o[1],a=o[2];"h"===a&&(t+=60*parseInt(i,10)*60),"m"===a&&(t+=60*parseInt(i,10)),"s"===a&&(t+=parseInt(i,10)),r=m.exec(e)}return t}function u(){return Math.random().toString(36).substr(2,5)}function s(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};return window[r]&&o(window[r])?e.resolve(window[r]):new e(function(e,o){if(n){var i=window[n];window[n]=function(){i&&i(),e(window[r])}}(0,y.default)(t,function(t){t&&o(t),n||e(window[r])})})}function l(e,t,r){var n=(0,h.default)(t.config,e.config),i=!0,a=!1,u=void 0;try{for(var s,l=v.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var c=s.value;if(e[c]){var f=c.replace(/Config$/,"");if(n=(0,h.default)(n,o({},f,e[c])),r){var p="ReactPlayer: %c"+c+" %cis deprecated, please use the config prop instead – https://github.com/CookPete/react-player#config-prop";console.warn(p,"font-weight: bold","")}}}}catch(e){a=!0,u=e}finally{try{!i&&l.return&&l.return()}finally{if(a)throw u}}return n}function c(e){for(var t,r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var i=(t=[]).concat.apply(t,n),a={},u=Object.keys(e),s=!0,l=!1,c=void 0;try{for(var f,p=u[Symbol.iterator]();!(s=(f=p.next()).done);s=!0){var y=f.value;-1===i.indexOf(y)&&(a[y]=e[y])}}catch(e){l=!0,c=e}finally{try{!s&&p.return&&p.return()}finally{if(l)throw c}}return a}Object.defineProperty(t,"__esModule",{value:!0});var f=function(){function e(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.parseStartTime=i,t.randomString=u,t.getSDK=s,t.getConfig=l,t.omit=c;var p=r(16),y=n(p),d=r(17),h=n(d),v=r(4),b=/[?&#](?:start|t)=([0-9hms]+)/,m=/(\d+)(h|m|s)/g,g=/^\d+$/}).call(t,r(3))},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function 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});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(0),s=r(4),l=function(e){function t(){var e,r,i,a;n(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return r=i=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),i.isReady=!1,i.startOnPlay=!0,i.seekOnPlay=null,i.onPlay=function(){var e=i.props,t=e.volume,r=e.muted,n=e.onStart,o=e.onPlay,a=e.playbackRate;i.startOnPlay&&(i.setPlaybackRate(a),i.setVolume(r?0:t),n(),i.startOnPlay=!1),o(),i.seekOnPlay&&(i.seekTo(i.seekOnPlay),i.seekOnPlay=null),i.onDurationCheck()},i.onReady=function(){var e=i.props,t=e.onReady,r=e.playing;i.isReady=!0,i.loadingSDK=!1,t(),(r||i.preloading)&&(i.preloading=!1,i.loadOnReady?(i.load(i.loadOnReady),i.loadOnReady=null):i.play()),i.onDurationCheck()},i.onDurationCheck=function(){clearTimeout(i.durationCheckTimeout);var e=i.getDuration();e?i.props.onDuration(e):i.durationCheckTimeout=setTimeout(i.onDurationCheck,100)},a=r,o(i,a)}return i(t,e),a(t,[{key:"componentDidMount",value:function(){var e=this.props.url;this.mounted=!0,e&&this.load(e)}},{key:"componentWillUnmount",value:function(){this.stop(),this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,r=t.url,n=t.playing,o=t.volume,i=t.muted,a=t.playbackRate;r!==e.url&&e.url?(this.seekOnPlay=null,this.startOnPlay=!0,this.load(e.url)):r&&!e.url?(this.stop(),clearTimeout(this.updateTimeout)):!n&&e.playing?this.play():n&&!e.playing?this.pause():o===e.volume||e.muted?i!==e.muted?this.setVolume(e.muted?0:e.volume):a!==e.playbackRate&&this.setPlaybackRate(e.playbackRate):this.setVolume(e.volume)}},{key:"shouldComponentUpdate",value:function(e){return this.props.url!==e.url}},{key:"seekTo",value:function(e){var t=this;return this.isReady||0===e||(this.seekOnPlay=e,setTimeout(function(){t.seekOnPlay=null},5e3)),e>0&&e<1?this.getDuration()*e:e}}]),t}(u.Component);l.propTypes=s.propTypes,l.defaultProps=s.defaultProps,t.default=l,e.exports=t.default},function(e,t,r){"use strict";(function(n,o){var i,a,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(n,o){"object"===u(t)&&void 0!==e?e.exports=o():(i=o,void 0!==(a="function"==typeof i?i.call(t,r,t,e):i)&&(e.exports=a))}(0,function(){function e(e){var t=void 0===e?"undefined":u(e);return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}function i(e){G=e}function a(e){W=e}function s(){return void 0!==q?function(){q(c)}:l()}function l(){var e=setTimeout;return function(){return e(c,1)}}function c(){for(var e=0;e<$;e+=2){(0,Z[e])(Z[e+1]),Z[e]=void 0,Z[e+1]=void 0}$=0}function f(e,t){var r=arguments,n=this,o=new this.constructor(y);void 0===o[te]&&x(o);var i=n._state;return i?function(){var e=r[i-1];W(function(){return S(i,o,e,n._result)})}():E(n,o,e,t),o}function p(e){var t=this;if(e&&"object"===(void 0===e?"undefined":u(e))&&e.constructor===t)return e;var r=new t(y);return _(r,e),r}function y(){}function d(){return new TypeError("You cannot resolve a promise with itself")}function h(){return new TypeError("A promises callback cannot return that same promise.")}function v(e){try{return e.then}catch(e){return ie.error=e,ie}}function b(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function m(e,t,r){W(function(e){var n=!1,o=b(r,t,function(r){n||(n=!0,t!==r?_(e,r):k(e,r))},function(t){n||(n=!0,O(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,O(e,o))},e)}function g(e,t){t._state===ne?k(e,t._result):t._state===oe?O(e,t._result):E(t,void 0,function(t){return _(e,t)},function(t){return O(e,t)})}function w(e,r,n){r.constructor===e.constructor&&n===f&&r.constructor.resolve===p?g(e,r):n===ie?(O(e,ie.error),ie.error=null):void 0===n?k(e,r):t(n)?m(e,r,n):k(e,r)}function _(t,r){t===r?O(t,d()):e(r)?w(t,r,v(r)):k(t,r)}function P(e){e._onerror&&e._onerror(e._result),j(e)}function k(e,t){e._state===re&&(e._result=t,e._state=ne,0!==e._subscribers.length&&W(j,e))}function O(e,t){e._state===re&&(e._state=oe,e._result=t,W(P,e))}function E(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ne]=r,o[i+oe]=n,0===i&&e._state&&W(j,e)}function j(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,a=0;a<t.length;a+=3)n=t[a],o=t[a+r],n?S(r,n,o,i):o(i);e._subscribers.length=0}}function T(){this.error=null}function R(e,t){try{return e(t)}catch(e){return ae.error=e,ae}}function S(e,r,n,o){var i=t(n),a=void 0,u=void 0,s=void 0,l=void 0;if(i){if(a=R(n,o),a===ae?(l=!0,u=a.error,a.error=null):s=!0,r===a)return void O(r,h())}else a=o,s=!0;r._state!==re||(i&&s?_(r,a):l?O(r,u):e===ne?k(r,a):e===oe&&O(r,a))}function D(e,t){try{t(function(t){_(e,t)},function(t){O(e,t)})}catch(t){O(e,t)}}function A(){return ue++}function x(e){e[te]=ue++,e._state=void 0,e._result=void 0,e._subscribers=[]}function C(e,t){this._instanceConstructor=e,this.promise=new e(y),this.promise[te]||x(this.promise),H(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?k(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&k(this.promise,this._result))):O(this.promise,L())}function L(){return new Error("Array Methods must be provided an Array")}function F(e){return new C(this,e).promise}function I(e){var t=this;return new t(H(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function M(e){var t=this,r=new t(y);return O(r,e),r}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function U(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(e){this[te]=A(),this._result=this._state=void 0,this._subscribers=[],y!==e&&("function"!=typeof e&&B(),this instanceof V?D(this,e):U())}function N(){var e=void 0;if(void 0!==o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=V}var K=void 0;K=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var H=K,$=0,q=void 0,G=void 0,W=function(e,t){Z[$]=e,Z[$+1]=t,2===($+=2)&&(G?G(c):ee())},Y="undefined"!=typeof window?window:void 0,z=Y||{},X=z.MutationObserver||z.WebKitMutationObserver,J="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),Q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Z=new Array(1e3),ee=void 0;ee=J?function(){return function(){return n.nextTick(c)}}():X?function(){var e=0,t=new X(c),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}():Q?function(){var e=new MessageChannel;return e.port1.onmessage=c,function(){return e.port2.postMessage(0)}}():void 0===Y?function(){try{var e=r(15);return q=e.runOnLoop||e.runOnContext,s()}catch(e){return l()}}():l();var te=Math.random().toString(36).substring(16),re=void 0,ne=1,oe=2,ie=new T,ae=new T,ue=0;return C.prototype._enumerate=function(e){for(var t=0;this._state===re&&t<e.length;t++)this._eachEntry(e[t],t)},C.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===p){var o=v(e);if(o===f&&e._state!==re)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===V){var i=new r(y);w(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},C.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===re&&(this._remaining--,e===oe?O(n,r):this._result[t]=r),0===this._remaining&&k(n,this._result)},C.prototype._willSettleAt=function(e,t){var r=this;E(e,void 0,function(e){return r._settledAt(ne,t,e)},function(e){return r._settledAt(oe,t,e)})},V.all=F,V.race=I,V.resolve=p,V.reject=M,V._setScheduler=i,V._setAsap=a,V._asap=W,V.prototype={constructor:V,then:f,catch:function(e){return this.then(null,e)}},V.polyfill=N,V.Promise=V,V}),e.exports=o.Promise}).call(t,r(13),r(14))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEPRECATED_CONFIG_PROPS=t.defaultProps=t.propTypes=void 0;var n=r(8),o=function(e){return e&&e.__esModule?e:{default:e}}(n),i=o.default.string,a=o.default.bool,u=o.default.number,s=o.default.array,l=o.default.oneOfType,c=o.default.shape,f=o.default.object,p=o.default.func;t.propTypes={url:l([i,s]),playing:a,loop:a,controls:a,volume:u,muted:a,playbackRate:u,width:l([i,u]),height:l([i,u]),style:f,progressFrequency:u,playsinline:a,config:c({soundcloud:c({options:f}),youtube:c({playerVars:f,preload:a}),facebook:c({appId:i}),dailymotion:c({params:f,preload:a}),vimeo:c({iframeParams:f,preload:a}),vidme:c({format:i}),file:c({attributes:f,tracks:s,forceAudio:a,forceHLS:a,forceDASH:a}),wistia:c({options:f})}),onReady:p,onStart:p,onPlay:p,onPause:p,onBuffer:p,onEnded:p,onError:p,onDuration:p,onSeek:p,onProgress:p},t.defaultProps={playing:!1,loop:!1,controls:!1,volume:.8,muted:!1,playbackRate:1,width:640,height:360,style:{},progressFrequency:1e3,playsinline:!1,config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{autoplay:0,playsinline:1,showinfo:0,rel:0,iv_load_policy:3},preload:!1},facebook:{appId:"1309697205772819"},dailymotion:{params:{autoplay:0,api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,autoplay:!1,byline:!1,portrait:!1,title:!1},preload:!1},vidme:{format:null},file:{attributes:{},tracks:[],forceAudio:!1,forceHLS:!1,forceDASH:!1},wistia:{options:{}}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onSeek:function(){},onProgress:function(){}},t.DEPRECATED_CONFIG_PROPS=["soundcloudConfig","youtubeConfig","facebookConfig","dailymotionConfig","vimeoConfig","vidmeConfig","fileConfig","wistiaConfig"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},c=r(0),f=n(c),p=r(2),y=n(p),d=r(1),h=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,v=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,b=/\.(m3u8)($|\?)/i,m=/\.(mpd)($|\?)/i,g=function(e){function t(){var e,r,n,a;o(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return r=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),n.onSeek=function(e){n.props.onSeek(e.target.currentTime)},n.renderSource=function(e){if("string"==typeof e)return f.default.createElement("source",{key:e,src:e});var t=e.src,r=e.type;return f.default.createElement("source",{key:t,src:t,type:r})},n.renderTrack=function(e,t){return f.default.createElement("track",u({key:t},e))},n.ref=function(e){n.player=e},a=r,i(n,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this,r=this.props,n=r.playsinline,o=r.onPause,i=r.onEnded,a=r.onError;this.player.addEventListener("canplay",this.onReady),this.player.addEventListener("play",this.onPlay),this.player.addEventListener("pause",function(){e.mounted&&o()}),this.player.addEventListener("seeked",this.onSeek),this.player.addEventListener("ended",i),this.player.addEventListener("error",a),n&&(this.player.setAttribute("playsinline",""),this.player.setAttribute("webkit-playsinline","")),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"componentWillUnmount",value:function(){var e=this.props,r=e.onPause,n=e.onEnded,o=e.onError;this.player.removeEventListener("canplay",this.onReady),this.player.removeEventListener("play",this.onPlay),this.player.removeEventListener("pause",r),this.player.removeEventListener("seeked",this.onSeek),this.player.removeEventListener("ended",n),this.player.removeEventListener("error",o),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillUnmount",this).call(this)}},{key:"shouldUseHLS",value:function(e){return b.test(e)||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return m.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this;this.shouldUseHLS(e)&&(0,d.getSDK)("https://cdn.jsdelivr.net/hls.js/latest/hls.min.js","Hls").then(function(r){t.hls=new r,t.hls.loadSource(e),t.hls.attachMedia(t.player)}),this.shouldUseDASH(e)&&(0,d.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.5.0/dash.all.min.js","dashjs").then(function(r){var n=r.MediaPlayer().create();n.initialize(t.player,e,!0),n.getDebug().setLogToBrowserConsole(!1)})}},{key:"play",value:function(){this.player.play().catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.hls&&this.hls.detachMedia()}},{key:"seekTo",value:function(e){var r=l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.player.currentTime=r}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){return this.isReady?this.player.duration:null}},{key:"getFractionPlayed",value:function(){return this.isReady?this.player.currentTime/this.getDuration():null}},{key:"getFractionLoaded",value:function(){return this.isReady&&0!==this.player.buffered.length?this.player.buffered.end(0)/this.getDuration():null}},{key:"render",value:function(){var e=this.props,t=e.url,r=e.loop,n=e.controls,o=e.config,i=e.width,a=e.height,s=h.test(t)||o.file.forceAudio,l=this.shouldUseHLS(t),c=this.shouldUseDASH(t),p=s?"audio":"video",y=t instanceof Array||l||c?void 0:t,d={width:i&&"auto"!==i?"100%":i,height:a&&"auto"!==a?"100%":a,display:t?"block":"none"};return f.default.createElement(p,u({ref:this.ref,src:y,style:d,preload:"auto",controls:n,loop:r},o.file.attributes),t instanceof Array&&t.map(this.renderSource),o.file.tracks.map(this.renderTrack))}}],[{key:"canPlay",value:function(e){return h.test(e)||v.test(e)||b.test(e)||m.test(e)}}]),t}(y.default);g.displayName="FilePlayer",t.default=g,e.exports=t.default},function(e,t,r){"use strict";(function(t){!function(e){function r(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return m.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function a(e){if(e.bodyUsed)return t.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new t(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function s(e){var t=new FileReader,r=u(t);return t.readAsArrayBuffer(e),r}function l(e){var t=new FileReader,r=u(t);return t.readAsText(e),r}function c(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(m.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(m.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(m.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(m.arrayBuffer&&m.blob&&w(e))this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!m.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!_(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=f(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):m.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},m.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(c(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},m.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function y(e){var t=e.toUpperCase();return P.indexOf(t)>-1?t:e}function d(e,t){t=t||{};var r=t.body;if(e instanceof d){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=y(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function h(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function v(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t}function b(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var m={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(m.arrayBuffer)var g=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=function(e){return e&&DataView.prototype.isPrototypeOf(e)},_=ArrayBuffer.isView||function(e){return e&&g.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,t){e=r(e),t=n(t);var o=this.map[e];this.map[e]=o?o+","+t:t},i.prototype.delete=function(e){delete this.map[r(e)]},i.prototype.get=function(e){return e=r(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(r(e))},i.prototype.set=function(e,t){this.map[r(e)]=n(t)},i.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),o(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),o(e)},m.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var P=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},p.call(d.prototype),p.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];b.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=d,e.Response=b,e.fetch=function(e,r){return new t(function(t,n){var o=new d(e,r),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:v(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var r="response"in i?i.response:i.responseText;t(new b(r,e))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&m.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0),e.exports=self.fetch}).call(t,r(3))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(0),c=n(l),f=r(4),p=r(1),y=r(18),d=n(y),h=r(19),v=n(h),b=r(20),m=n(b),g=r(21),w=n(g),_=r(5),P=n(_),k=r(22),O=n(k),E=r(23),j=n(E),T=r(24),R=n(T),S=r(25),D=n(S),A=r(26),x=n(A),C=Object.keys(f.propTypes),L=[d.default,v.default,m.default,w.default,O.default,j.default,R.default,x.default,D.default],F=function(e){function t(){var e,r,n,a;o(this,t);for(var s=arguments.length,l=Array(s),y=0;y<s;y++)l[y]=arguments[y];return r=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),n.config=(0,p.getConfig)(n.props,f.defaultProps,!0),n.seekTo=function(e){if(!n.player)return null;n.player.seekTo(e)},n.getDuration=function(){return n.player?n.player.getDuration():null},n.getCurrentTime=function(){if(!n.player)return null;var e=n.player.getDuration(),t=n.player.getFractionPlayed();return null===e||null===t?null:t*e},n.getInternalPlayer=function(){return n.player.player},n.progress=function(){if(n.props.url&&n.player){var e=n.player.getFractionLoaded()||0,t=n.player.getFractionPlayed()||0,r=n.player.getDuration(),o={};e!==n.prevLoaded&&(o.loaded=e,r&&(o.loadedSeconds=o.loaded*r)),t!==n.prevPlayed&&(o.played=t,r&&(o.playedSeconds=o.played*r)),(o.loaded||o.played)&&n.props.onProgress(o),n.prevLoaded=e,n.prevPlayed=t}n.progressTimeout=setTimeout(n.progress,n.props.progressFrequency)},n.renderPlayer=function(e){return c.default.createElement(e,u({},n.props,{ref:n.ref,key:e.displayName,config:n.config}))},n.ref=function(e){n.player=e},n.renderPreloadPlayer=function(e){return c.default.createElement(e,{key:e.displayName,config:n.config})},a=r,i(n,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout)}},{key:"shouldComponentUpdate",value:function(e){return this.props.url!==e.url||this.props.playing!==e.playing||this.props.volume!==e.volume||this.props.muted!==e.muted||this.props.playbackRate!==e.playbackRate||this.props.height!==e.height||this.props.width!==e.width||this.props.hidden!==e.hidden}},{key:"renderActivePlayer",value:function(e){if(!e)return null;var t=!0,r=!1,n=void 0;try{for(var o,i=L[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.canPlay(e))return this.renderPlayer(a)}}catch(e){r=!0,n=e}finally{try{!t&&i.return&&i.return()}finally{if(r)throw n}}return this.renderPlayer(P.default)}},{key:"renderPreloadPlayers",value:function(e){if(!e)return null;var t=[];return!d.default.canPlay(e)&&this.config.youtube.preload&&t.push(d.default),!m.default.canPlay(e)&&this.config.vimeo.preload&&t.push(m.default),!D.default.canPlay(e)&&this.config.dailymotion.preload&&t.push(D.default),t.map(this.renderPreloadPlayer)}},{key:"render",value:function(){var e=this.props,t=e.url,r=e.style,n=e.width,o=e.height,i=(0,p.omit)(this.props,C,f.DEPRECATED_CONFIG_PROPS),a=this.renderActivePlayer(t),s=this.renderPreloadPlayers(t);return c.default.createElement("div",u({style:u({},r,{width:n,height:o})},i),a,s)}}]),t}(l.Component);F.displayName="ReactPlayer",F.propTypes=f.propTypes,F.defaultProps=f.defaultProps,F.canPlay=function(e){var t=[].concat(L,[P.default]),r=!0,n=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){if(i.value.canPlay(e))return!0}}catch(e){n=!0,o=e}finally{try{!r&&a.return&&a.return()}finally{if(n)throw o}}return!1},t.default=F,e.exports=t.default},function(e,t,r){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=r(9)()},function(e,t,r){"use strict";var n=r(10),o=r(11),i=r(12);e.exports=function(){function e(e,t,r,n,a,u){u!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,r){"use strict";function n(e,t,r,n,i,a,u,s){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,a,u,s],f=0;l=new Error(t.replace(/%s/g,function(){return c[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=n},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function a(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function u(){v&&d&&(v=!1,d.length?h=d.concat(h):b=-1,h.length&&s())}function s(){if(!v){var e=i(u);v=!0;for(var t=h.length;t;){for(d=h,h=[];++b<t;)d&&d[b].run();b=-1,t=h.length}d=null,v=!1,a(e)}}function l(e,t){this.fun=e,this.array=t}function c(){}var f,p,y=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var d,h=[],v=!1,b=-1;y.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new l(e,t)),1!==h.length||v||i(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},y.title="browser",y.browser=!0,y.env={},y.argv=[],y.version="",y.versions={},y.on=c,y.addListener=c,y.once=c,y.off=c,y.removeListener=c,y.removeAllListeners=c,y.emit=c,y.prependListener=c,y.prependOnceListener=c,y.listeners=function(e){return[]},y.binding=function(e){throw new Error("process.binding is not supported")},y.cwd=function(){return"/"},y.chdir=function(e){throw new Error("process.chdir is not supported")},y.umask=function(){return 0}},function(e,t,r){"use strict";var n,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(n=window)}e.exports=n},function(e,t){},function(e,t,r){"use strict";function n(e,t){for(var r in t)e.setAttribute(r,t[r])}function o(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function i(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,t,r){var a=document.head||document.getElementsByTagName("head")[0],u=document.createElement("script");"function"==typeof t&&(r=t,t={}),t=t||{},r=r||function(){},u.type=t.type||"text/javascript",u.charset=t.charset||"utf8",u.async=!("async"in t)||!!t.async,u.src=e,t.attrs&&n(u,t.attrs),t.text&&(u.text=""+t.text),("onload"in u?o:i)(u,r),u.onload||o(u,r),a.appendChild(u)}},function(e,t,r){"use strict";function n(e){return!!e&&"object"===(void 0===e?"undefined":c(e))}function o(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"!==t&&"[object Date]"!==t}function i(e){return Array.isArray(e)?[]:{}}function a(e,t){return t&&!0===t.clone&&f(e)?l(i(e),e,t):e}function u(e,t,r){var n=e.slice();return t.forEach(function(t,o){void 0===n[o]?n[o]=a(t,r):f(t)?n[o]=l(e[o],t,r):-1===e.indexOf(t)&&n.push(a(t,r))}),n}function s(e,t,r){var n={};return f(e)&&Object.keys(e).forEach(function(t){n[t]=a(e[t],r)}),Object.keys(t).forEach(function(o){f(t[o])&&e[o]?n[o]=l(e[o],t[o],r):n[o]=a(t[o],r)}),n}function l(e,t,r){var n=Array.isArray(t),o=Array.isArray(e),i=r||{arrayMerge:u};if(n===o)return n?(i.arrayMerge||u)(e,t,r):s(e,t,r);return a(t,r)}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=function(e){return n(e)&&o(e)};l.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,r){return l(e,r,t)})};var p=l;e.exports=p},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},c=r(0),f=n(c),p=r(2),y=n(p),d=r(1),h="YT",v=/^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/,b=function(e){function t(){var e,r,n,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return r=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),n.onStateChange=function(e){var t=e.data,r=n.props,o=r.onPause,i=r.onBuffer,a=window[h].PlayerState,u=a.PLAYING,s=a.PAUSED,l=a.BUFFERING,c=a.ENDED,f=a.CUED;t===u&&n.onPlay(),t===s&&o(),t===l&&i(),t===c&&n.onEnded(),t===f&&n.onReady()},n.onEnded=function(){var e=n.props,t=e.loop,r=e.onEnded;t&&n.seekTo(0),r()},n.ref=function(e){n.container=e},a=r,i(n,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props,r=e.url,n=e.config;!r&&n.youtube.preload&&(this.preloading=!0,this.load("https://www.youtube.com/watch?v=GlCmAC4MHek")),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"load",value:function(e){var t=this,r=this.props,n=r.playsinline,o=r.controls,i=r.config,a=r.onError,s=e&&e.match(v)[1];return this.isReady?void this.player.cueVideoById({videoId:s,startSeconds:(0,d.parseStartTime)(e)}):this.loadingSDK?void(this.loadOnReady=e):(this.loadingSDK=!0,void(0,d.getSDK)("https://www.youtube.com/iframe_api",h,"onYouTubeIframeAPIReady",function(e){return e.loaded}).then(function(r){t.player=new r.Player(t.container,{width:"100%",height:"100%",videoId:s,playerVars:u({controls:o?1:0,start:(0,d.parseStartTime)(e),origin:window.location.origin,playsinline:n},i.youtube.playerVars),events:{onReady:t.onReady,onStateChange:t.onStateChange,onError:function(e){return a(e.data)}}})},a))}},{key:"play",value:function(){this.isReady&&this.player.playVideo&&this.player.playVideo()}},{key:"pause",value:function(){this.isReady&&this.player.pauseVideo&&this.player.pauseVideo()}},{key:"stop",value:function(){this.isReady&&this.player.stopVideo&&document.body.contains(this.player.getIframe())&&this.player.stopVideo()}},{key:"seekTo",value:function(e){var r=l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.isReady&&this.player.seekTo&&this.player.seekTo(r)}},{key:"setVolume",value:function(e){this.isReady&&this.player.setVolume&&this.player.setVolume(100*e)}},{key:"setPlaybackRate",value:function(e){this.isReady&&this.player.setPlaybackRate&&this.player.setPlaybackRate(e)}},{key:"getDuration",value:function(){return this.isReady&&this.player.getDuration?this.player.getDuration():null}},{key:"getFractionPlayed",value:function(){return this.isReady&&this.getDuration()?this.player.getCurrentTime()/this.getDuration():null}},{key:"getFractionLoaded",value:function(){return this.isReady&&this.player.getVideoLoadedFraction?this.player.getVideoLoadedFraction():null}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.url?"block":"none"};return f.default.createElement("div",{style:e},f.default.createElement("div",{ref:this.ref}))}}],[{key:"canPlay",value:function(e){return v.test(e)}}]),t}(y.default);b.displayName="YouTube",t.default=b,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},c=r(0),f=n(c),p=r(2),y=n(p),d=r(1),h=/^https?:\/\/(soundcloud.com|snd.sc)\/([a-z0-9-_]+\/[a-z0-9-_]+)$/,v={visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1},b=function(e){function t(){var e,r,n,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return r=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),n.player=null,n.duration=null,n.fractionPlayed=null,n.fractionLoaded=null,n.ref=function(e){n.iframe=e},a=r,i(n,a)}return a(t,e),s(t,[{key:"load",value:function(e){var t=this;(0,d.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(function(r){var n=r.Widget.Events,o=n.PLAY,i=n.PLAY_PROGRESS,a=n.PAUSE,s=n.FINISH,l=n.ERROR;t.isReady||(t.player=r.Widget(t.iframe),t.player.bind(o,t.onPlay),t.player.bind(i,function(e){t.fractionPlayed=e.relativePosition,t.fractionLoaded=e.loadedProgress}),t.player.bind(a,function(){return t.props.onPause()}),t.player.bind(s,function(){return t.props.onEnded()}),t.player.bind(l,function(e){return t.props.onError(e)})),t.player.load(e,u({},v,t.props.config.soundcloud.options,{callback:function(){t.player.getDuration(function(e){t.duration=e/1e3,t.onReady()})}}))})}},{key:"call",value:function(e){var t;if(this.isReady&&this.player&&this.player[e]){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=this.player)[e].apply(t,n)}}},{key:"play",value:function(){this.call("play")}},{key:"pause",value:function(){this.call("pause")}},{key:"stop",value:function(){this.pause(),this.call("seekTo",0)}},{key:"seekTo",value:function(e){var r=l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.call("seekTo",1e3*r)}},{key:"setVolume",value:function(e){this.call("setVolume",100*e)}},{key:"setPlaybackRate",value:function(){}},{key:"getDuration",value:function(){return this.duration}},{key:"getFractionLoaded",value:function(){return this.fractionLoaded}},{key:"getFractionPlayed",value:function(){return this.fractionPlayed}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return f.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url="+encodeURIComponent(this.props.url),style:e,frameBorder:0})}}],[{key:"canPlay",value:function(e){return h.test(e)}}]),t}(y.default);b.displayName="SoundCloud",t.default=b,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},c=r(0),f=n(c),p=r(2),y=n(p),d=r(1),h=/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,v=function(e){function t(){var e,r,n,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return r=n=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),n.ref=function(e){n.container=e},a=r,i(n,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props,r=e.url,n=e.config;!r&&n.vimeo.preload&&(this.preloading=!0,this.load("https://vimeo.com/127250231")),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"load",value:function(e){var t=this,r=e.match(h)[3];return this.duration=null,this.isReady?void this.player.loadVideo(r):this.loadingSDK?void(this.loadOnReady=e):(this.loadingSDK=!0,void(0,d.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(function(r){t.player=new r.Player(t.container,u({},t.props.config.vimeo.playerOptions,{url:e,loop:t.props.loop})),t.player.on("loaded",function(){t.onReady();var e=t.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"}),t.player.on("play",function(e){var r=e.duration;t.duration=r,t.onPlay()}),t.player.on("pause",t.props.onPause),t.player.on("seeked",function(e){return t.props.onSeek(e.seconds)}),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",function(e){var r=e.percent;t.fractionPlayed=r}),t.player.on("progress",function(e){var r=e.percent;t.fractionLoaded=r})},this.props.onError))}},{key:"play",value:function(){this.isReady&&this.player.play()}},{key:"pause",value:function(){this.isReady&&this.player.pause()}},{key:"stop",value:function(){this.isReady&&this.player.unload()}},{key:"seekTo",value:function(e){var r=l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.isReady&&this.player.setCurrentTime&&this.player.setCurrentTime(r)}},{key:"setVolume",value:function(e){this.player.setVolume(e)}},{key:"setPlaybackRate",value:function(e){return null}},{key:"getDuration",value:function(){return this.duration}},{key:"getFractionPlayed",value:function(){return this.fractionPlayed||null}},{key:"getFractionLoaded",value:function(){return this.fractionLoaded||null}},{key:"render",value:function(){var e={height:"100%",display:this.props.url?"block":"none"};return f.default.createElement("div",{style:e,ref:this.ref})}}],[{key:"canPlay",value:function(e){return h.test(e)}}]),t}(y.default);v.displayName="Vimeo",t.default=v,e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModu