Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-player

Package Overview
Dependencies
Maintainers
1
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-player - npm Package Compare versions

Comparing version 0.25.3 to 1.0.0-beta.0

lib/Player.js

7

CHANGELOG.md

@@ -7,2 +7,9 @@ # Change Log

#### [v1.0.0-beta.0](https://github.com/CookPete/react-player/compare/v0.25.3...v1.0.0-beta.0)
> 26 October 2017
* Refactor player rendering [`91d1542`](https://github.com/CookPete/react-player/commit/91d15424065575d759885e9b0f8969c8b1f4a7b4)
* Update tests [`9b4d1c4`](https://github.com/CookPete/react-player/commit/9b4d1c4da466010e0d9f8a99f725b4e0c96db615)
#### [v0.25.3](https://github.com/CookPete/react-player/compare/v0.25.2...v0.25.3)

@@ -9,0 +16,0 @@ > 26 October 2017

2

dist/ReactPlayer.js

@@ -1,2 +0,2 @@

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=5)}([function(e,t){e.exports=React},function(e,t,r){"use strict";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 a(e){var t=e.match(b);if(t){var r=t[1];if(r.match(m))return i(r);if(g.test(r))return parseInt(r,10)}return 0}function i(e){for(var t=0,r=m.exec(e);null!==r;){var n=r,o=p(n,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)),r=m.exec(e)}return t}function l(){return Math.random().toString(36).substr(2,5)}function u(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};return window[t]&&n(window[t])?Promise.resolve(window[t]):new Promise(function(n,o){if(r){var a=window[r];window[r]=function(){a&&a(),n(window[t])}}(0,y.default)(e,function(e){e&&o(e),r||n(window[t])})})}function s(e,t,r){var n=(0,h.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=v.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(n=(0,h.default)(n,o({},p,e[c])),r){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 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 a=(t=[]).concat.apply(t,n),i={},l=Object.keys(e),u=!0,s=!1,c=void 0;try{for(var p,f=l[Symbol.iterator]();!(u=(p=f.next()).done);u=!0){var y=p.value;-1===a.indexOf(y)&&(i[y]=e[y])}}catch(e){s=!0,c=e}finally{try{!u&&f.return&&f.return()}finally{if(s)throw c}}return i}Object.defineProperty(t,"__esModule",{value:!0});var p=function(){function e(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(n=(i=l.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&l.return&&l.return()}finally{if(o)throw a}}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=a,t.randomString=l,t.getSDK=u,t.getConfig=s,t.omit=c;var f=r(11),y=n(f),d=r(12),h=n(d),v=r(3),b=/[?&#](?:start|t)=([0-9hms]+)/,m=/(\d+)(h|m|s)/g,g=/^\d+$/},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 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 i=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),u=r(3),s=function(e){function t(){var e,r,a,i;n(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return r=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.isReady=!1,a.startOnPlay=!0,a.seekOnPlay=null,a.onPlay=function(){var e=a.props,t=e.volume,r=e.muted,n=e.onStart,o=e.onPlay,i=e.playbackRate;a.startOnPlay&&(a.setPlaybackRate&&a.setPlaybackRate(i),a.setVolume(r?0:t),n(),a.startOnPlay=!1),o(),a.seekOnPlay&&(a.seekTo(a.seekOnPlay),a.seekOnPlay=null),a.onDurationCheck()},a.onReady=function(){var e=a.props,t=e.onReady,r=e.playing;a.isReady=!0,a.loadingSDK=!1,t(),(r||a.preloading)&&(a.preloading=!1,a.loadOnReady?(a.load(a.loadOnReady),a.loadOnReady=null):a.play()),a.onDurationCheck()},a.onDurationCheck=function(){clearTimeout(a.durationCheckTimeout);var e=a.getDuration();e?a.props.onDuration(e):a.durationCheckTimeout=setTimeout(a.onDurationCheck,100)},i=r,o(a,i)}return a(t,e),i(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,a=t.muted,i=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||this.setVolume(e.volume),a!==e.muted&&this.setVolume(e.muted?0:e.volume),i!==e.playbackRate&&this.setPlaybackRate&&this.setPlaybackRate(e.playbackRate)}},{key:"shouldComponentUpdate",value:function(e){return this.props.url!==e.url||this.props.loop!==e.loop}},{key:"callPlayer",value:function(e){var t;if(!this.isReady||!this.player||!this.player[e]){var r="ReactPlayer: "+this.constructor.displayName+" player could not call %c"+e+"%c – ";return this.isReady?this.player?this.player[e]||(r+="The method was not available"):r+="The player was not available":r+="The player was not ready",console.warn(r,"font-weight: bold",""),null}for(var n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return(t=this.player)[e].apply(t,o)}},{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}(l.Component);s.propTypes=u.propTypes,s.defaultProps=u.defaultProps,t.default=s,e.exports=t.default},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(6),o=function(e){return e&&e.__esModule?e:{default:e}}(n),a=o.default.string,i=o.default.bool,l=o.default.number,u=o.default.array,s=o.default.oneOfType,c=o.default.shape,p=o.default.object,f=o.default.func;t.propTypes={url:s([a,u]),playing:i,loop:i,controls:i,volume:l,muted:i,playbackRate:l,width:s([a,l]),height:s([a,l]),style:p,progressFrequency:l,playsinline:i,config:c({soundcloud:c({options:p}),youtube:c({playerVars:p,preload:i}),facebook:c({appId:a}),dailymotion:c({params:p,preload:i}),vimeo:c({iframeParams:p,preload:i}),vidme:c({format:a}),file:c({attributes:p,tracks:u,forceAudio:i,forceHLS:i,forceDASH:i}),wistia:c({options:p})}),onReady:f,onStart:f,onPlay:f,onPause:f,onBuffer:f,onEnded:f,onError:f,onDuration:f,onSeek:f,onProgress:f},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:{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 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});var l=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},u=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}}(),s=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},c=r(0),p=n(c),f=r(2),y=n(f),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,i;o(this,t);for(var u=arguments.length,s=Array(u),c=0;c<u;c++)s[c]=arguments[c];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),n.onSeek=function(e){n.props.onSeek(e.target.currentTime)},n.renderSource=function(e){if("string"==typeof e)return p.default.createElement("source",{key:e,src:e});var t=e.src,r=e.type;return p.default.createElement("source",{key:t,src:t,type:r})},n.renderTrack=function(e,t){return p.default.createElement("track",l({key:t},e))},n.ref=function(e){n.player=e},i=r,a(n,i)}return i(t,e),u(t,[{key:"componentDidMount",value:function(){this.addListeners(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"componentWillReceiveProps",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.removeListeners(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillReceiveProps",this).call(this,e)}},{key:"componentDidUpdate",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillUnmount",this).call(this)}},{key:"addListeners",value:function(){var e=this.props,t=e.playsinline,r=e.onPause,n=e.onEnded,o=e.onError;this.player.addEventListener("canplay",this.onReady),this.player.addEventListener("play",this.onPlay),this.player.addEventListener("pause",r),this.player.addEventListener("seeked",this.onSeek),this.player.addEventListener("ended",n),this.player.addEventListener("error",o),t&&(this.player.setAttribute("playsinline",""),this.player.setAttribute("webkit-playsinline",""))}},{key:"removeListeners",value:function(){var e=this.props,t=e.onPause,r=e.onEnded,n=e.onError;this.player.removeEventListener("canplay",this.onReady),this.player.removeEventListener("play",this.onPlay),this.player.removeEventListener("pause",t),this.player.removeEventListener("seeked",this.onSeek),this.player.removeEventListener("ended",r),this.player.removeEventListener("error",n)}},{key:"shouldUseAudio",value:function(e){return h.test(e.url)||e.config.file.forceAudio}},{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){t.dash=r.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.getDebug().setLogToBrowserConsole(!1)})}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.hls&&this.hls.destroy(),this.dash&&this.dash.reset()}},{key:"seekTo",value:function(e){var r=s(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.player.duration}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return 0===this.player.buffered.length?0:this.player.buffered.end(0)}},{key:"render",value:function(){var e=this.props,t=e.url,r=e.loop,n=e.controls,o=e.config,a=e.width,i=e.height,u=this.shouldUseAudio(this.props),s=this.shouldUseHLS(t),c=this.shouldUseDASH(t),f=u?"audio":"video",y=t instanceof Array||s||c?void 0:t,d={width:a&&"auto"!==a?"100%":a,height:i&&"auto"!==i?"100%":i,display:t?"block":"none"};return p.default.createElement(f,l({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){if(e instanceof Array){var t=!0,r=!1,n=void 0;try{for(var o,a=e[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var i=o.value;if("string"==typeof i&&this.canPlay(i))return!0;if(this.canPlay(i.src))return!0}}catch(e){r=!0,n=e}finally{try{!t&&a.return&&a.return()}finally{if(r)throw n}}return!1}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 n(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function a(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 l(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}}(),c=r(0),p=n(c),f=r(3),y=r(1),d=r(13),h=n(d),v=r(14),b=n(v),m=r(15),g=n(m),P=r(16),k=n(P),w=r(4),_=n(w),O=r(17),j=n(O),E=r(18),T=n(E),S=r(19),D=n(S),R=r(20),C=n(R),A=r(21),L=n(A),x=Object.keys(f.propTypes),I=[h.default,b.default,g.default,k.default,j.default,T.default,D.default,L.default,C.default],ReactPlayer=function(e){function ReactPlayer(){var e,t,r,n;a(this,ReactPlayer);for(var o=arguments.length,l=Array(o),s=0;s<o;s++)l[s]=arguments[s];return t=r=i(this,(e=ReactPlayer.__proto__||Object.getPrototypeOf(ReactPlayer)).call.apply(e,[this].concat(l))),r.config=(0,y.getConfig)(r.props,f.defaultProps,!0),r.seekTo=function(e){if(!r.player)return null;r.player.seekTo(e)},r.getDuration=function(){return r.player?r.player.getDuration():null},r.getCurrentTime=function(){return r.player?r.player.getCurrentTime():null},r.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return r.player?r.player[e]:null},r.progress=function(){if(r.props.url&&r.player&&r.player.isReady){var e=r.player.getCurrentTime()||0,t=r.player.getSecondsLoaded(),n=r.player.getDuration();if(n){var o={playedSeconds:e,played:e/n};null!==t&&(o.loadedSeconds=t,o.loaded=t/n),o.played===r.prevPlayed&&o.loaded===r.prevLoaded||r.props.onProgress(o),r.prevPlayed=o.played,r.prevLoaded=o.loaded}}r.progressTimeout=setTimeout(r.progress,r.props.progressFrequency)},r.renderPlayer=function(e){return p.default.createElement(e,u({},r.props,{ref:r.activePlayerRef,key:e.displayName,config:r.config}))},r.activePlayerRef=function(e){r.player=e},r.wrapperRef=function(e){r.wrapper=e},r.renderPreloadPlayer=function(e){return p.default.createElement(e,{key:e.displayName,config:r.config})},n=t,i(r,n)}return l(ReactPlayer,e),s(ReactPlayer,[{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.loop!==e.loop||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,a=I[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var i=o.value;if(i.canPlay(e))return this.renderPlayer(i)}}catch(e){r=!0,n=e}finally{try{!t&&a.return&&a.return()}finally{if(r)throw n}}return this.renderPlayer(_.default)}},{key:"renderPreloadPlayers",value:function(e){var t=[];return!h.default.canPlay(e)&&this.config.youtube.preload&&t.push(h.default),!g.default.canPlay(e)&&this.config.vimeo.preload&&t.push(g.default),!C.default.canPlay(e)&&this.config.dailymotion.preload&&t.push(C.default),t.map(this.renderPreloadPlayer)}},{key:"render",value:function(){var e=this.props,t=e.url,r=e.style,n=e.width,a=e.height,i=(0,y.omit)(this.props,x,f.DEPRECATED_CONFIG_PROPS),l=this.renderActivePlayer(t),s=this.renderPreloadPlayers(t);return p.default.createElement("div",u({ref:this.wrapperRef,style:u({},r,{width:n,height:a})},i),[l].concat(o(s)))}}]),ReactPlayer}(c.Component);ReactPlayer.displayName="ReactPlayer",ReactPlayer.propTypes=f.propTypes,ReactPlayer.defaultProps=f.defaultProps,ReactPlayer.canPlay=function(e){var t=[].concat(I,[_.default]),r=!0,n=!1,o=void 0;try{for(var a,i=t[Symbol.iterator]();!(r=(a=i.next()).done);r=!0){if(a.value.canPlay(e))return!0}}catch(e){n=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(n)throw o}}return!1},t.default=ReactPlayer,e.exports=t.default},function(e,t,r){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=r(7)()},function(e,t,r){"use strict";var n=r(8),o=r(9),a=r(10);e.exports=function(){function e(e,t,r,n,i,l){l!==a&&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,exact: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,a,i,l,u){if(o(t),!e){var s;if(void 0===t)s=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,a,i,l,u],p=0;s=new Error(t.replace(/%s/g,function(){return c[p++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}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(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 a(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,t,r){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("script");"function"==typeof t&&(r=t,t={}),t=t||{},r=r||function(){},l.type=t.type||"text/javascript",l.charset=t.charset||"utf8",l.async=!("async"in t)||!!t.async,l.src=e,t.attrs&&n(l,t.attrs),t.text&&(l.text=""+t.text),("onload"in l?o:a)(l,r),l.onload||o(l,r),i.appendChild(l)}},function(e,t,r){"use strict";function n(e){return!!e&&"object"===(void 0===e?"undefined":p(e))}function o(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||a(e)}function a(e){return e.$$typeof===d}function i(e){return Array.isArray(e)?[]:{}}function l(e,t){return t&&!1===t.clone||!f(e)?e:c(i(e),e,t)}function u(e,t,r){return e.concat(t).map(function(e){return l(e,r)})}function s(e,t,r){var n={};return f(e)&&Object.keys(e).forEach(function(t){n[t]=l(e[t],r)}),Object.keys(t).forEach(function(o){f(t[o])&&e[o]?n[o]=c(e[o],t[o],r):n[o]=l(t[o],r)}),n}function c(e,t,r){var n=Array.isArray(t),o=Array.isArray(e),a=r||{arrayMerge:u};if(n===o)return n?(a.arrayMerge||u)(e,t,r):s(e,t,r);return l(t,r)}Object.defineProperty(t,"__esModule",{value:!0});var p="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)},y="function"==typeof Symbol&&Symbol.for,d=y?Symbol.for("react.element"):60103;c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return c(e,r,t)},{})};var h=c;t.default=h,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 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});var l=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},u=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}}(),s=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},c=r(0),p=n(c),f=r(2),y=n(f),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,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),n.onStateChange=function(e){var t=e.data,r=n.props,o=r.onPause,a=r.onBuffer,i=window[h].PlayerState,l=i.PLAYING,u=i.PAUSED,s=i.BUFFERING,c=i.ENDED,p=i.CUED;t===l&&n.onPlay(),t===u&&o(),t===s&&a(),t===c&&n.onEnded(),t===p&&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},i=r,a(n,i)}return i(t,e),u(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")),s(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,a=r.config,i=r.onError,u=e&&e.match(v)[1];return this.isReady?void this.player.cueVideoById({videoId:u,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:u,playerVars:l({controls:o?1:0,start:(0,d.parseStartTime)(e),origin:window.location.origin,playsinline:n},a.youtube.playerVars),events:{onReady:t.onReady,onStateChange:t.onStateChange,onError:function(e){return i(e.data)}}})},i))}},{key:"play",value:function(){this.callPlayer("playVideo")}},{key:"pause",value:function(){this.callPlayer("pauseVideo")}},{key:"stop",value:function(){this.preloading||document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}},{key:"seekTo",value:function(e){var r=s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.callPlayer("seekTo",r)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.url?"block":"none"};return p.default.createElement("div",{style:e},p.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 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});var l=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},u=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}}(),s=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},c=r(0),p=n(c),f=r(2),y=n(f),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,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),n.duration=null,n.currentTime=null,n.fractionLoaded=null,n.ref=function(e){n.iframe=e},i=r,a(n,i)}return i(t,e),u(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,a=n.PLAY_PROGRESS,i=n.PAUSE,u=n.FINISH,s=n.ERROR;t.isReady||(t.player=r.Widget(t.iframe),t.player.bind(o,function(){t.widgetIsPlaying=!0,t.onPlay()}),t.player.bind(i,function(){t.widgetIsPlaying=!1,t.props.onPause()}),t.player.bind(a,function(e){t.currentTime=e.currentPosition/1e3,t.fractionLoaded=e.loadedProgress}),t.player.bind(u,function(){return t.props.onEnded()}),t.player.bind(s,function(e){return t.props.onError(e)})),t.player.load(e,l({},v,t.props.config.soundcloud.options,{callback:function(){t.widgetIsPlaying=!1,t.player.getDuration(function(e){t.duration=e/1e3,t.onReady()})}}))})}},{key:"play",value:function(){this.widgetIsPlaying||this.callPlayer("play")}},{key:"pause",value:function(){this.widgetIsPlaying&&this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){var r=s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.callPlayer("seekTo",1e3*r)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return p.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 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});var l=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},u=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}}(),s=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},c=r(0),p=n(c),f=r(2),y=n(f),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,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),n.duration=null,n.currentTime=null,n.secondsLoaded=null,n.ref=function(e){n.container=e},i=r,a(n,i)}return i(t,e),u(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")),s(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).catch(this.props.onError):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,l({},t.props.config.vimeo.playerOptions,{url:e,loop:t.props.loop})),t.player.ready().then(function(){var e=t.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"}).catch(t.props.onError),t.player.on("loaded",function(){t.onReady(),t.player.getDuration().then(function(e){t.duration=e})}),t.player.on("play",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.seconds;t.currentTime=r}),t.player.on("progress",function(e){var r=e.seconds;t.secondsLoaded=r})},this.props.onError))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.preloading||this.callPlayer("unload")}},{key:"seekTo",value:function(e){var r=s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.callPlayer("setCurrentTime",r)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e={width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",display:this.props.url?"block":"none"};return p.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 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});var l=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=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},s=r(0),c=n(s),p=r(2),f=n(p),y=r(1),d="//connect.facebook.net/en_US/sdk.js",h=/^https:\/\/www\.facebook\.com\/([^\/?].+\/)?video(s|\.php)[\/?].*$/,v="facebook-player-",b=function(e){function t(){var e,r,n,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),n.playerID=v+(0,y.randomString)(),n.onEnded=function(){var e=n.props,t=e.loop,r=e.onEnded;t&&n.seekTo(0),r()},i=r,a(n,i)}return i(t,e),l(t,[{key:"load",value:function(e){var t=this;if(this.isReady)return void(0,y.getSDK)(d,"FB","fbAsyncInit").then(function(e){return e.XFBML.parse()});(0,y.getSDK)(d,"FB","fbAsyncInit").then(function(e){e.init({appId:t.props.config.facebook.appId,xfbml:!0,version:"v2.5"}),e.Event.subscribe("xfbml.ready",function(e){"video"===e.type&&e.id===t.playerID&&(t.player=e.instance,t.player.subscribe("startedPlaying",t.onPlay),t.player.subscribe("paused",t.props.onPause),t.player.subscribe("finishedPlaying",t.onEnded),t.player.subscribe("startedBuffering",t.props.onBuffer),t.player.subscribe("error",t.props.onError),t.onReady())})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){var r=u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.player.seek(r)}},{key:"setVolume",value:function(e){0!==e&&this.callPlayer("unmute"),this.player.setVolume(e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%",backgroundColor:"black"};return c.default.createElement("div",{style:e,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-allowfullscreen":"true","data-controls":this.props.controls?void 0:"false"})}}],[{key:"canPlay",value:function(e){return h.test(e)}}]),t}(f.default);b.displayName="Facebook",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 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});var l=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=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},s=r(0),c=n(s),p=r(2),f=n(p),y=r(1),d=/^https?:\/\/streamable.com\/([a-z0-9]+)$/,h=function(e){function t(){var e,r,n,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),n.duration=null,n.currentTime=null,n.secondsLoaded=null,n.ref=function(e){n.iframe=e},i=r,a(n,i)}return i(t,e),l(t,[{key:"load",value:function(e){var t=this;if(this.loadingSDK)return void(this.loadOnReady=e);this.loadingSDK=!0,(0,y.getSDK)("//cdn.embed.ly/player-0.0.12.min.js","playerjs").then(function(e){t.player=new e.Player(t.iframe),t.player.on("ready",t.onReady),t.player.on("play",t.onPlay),t.player.on("pause",t.props.onPause),t.player.on("seeked",t.props.onSeek),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",function(e){var r=e.duration,n=e.seconds;t.duration=r,t.currentTime=n}),t.player.on("progress",function(e){var r=e.percent;t.duration&&(t.secondsLoaded=t.duration*r)})},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){var r=u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.callPlayer("setCurrentTime",r)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=this.props.url.match(d)[1],t={width:"100%",height:"100%"};return c.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/"+e,frameBorder:"0",scrolling:"no",style:t,allowFullScreen:!0})}}],[{key:"canPlay",value:function(e){return d.test(e)}}]),t}(f.default);h.displayName="Streamable",t.default=h,e.exports=t.default},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 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 i=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(4),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=/^https?:\/\/vid.me\/([a-z0-9]+)$/i,c={},p=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),i(t,[{key:"getData",value:function(e){var t=this.props.onError,r=e.match(s)[1];return c[r]?Promise.resolve(c[r]):window.fetch("https://api.vid.me/videoByUrl/"+r).then(function(e){if(200===e.status)return c[r]=e.json(),c[r];t(new Error("Vidme track could not be resolved"))})}},{key:"getURL",value:function(e){var t=e.video,r=this.props.config;if(r.vidme.format&&t.formats&&0!==t.formats.length){var n=t.formats.findIndex(function(e){return e.type===r.vidme.format});if(-1!==n)return t.formats[n].uri;console.warn('Vidme format "'+r.vidme.format+'" was not found for '+t.full_url)}return t.complete_url}},{key:"load",value:function(e){var t=this,r=this.props.onError;this.stop(),this.getData(e).then(function(e){t.mounted&&(t.player.src=t.getURL(e))},r)}}],[{key:"canPlay",value:function(e){return s.test(e)}}]),t}(u.default);p.displayName="Vidme",t.default=p,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 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});var l=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},u=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}}(),s=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},c=r(0),p=n(c),f=r(2),y=n(f),d=r(1),h=/^https?:\/\/(.+)?(wistia.com|wi.st)\/(medias|embed)\/(.*)$/,v=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"getID",value:function(e){return e&&e.match(h)[4]}},{key:"load",value:function(e){var t=this,r=this.props,n=r.controls,o=r.onStart,a=r.onPause,i=r.onSeek,u=r.onEnded,s=r.config;this.loadingSDK=!0,(0,d.getSDK)("//fast.wistia.com/assets/external/E-v1.js","Wistia").then(function(){window._wq=window._wq||[],window._wq.push({id:t.getID(e),options:l({controlsVisibleOnLoad:n},s.wistia.options),onReady:function(e){t.player=e,t.player.bind("start",o),t.player.bind("play",t.onPlay),t.player.bind("pause",a),t.player.bind("seek",i),t.player.bind("end",u),t.onReady()}})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("remove")}},{key:"seekTo",value:function(e){var r=s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.callPlayer("time",r)}},{key:"setVolume",value:function(e){this.callPlayer("volume",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("playbackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.getID(this.props.url),t="wistia_embed wistia_async_"+e,r={width:"100%",height:"100%",display:this.props.url?"block":"none"};return p.default.createElement("div",{key:e,className:t,style:r})}}],[{key:"canPlay",value:function(e){return h.test(e)}}]),t}(y.default);v.displayName="Wistia",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 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});var l=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},u=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}}(),s=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},c=r(0),p=n(c),f=r(2),y=n(f),d=r(1),h=/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,v=function(e){function t(){var e,r,n,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),n.onDurationChange=function(e){(0,n.props.onDuration)(n.getDuration())},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},i=r,a(n,i)}return i(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this.props,r=e.url,n=e.config;!r&&n.dailymotion.preload&&(this.preloading=!0,this.load("http://www.dailymotion.com/video/x522udb")),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"parseId",value:function(e){var t=e.match(h);return t[4]||t[2]}},{key:"load",value:function(e){var t=this,r=this.props,n=r.controls,o=r.config,a=r.onError,i=r.playing,u=this.parseId(e);return this.player?void this.player.load(u,{start:(0,d.parseStartTime)(e),autoplay:i}):this.loadingSDK?void(this.loadOnReady=e):(this.loadingSDK=!0,void(0,d.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",function(e){return e.player}).then(function(r){var i=r.player;t.player=new i(t.container,{width:"100%",height:"100%",video:u,params:l({controls:n,autoplay:t.props.playing,start:(0,d.parseStartTime)(e),origin:window.location.origin},o.dailymotion.params),events:{apiready:function(){t.loadingSDK=!1,t.onReady()},seeked:function(){return t.props.onSeek(t.player.currentTime)},video_end:t.onEnded,durationchange:t.onDurationChange,pause:t.props.onPause,playing:t.onPlay,waiting:t.props.onBuffer,error:function(e){return a(e)}}})},a))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){var r=s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.callPlayer("seek",r)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.isReady?this.player.duration||null:null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var e={width:"100%",height:"100%",backgroundColor:"black",display:this.props.url?"block":"none"};return p.default.createElement("div",{style:e},p.default.createElement("div",{ref:this.ref}))}}],[{key:"canPlay",value:function(e){return h.test(e)}}]),t}(y.default);v.displayName="DailyMotion",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 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});var l=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=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(n)},s=r(0),c=n(s),p=r(2),f=n(p),y=r(1),d=/^(?:https?:\/\/)?(?:www\.)twitch\.tv\/videos\/(\d+)($|\?)/,h=/^(?:https?:\/\/)?(?:www\.)twitch\.tv\/([a-z0-9_]+)($|\?)/,v="twitch-player-",b=function(e){function t(){var e,r,n,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return r=n=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),n.playerID=v+(0,y.randomString)(),n.onEnded=function(){var e=n.props,t=e.loop,r=e.onEnded;t&&n.seekTo(0),r()},i=r,a(n,i)}return i(t,e),l(t,[{key:"load",value:function(e){var t=this,r=this.props,n=r.playsinline,o=r.onError,a=h.test(e),i=a?e.match(h)[1]:e.match(d)[1];return this.isReady?void(a?this.player.setChannel(i):this.player.setVideo("v"+i)):this.loadingSDK?void(this.loadOnReady=e):(this.loadingSDK=!0,void(0,y.getSDK)("//player.twitch.tv/js/embed/v1.js","Twitch").then(function(e){t.player=new e.Player(t.playerID,{video:a?"":i,channel:a?i:"",height:"100%",width:"100%",playsinline:n});var r=e.Player,o=r.READY,l=r.PLAY,u=r.PAUSE,s=r.ENDED;t.player.addEventListener(o,t.onReady),t.player.addEventListener(l,t.onPlay),t.player.addEventListener(u,t.props.onPause),t.player.addEventListener(s,t.onEnded)},o))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("pause")}},{key:"seekTo",value:function(e){var r=u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e);this.callPlayer("seek",r)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return c.default.createElement("div",{style:e,id:this.playerID})}}],[{key:"canPlay",value:function(e){return d.test(e)||h.test(e)}}]),t}(f.default);b.displayName="Twitch",t.default=b,e.exports=t.default}]);
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=8)}([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(P);if(t){var n=t[1];if(n.match(w))return i(n);if(k.test(n))return parseInt(n,10)}return 0}function i(e){for(var t=0,n=w.exec(e);null!==n;){var r=n,o=d(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=w.exec(e)}return t}function l(){return Math.random().toString(36).substr(2,5)}function u(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(n){var a=window[n];window[n]=function(){a&&a(),r(window[t])}}(0,v.default)(e,function(e){e&&o(e),n||r(window[t])})})}function s(e,t,n){var r=(0,b.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=g.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=u.value;if(e[c]){var f=c.replace(/Config$/,"");if(r=(0,b.default)(r,o({},f,e[c])),n){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){i=!0,l=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw l}}return r}function c(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a=(t=[]).concat.apply(t,r),i={},l=Object.keys(e),u=!0,s=!1,c=void 0;try{for(var f,p=l[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var y=f.value;-1===a.indexOf(y)&&(i[y]=e[y])}}catch(e){s=!0,c=e}finally{try{!u&&p.return&&p.return()}finally{if(s)throw c}}return i}function f(e){var t;if(!this.player||!this.player[e]){var n="ReactPlayer: "+this.constructor.displayName+" player could not call %c"+e+"%c – ";return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return(t=this.player)[e].apply(t,o)}function p(e){return null!==e&&("function"==typeof e||"object"===(void 0===e?"undefined":y(e)))}Object.defineProperty(t,"__esModule",{value:!0});var y="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},d=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.parseStartTime=a,t.randomString=l,t.getSDK=u,t.getConfig=s,t.omit=c,t.callPlayer=f,t.isObject=p;var h=n(14),v=r(h),m=n(15),b=r(m),g=n(2),P=/[?&#](?:start|t)=([0-9hms]+)/,w=/(\d+)(h|m|s)/g,k=/^\d+$/},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEPRECATED_CONFIG_PROPS=t.defaultProps=t.propTypes=void 0;var r=n(9),o=function(e){return e&&e.__esModule?e:{default:e}}(r),a=o.default.string,i=o.default.bool,l=o.default.number,u=o.default.array,s=o.default.oneOfType,c=o.default.shape,f=o.default.object,p=o.default.func;t.propTypes={url:s([a,u]),playing:i,loop:i,controls:i,volume:l,muted:i,playbackRate:l,width:s([a,l]),height:s([a,l]),style:f,progressFrequency:l,playsinline:i,config:c({soundcloud:c({options:f}),youtube:c({playerVars:f,preload:i}),facebook:c({appId:a}),dailymotion:c({params:f,preload:i}),vimeo:c({iframeParams:f,preload:i}),vidme:c({format:a}),file:c({attributes:f,tracks:u,forceAudio:i,forceHLS:i,forceDASH:i}),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:{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,n){"use strict";function r(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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){if(e instanceof Array){var t=!0,n=!1,r=void 0;try{for(var o,a=e[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var l=o.value;if("string"==typeof l&&i(l))return!0;if(i(l.src))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1}return p.test(e)||y.test(e)||d.test(e)||h.test(e)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=function(e){return e&&e.__esModule?e:{default:e}}(s),f=n(1),p=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,y=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,d=/\.(m3u8)($|\?)/i,h=/\.(mpd)($|\?)/i,v=function(e){function t(){var e,n,a,i;r(this,t);for(var u=arguments.length,s=Array(u),f=0;f<u;f++)s[f]=arguments[f];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),a.onSeek=function(e){a.props.onSeek(e.target.currentTime)},a.renderSource=function(e){if("string"==typeof e)return c.default.createElement("source",{key:e,src:e});var t=e.src,n=e.type;return c.default.createElement("source",{key:t,src:t,type:n})},a.renderTrack=function(e,t){return c.default.createElement("track",l({key:t},e))},a.ref=function(e){a.player=e},i=n,o(a,i)}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillReceiveProps",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.removeListeners()}},{key:"componentDidUpdate",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"addListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onPause,o=e.onEnded,a=e.onError,i=e.playsinline;this.player.addEventListener("canplay",t),this.player.addEventListener("play",n),this.player.addEventListener("pause",r),this.player.addEventListener("seeked",this.onSeek),this.player.addEventListener("ended",o),this.player.addEventListener("error",a),i&&(this.player.setAttribute("playsinline",""),this.player.setAttribute("webkit-playsinline",""))}},{key:"removeListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onPause,o=e.onEnded,a=e.onError;this.player.removeEventListener("canplay",t),this.player.removeEventListener("play",n),this.player.removeEventListener("pause",r),this.player.removeEventListener("seeked",this.onSeek),this.player.removeEventListener("ended",o),this.player.removeEventListener("error",a)}},{key:"shouldUseAudio",value:function(e){return p.test(e.url)||e.config.file.forceAudio}},{key:"shouldUseHLS",value:function(e){return d.test(e)||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return h.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this;this.shouldUseHLS(e)&&(0,f.getSDK)("https://cdn.jsdelivr.net/hls.js/latest/hls.min.js","Hls").then(function(n){t.hls=new n,t.hls.loadSource(e),t.hls.attachMedia(t.player)}),this.shouldUseDASH(e)&&(0,f.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.5.0/dash.all.min.js","dashjs").then(function(n){t.dash=n.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.getDebug().setLogToBrowserConsole(!1)})}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.hls&&this.hls.destroy(),this.dash&&this.dash.reset()}},{key:"seekTo",value:function(e){this.player.currentTime=e}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){return this.player.duration}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return 0===this.player.buffered.length?0:this.player.buffered.end(0)}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.loop,r=e.controls,o=e.config,a=e.width,i=e.height,u=this.shouldUseAudio(this.props),s=this.shouldUseHLS(t),f=this.shouldUseDASH(t),p=u?"audio":"video",y=t instanceof Array||s||f?void 0:t,d={width:a&&"auto"!==a?"100%":a,height:i&&"auto"!==i?"100%":i};return c.default.createElement(p,l({ref:this.ref,src:y,style:d,preload:"auto",controls:r,loop:n},o.file.attributes),t instanceof Array&&t.map(this.renderSource),o.file.tracks.map(this.renderTrack))}}]),t}(s.Component);v.displayName="FilePlayer",v.canPlay=i,t.default=v,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f="YT",p=/^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/,y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.onStateChange=function(e){var t=e.data,n=a.props,r=n.onPlay,o=n.onPause,i=n.onBuffer,l=n.onEnded,u=n.onReady,s=window[f].PlayerState,c=s.PLAYING,p=s.PAUSED,y=s.BUFFERING,d=s.ENDED,h=s.CUED;t===c&&r(),t===p&&o(),t===y&&i(),t===d&&l(),t===h&&u()},a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.controls,l=r.config,u=r.onError,s=e&&e.match(p)[1];if(t)return void this.player.cueVideoById({videoId:s,startSeconds:(0,c.parseStartTime)(e)});(0,c.getSDK)("https://www.youtube.com/iframe_api",f,"onYouTubeIframeAPIReady",function(e){return e.loaded}).then(function(t){n.player=new t.Player(n.container,{width:"100%",height:"100%",videoId:s,playerVars:i({controls:a?1:0,start:(0,c.parseStartTime)(e),origin:window.location.origin,playsinline:o},l.youtube.playerVars),events:{onReady:n.props.onReady,onStateChange:n.onStateChange,onError:function(e){return u(e.data)}}})},u)}},{key:"play",value:function(){this.callPlayer("playVideo")}},{key:"pause",value:function(){this.callPlayer("pauseVideo")}},{key:"stop",value:function(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var e=i({width:"100%",height:"100%"},this.props.style);return s.default.createElement("div",{style:e},s.default.createElement("div",{ref:this.ref}))}}]),t}(u.Component);y.displayName="YouTube",y.canPlay=function(e){return p.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.duration=null,a.currentTime=null,a.secondsLoaded=null,a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this,r=e.match(f)[3];if(this.duration=null,t)return void this.player.loadVideo(r).catch(this.props.onError);(0,c.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(function(t){n.player=new t.Player(n.container,i({},n.props.config.vimeo.playerOptions,{url:e,loop:n.props.loop})),n.player.ready().then(function(){var e=n.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"}).catch(n.props.onError),n.player.on("loaded",function(){n.props.onReady(),n.player.getDuration().then(function(e){n.duration=e})}),n.player.on("play",n.props.onPlay),n.player.on("pause",n.props.onPause),n.player.on("seeked",function(e){return n.props.onSeek(e.seconds)}),n.player.on("ended",n.props.onEnded),n.player.on("error",n.props.onError),n.player.on("timeupdate",function(e){var t=e.seconds;n.currentTime=t}),n.player.on("progress",function(e){var t=e.seconds;n.secondsLoaded=t})},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("unload")}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=i({width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"},this.props.style);return s.default.createElement("div",{style:e,ref:this.ref})}}]),t}(u.Component);p.displayName="Vimeo",p.canPlay=function(e){return f.test(e)},t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.onDurationChange=function(){var e=a.getDuration();a.props.onDuration(e)},a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"parseId",value:function(e){var t=e.match(f);return t[4]||t[2]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.config,a=n.onError,l=n.playing,u=this.parseId(e);if(this.player)return void this.player.load(u,{start:(0,c.parseStartTime)(e),autoplay:l});(0,c.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",function(e){return e.player}).then(function(n){var l=n.player;t.player=new l(t.container,{width:"100%",height:"100%",video:u,params:i({controls:r,autoplay:t.props.playing,start:(0,c.parseStartTime)(e),origin:window.location.origin},o.dailymotion.params),events:{apiready:t.props.onReady,seeked:function(){return t.props.onSeek(t.player.currentTime)},video_end:t.props.onEnded,durationchange:t.onDurationChange,pause:t.props.onPause,playing:t.props.onPlay,waiting:t.props.onBuffer,error:function(e){return a(e)}}})},a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var e=i({width:"100%",height:"100%",backgroundColor:"black"},this.props.style);return s.default.createElement("div",{style:e},s.default.createElement("div",{ref:this.ref}))}}]),t}(u.Component);p.displayName="DailyMotion",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(2),f=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.mounted=!1,a.isReady=!1,a.isPlaying=!1,a.startOnPlay=!0,a.seekOnPlay=null,a.onReady=function(){if(a.mounted){var e=a.props,t=e.onReady,n=e.playing;a.isReady=!0,a.loadingSDK=!1,t(),n&&(a.loadOnReady?(a.player.load(a.loadOnReady),a.loadOnReady=null):a.player.play()),a.onDurationCheck()}},a.onPlay=function(){a.isPlaying=!0;var e=a.props,t=e.volume,n=e.muted,r=e.onStart,o=e.onPlay,i=e.playbackRate;a.startOnPlay&&(a.player.setPlaybackRate&&a.player.setPlaybackRate(i),a.player.setVolume(n?0:t),r(),a.startOnPlay=!1),o(),a.seekOnPlay&&(a.seekTo(a.seekOnPlay),a.seekOnPlay=null),a.onDurationCheck()},a.onPause=function(){a.isPlaying=!1,a.props.onPause()},a.onEnded=function(){var e=a.props,t=e.activePlayer,n=e.loop,r=e.onEnded;t.loopOnEnded&&n&&a.seekTo(0),r()},a.onDurationCheck=function(){clearTimeout(a.durationCheckTimeout);var e=a.getDuration();e?a.props.onDuration(e):a.durationCheckTimeout=setTimeout(a.onDurationCheck,100)},a.ref=function(e){e&&(a.player=e)},i=n,o(a,i)}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.mounted=!0,this.player.load(this.props.url)}},{key:"componentWillUnmount",value:function(){this.isReady&&this.player.stop(),this.mounted=!1}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.activePlayer,r=t.url;e.activePlayer!==n&&(this.isReady=!1,this.seekOnPlay=null,this.startOnPlay=!0,this.player.load(r,this.isReady))}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.activePlayer,r=t.url,o=t.playing,a=t.volume,i=t.muted,l=t.playbackRate;if(n!==e.activePlayer)return void this.player.stop();r!==e.url&&this.player.load(e.url,this.isReady),r&&!e.url&&this.player.stop(),o||!e.playing||this.isPlaying||this.player.play(),o&&!e.playing&&this.isPlaying&&this.player.pause(),a===e.volume||e.muted||this.player.setVolume(e.volume),i!==e.muted&&this.player.setVolume(e.muted?0:e.volume),l!==e.playbackRate&&this.player.setPlaybackRate&&this.player.setPlaybackRate(e.playbackRate)}},{key:"getCurrentTime",value:function(){return this.isReady?this.player.getCurrentTime():null}},{key:"getSecondsLoaded",value:function(){return this.isReady?this.player.getSecondsLoaded():null}},{key:"getDuration",value:function(){return this.isReady?this.player.getDuration():null}},{key:"seekTo",value:function(e){var t=this;if(!this.isReady&&0!==e)return this.seekOnPlay=e,void setTimeout(function(){t.seekOnPlay=null},5e3);if(e>0&&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,onEnded:this.onEnded}))}}]),t}(u.Component);f.displayName="Player",f.propTypes=c.propTypes,f.defaultProps=c.defaultProps,t.default=f,e.exports=t.default},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);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(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 l(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 n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),p=n(2),y=n(1),d=n(16),h=r(d),v=n(7),m=r(v),b=n(3),g=r(b),P=n(23),w=r(P),k=Object.keys(p.propTypes),ReactPlayer=function(e){function ReactPlayer(){var e,t,n,r;a(this,ReactPlayer);for(var o=arguments.length,l=Array(o),u=0;u<o;u++)l[u]=arguments[u];return t=n=i(this,(e=ReactPlayer.__proto__||Object.getPrototypeOf(ReactPlayer)).call.apply(e,[this].concat(l))),n.config=(0,y.getConfig)(n.props,p.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(){return n.player?n.player.getCurrentTime():null},n.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return n.player?n.player[e]:null},n.progress=function(){if(n.props.url&&n.player&&n.player.isReady){var e=n.player.getCurrentTime()||0,t=n.player.getSecondsLoaded(),r=n.player.getDuration();if(r){var o={playedSeconds:e,played:e/r};null!==t&&(o.loadedSeconds=t,o.loaded=t/r),o.played===n.prevPlayed&&o.loaded===n.prevLoaded||n.props.onProgress(o),n.prevPlayed=o.played,n.prevLoaded=o.loaded}}n.progressTimeout=setTimeout(n.progress,n.props.progressFrequency)},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(){this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout)}},{key:"shouldComponentUpdate",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=Object.keys(this.props)[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var i=o.value,l=this.props[i];if(!(0,y.isObject)(l)&&l!==e[i])return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1}},{key:"getActivePlayer",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=h.default[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var i=o.value;if(i.canPlay(e))return i}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return g.default}},{key:"renderActivePlayer",value:function(e){if(!e)return null;var t=this.getActivePlayer(e);return f.default.createElement(m.default,u({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t}))}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.style,r=e.width,a=e.height,i=(0,y.omit)(this.props,k,p.DEPRECATED_CONFIG_PROPS),l=this.renderActivePlayer(t),s=(0,w.default)(t,this.config);return f.default.createElement("div",u({ref:this.wrapperRef,style:u({},n,{width:r,height:a})},i),[l].concat(o(s)))}}]),ReactPlayer}(c.Component);ReactPlayer.displayName="ReactPlayer",ReactPlayer.propTypes=p.propTypes,ReactPlayer.defaultProps=p.defaultProps,ReactPlayer.canPlay=function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=h.default[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){if(o.value.canPlay(e))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1},t.default=ReactPlayer,e.exports=t.default},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=n(10)()},function(e,t,n){"use strict";var r=n(11),o=n(12),a=n(13);e.exports=function(){function e(e,t,n,r,i,l){l!==a&&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 n={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,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,a,i,l,u){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,i,l,u],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function r(e,t){for(var n in t)e.setAttribute(n,t[n])}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 a(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,t,n){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("script");"function"==typeof t&&(n=t,t={}),t=t||{},n=n||function(){},l.type=t.type||"text/javascript",l.charset=t.charset||"utf8",l.async=!("async"in t)||!!t.async,l.src=e,t.attrs&&r(l,t.attrs),t.text&&(l.text=""+t.text),("onload"in l?o:a)(l,n),l.onload||o(l,n),i.appendChild(l)}},function(e,t,n){"use strict";function r(e){return!!e&&"object"===(void 0===e?"undefined":f(e))}function o(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||a(e)}function a(e){return e.$$typeof===d}function i(e){return Array.isArray(e)?[]:{}}function l(e,t){return t&&!1===t.clone||!p(e)?e:c(i(e),e,t)}function u(e,t,n){return e.concat(t).map(function(e){return l(e,n)})}function s(e,t,n){var r={};return p(e)&&Object.keys(e).forEach(function(t){r[t]=l(e[t],n)}),Object.keys(t).forEach(function(o){p(t[o])&&e[o]?r[o]=c(e[o],t[o],n):r[o]=l(t[o],n)}),r}function c(e,t,n){var r=Array.isArray(t),o=Array.isArray(e),a=n||{arrayMerge:u};if(r===o)return r?(a.arrayMerge||u)(e,t,n):s(e,t,n);return l(t,n)}Object.defineProperty(t,"__esModule",{value:!0});var f="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},p=function(e){return r(e)&&!o(e)},y="function"==typeof Symbol&&Symbol.for,d=y?Symbol.for("react.element"):60103;c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return c(e,n,t)},{})};var h=c;t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),a=r(o),i=n(17),l=r(i),u=n(5),s=r(u),c=n(18),f=r(c),p=n(19),y=r(p),d=n(20),h=r(d),v=n(21),m=r(v),b=n(22),g=r(b),P=n(6),w=r(P),k=n(3),_=r(k);t.default=[a.default,l.default,s.default,f.default,y.default,h.default,m.default,g.default,w.default,_.default],e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/^https?:\/\/(soundcloud.com|snd.sc)\/([a-z0-9-_]+\/[a-z0-9-_]+)$/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.duration=null,a.currentTime=null,a.fractionLoaded=null,a.ref=function(e){a.iframe=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this;(0,c.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(function(r){var o=r.Widget.Events,a=o.PLAY,l=o.PLAY_PROGRESS,u=o.PAUSE,s=o.FINISH,c=o.ERROR;t||(n.player=r.Widget(n.iframe),n.player.bind(a,n.props.onPlay),n.player.bind(u,n.props.onPause),n.player.bind(l,function(e){n.currentTime=e.currentPosition/1e3,n.fractionLoaded=e.loadedProgress}),n.player.bind(s,function(){return n.props.onEnded()}),n.player.bind(c,function(e){return n.props.onError(e)})),n.player.load(e,i({},n.props.config.soundcloud.options,{callback:function(){n.player.getDuration(function(e){n.duration=e/1e3,n.props.onReady()})}}))})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",1e3*e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return s.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url="+encodeURIComponent(this.props.url),style:e,frameBorder:0})}}]),t}(u.Component);p.displayName="SoundCloud",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c="//connect.facebook.net/en_US/sdk.js",f=/^https:\/\/www\.facebook\.com\/([^\/?].+\/)?video(s|\.php)[\/?].*$/,p="facebook-player-",y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.playerID=p+(0,s.randomString)(),i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e,t){var n=this;if(t)return void(0,s.getSDK)(c,"FB","fbAsyncInit").then(function(e){return e.XFBML.parse()});(0,s.getSDK)(c,"FB","fbAsyncInit").then(function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:"v2.5"}),e.Event.subscribe("xfbml.ready",function(e){"video"===e.type&&e.id===n.playerID&&(n.player=e.instance,n.player.subscribe("startedPlaying",n.props.onPlay),n.player.subscribe("paused",n.props.onPause),n.player.subscribe("finishedPlaying",n.props.onEnded),n.player.subscribe("startedBuffering",n.props.onBuffer),n.player.subscribe("error",n.props.onError),n.props.onReady())})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){0!==e&&this.callPlayer("unmute"),this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%",backgroundColor:"black"};return u.default.createElement("div",{style:e,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-allowfullscreen":"true","data-controls":this.props.controls?void 0:"false"})}}]),t}(l.Component);y.displayName="Facebook",y.canPlay=function(e){return f.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c=/^https?:\/\/streamable.com\/([a-z0-9]+)$/,f=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.duration=null,a.currentTime=null,a.secondsLoaded=null,a.ref=function(e){a.iframe=e},i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e){var t=this;(0,s.getSDK)("//cdn.embed.ly/player-0.0.12.min.js","playerjs").then(function(e){t.player=new e.Player(t.iframe),t.player.on("ready",t.props.onReady),t.player.on("play",t.props.onPlay),t.player.on("pause",t.props.onPause),t.player.on("seeked",t.props.onSeek),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",function(e){var n=e.duration,r=e.seconds;t.duration=n,t.currentTime=r}),t.player.on("progress",function(e){var n=e.percent;t.duration&&(t.secondsLoaded=t.duration*n)})},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=this.props.url.match(c)[1],t={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/"+e,frameBorder:"0",scrolling:"no",style:t,allowFullScreen:!0})}}]),t}(l.Component);f.displayName="Streamable",f.canPlay=function(e){return c.test(e)},t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(3),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=/^https?:\/\/vid.me\/([a-z0-9]+)$/i,c={},f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),i(t,[{key:"getData",value:function(e){var t=this.props.onError,n=e.match(s)[1];return c[n]?Promise.resolve(c[n]):window.fetch("https://api.vid.me/videoByUrl/"+n).then(function(e){if(200===e.status)return c[n]=e.json(),c[n];t(new Error("Vidme track could not be resolved"))})}},{key:"getURL",value:function(e){var t=e.video,n=this.props.config;if(n.vidme.format&&t.formats&&0!==t.formats.length){var r=t.formats.findIndex(function(e){return e.type===n.vidme.format});if(-1!==r)return t.formats[r].uri;console.warn('Vidme format "'+n.vidme.format+'" was not found for '+t.full_url)}return t.complete_url}},{key:"load",value:function(e){var t=this,n=this.props.onError;this.stop(),this.getData(e).then(function(e){t.player.src=t.getURL(e)},n)}}]),t}(u.default);f.displayName="Vidme",f.canPlay=function(e){return s.test(e)},t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/^https?:\/\/(.+)?(wistia.com|wi.st)\/(medias|embed)\/(.*)$/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,i=n,o(a,i)}return a(t,e),l(t,[{key:"getID",value:function(e){return e&&e.match(f)[4]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.onReady,a=n.onPlay,l=n.onPause,u=n.onSeek,s=n.onEnded,f=n.config;(0,c.getSDK)("//fast.wistia.com/assets/external/E-v1.js","Wistia").then(function(){window._wq=window._wq||[],window._wq.push({id:t.getID(e),options:i({controlsVisibleOnLoad:r},f.wistia.options),onReady:function(e){t.player=e,t.player.bind("play",a),t.player.bind("pause",l),t.player.bind("seek",u),t.player.bind("end",s),o()}})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("remove")}},{key:"seekTo",value:function(e){this.callPlayer("time",e)}},{key:"setVolume",value:function(e){this.callPlayer("volume",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("playbackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.getID(this.props.url),t="wistia_embed wistia_async_"+e,n={width:"100%",height:"100%"};return s.default.createElement("div",{key:e,className:t,style:n})}}]),t}(u.Component);p.displayName="Wistia",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function 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 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 i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c=/^(?:https?:\/\/)?(?:www\.)twitch\.tv\/videos\/(\d+)($|\?)/,f=/^(?:https?:\/\/)?(?:www\.)twitch\.tv\/([a-z0-9_]+)($|\?)/,p="twitch-player-",y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.playerID=p+(0,s.randomString)(),i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,i=f.test(e),l=i?e.match(f)[1]:e.match(c)[1];if(t)return void(i?this.player.setChannel(l):this.player.setVideo("v"+l));(0,s.getSDK)("//player.twitch.tv/js/embed/v1.js","Twitch").then(function(e){n.player=new e.Player(n.playerID,{video:i?"":l,channel:i?l:"",height:"100%",width:"100%",playsinline:o});var t=e.Player,r=t.READY,a=t.PLAY,u=t.PAUSE,s=t.ENDED;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(a,n.props.onPlay),n.player.addEventListener(u,n.props.onPause),n.player.addEventListener(s,n.props.onEnded)},a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("pause")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return u.default.createElement("div",{style:e,id:this.playerID})}}]),t}(l.Component);y.displayName="Twitch",y.canPlay=function(e){return c.test(e)||f.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var l,s=h[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var c=l.value;!c.Player.canPlay(e)&&t[c.configKey].preload&&n.push(i.default.createElement(u.default,{key:c.Player.displayName,activePlayer:c.Player,url:c.url,playing:!0,style:{display:"none"}}))}}catch(e){o=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw a}}return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=n(0),i=r(a),l=n(7),u=r(l),s=n(4),c=r(s),f=n(5),p=r(f),y=n(6),d=r(y),h=[{Player:c.default,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:p.default,configKey:"vimeo",url:"https://vimeo.com/127250231"},{Player:d.default,configKey:"dailymotion",url:"http://www.dailymotion.com/video/xqdpyk"}];e.exports=t.default}]);
//# sourceMappingURL=ReactPlayer.js.map

@@ -11,4 +11,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -18,6 +16,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -37,6 +31,5 @@

var MATCH_URL = /^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/;
var BLANK_VIDEO_URL = 'http://www.dailymotion.com/video/x522udb';
var DailyMotion = function (_Base) {
_inherits(DailyMotion, _Base);
var DailyMotion = function (_Component) {
_inherits(DailyMotion, _Component);

@@ -54,16 +47,5 @@ function DailyMotion() {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DailyMotion.__proto__ || Object.getPrototypeOf(DailyMotion)).call.apply(_ref, [this].concat(args))), _this), _this.onDurationChange = function (event) {
var onDuration = _this.props.onDuration;
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 () {
var duration = _this.getDuration();
onDuration(duration);
}, _this.onEnded = function () {
var _this$props = _this.props,
loop = _this$props.loop,
onEnded = _this$props.onEnded;
if (loop) {
_this.seekTo(0);
}
onEnded();
_this.props.onDuration(duration);
}, _this.ref = function (container) {

@@ -75,15 +57,2 @@ _this.container = container;

_createClass(DailyMotion, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _props = this.props,
url = _props.url,
config = _props.config;
if (!url && config.dailymotion.preload) {
this.preloading = true;
this.load(BLANK_VIDEO_URL);
}
_get(DailyMotion.prototype.__proto__ || Object.getPrototypeOf(DailyMotion.prototype), 'componentDidMount', this).call(this);
}
}, {
key: 'parseId',

@@ -99,7 +68,7 @@ value: function parseId(url) {

var _props2 = this.props,
controls = _props2.controls,
config = _props2.config,
onError = _props2.onError,
playing = _props2.playing;
var _props = this.props,
controls = _props.controls,
config = _props.config,
onError = _props.onError,
playing = _props.playing;

@@ -114,7 +83,2 @@ var id = this.parseId(url);

}
if (this.loadingSDK) {
this.loadOnReady = url;
return;
}
this.loadingSDK = true;
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (DM) {

@@ -135,13 +99,10 @@ return DM.player;

events: {
apiready: function apiready() {
_this2.loadingSDK = false;
_this2.onReady();
},
apiready: _this2.props.onReady,
seeked: function seeked() {
return _this2.props.onSeek(_this2.player.currentTime);
},
video_end: _this2.onEnded,
video_end: _this2.props.onEnded,
durationchange: _this2.onDurationChange,
pause: _this2.props.onPause,
playing: _this2.onPlay,
playing: _this2.props.onPlay,
waiting: _this2.props.onBuffer,

@@ -172,4 +133,3 @@ error: function error(event) {

key: 'seekTo',
value: function seekTo(amount) {
var seconds = _get(DailyMotion.prototype.__proto__ || Object.getPrototypeOf(DailyMotion.prototype), 'seekTo', this).call(this, amount);
value: function seekTo(seconds) {
this.callPlayer('seek', seconds);

@@ -185,3 +145,2 @@ }

value: function getDuration() {
if (!this.isReady) return null;
return this.player.duration || null;

@@ -202,8 +161,7 @@ }

value: function render() {
var style = {
var style = _extends({
width: '100%',
height: '100%',
backgroundColor: 'black',
display: this.props.url ? 'block' : 'none'
};
backgroundColor: 'black'
}, this.props.style);
return _react2['default'].createElement(

@@ -215,13 +173,14 @@ 'div',

}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_URL.test(url);
}
}]);
return DailyMotion;
}(_Base3['default']);
}(_react.Component);
DailyMotion.displayName = 'DailyMotion';
DailyMotion.canPlay = function (url) {
return MATCH_URL.test(url);
};
DailyMotion.loopOnEnded = true;
exports['default'] = DailyMotion;

@@ -9,4 +9,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -16,6 +14,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -37,4 +31,4 @@

var Facebook = function (_Base) {
_inherits(Facebook, _Base);
var Facebook = function (_Component) {
_inherits(Facebook, _Component);

@@ -52,12 +46,3 @@ function Facebook() {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Facebook.__proto__ || Object.getPrototypeOf(Facebook)).call.apply(_ref, [this].concat(args))), _this), _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.onEnded = function () {
var _this$props = _this.props,
loop = _this$props.loop,
onEnded = _this$props.onEnded;
if (loop) {
_this.seekTo(0);
}
onEnded();
}, _temp), _possibleConstructorReturn(_this, _ret);
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Facebook.__proto__ || Object.getPrototypeOf(Facebook)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _temp), _possibleConstructorReturn(_this, _ret);
}

@@ -67,6 +52,6 @@

key: 'load',
value: function load(url) {
value: function load(url, isReady) {
var _this2 = this;
if (this.isReady) {
if (isReady) {
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {

@@ -86,8 +71,8 @@ return FB.XFBML.parse();

_this2.player = msg.instance;
_this2.player.subscribe('startedPlaying', _this2.onPlay);
_this2.player.subscribe('startedPlaying', _this2.props.onPlay);
_this2.player.subscribe('paused', _this2.props.onPause);
_this2.player.subscribe('finishedPlaying', _this2.onEnded);
_this2.player.subscribe('finishedPlaying', _this2.props.onEnded);
_this2.player.subscribe('startedBuffering', _this2.props.onBuffer);
_this2.player.subscribe('error', _this2.props.onError);
_this2.onReady();
_this2.props.onReady();
}

@@ -114,5 +99,4 @@ });

key: 'seekTo',
value: function seekTo(amount) {
var seconds = _get(Facebook.prototype.__proto__ || Object.getPrototypeOf(Facebook.prototype), 'seekTo', this).call(this, amount);
this.player.seek(seconds);
value: function seekTo(seconds) {
this.callPlayer('seek', seconds);
}

@@ -125,3 +109,3 @@ }, {

}
this.player.setVolume(fraction);
this.callPlayer('setVolume', fraction);
}

@@ -160,13 +144,14 @@ }, {

}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_URL.test(url);
}
}]);
return Facebook;
}(_Base3['default']);
}(_react.Component);
Facebook.displayName = 'Facebook';
Facebook.canPlay = function (url) {
return MATCH_URL.test(url);
};
Facebook.loopOnEnded = true;
exports['default'] = Facebook;

@@ -11,4 +11,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -18,6 +16,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -42,5 +36,42 @@

var FilePlayer = function (_Base) {
_inherits(FilePlayer, _Base);
function canPlay(url) {
if (url instanceof Array) {
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = url[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var item = _step.value;
if (typeof item === 'string' && canPlay(item)) {
return true;
}
if (canPlay(item.src)) {
return true;
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator['return']) {
_iterator['return']();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
return false;
}
return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url);
}
var FilePlayer = function (_Component) {
_inherits(FilePlayer, _Component);
function FilePlayer() {

@@ -78,3 +109,2 @@ var _ref;

this.addListeners();
_get(FilePlayer.prototype.__proto__ || Object.getPrototypeOf(FilePlayer.prototype), 'componentDidMount', this).call(this);
}

@@ -87,3 +117,2 @@ }, {

}
_get(FilePlayer.prototype.__proto__ || Object.getPrototypeOf(FilePlayer.prototype), 'componentWillReceiveProps', this).call(this, nextProps);
}

@@ -101,3 +130,2 @@ }, {

this.removeListeners();
_get(FilePlayer.prototype.__proto__ || Object.getPrototypeOf(FilePlayer.prototype), 'componentWillUnmount', this).call(this);
}

@@ -108,9 +136,11 @@ }, {

var _props = this.props,
playsinline = _props.playsinline,
onReady = _props.onReady,
onPlay = _props.onPlay,
onPause = _props.onPause,
onEnded = _props.onEnded,
onError = _props.onError;
onError = _props.onError,
playsinline = _props.playsinline;
this.player.addEventListener('canplay', this.onReady);
this.player.addEventListener('play', this.onPlay);
this.player.addEventListener('canplay', onReady);
this.player.addEventListener('play', onPlay);
this.player.addEventListener('pause', onPause);

@@ -129,2 +159,4 @@ this.player.addEventListener('seeked', this.onSeek);

var _props2 = this.props,
onReady = _props2.onReady,
onPlay = _props2.onPlay,
onPause = _props2.onPause,

@@ -134,4 +166,4 @@ onEnded = _props2.onEnded,

this.player.removeEventListener('canplay', this.onReady);
this.player.removeEventListener('play', this.onPlay);
this.player.removeEventListener('canplay', onReady);
this.player.removeEventListener('play', onPlay);
this.player.removeEventListener('pause', onPause);

@@ -203,4 +235,3 @@ this.player.removeEventListener('seeked', this.onSeek);

key: 'seekTo',
value: function seekTo(amount) {
var seconds = _get(FilePlayer.prototype.__proto__ || Object.getPrototypeOf(FilePlayer.prototype), 'seekTo', this).call(this, amount);
value: function seekTo(seconds) {
this.player.currentTime = seconds;

@@ -252,4 +283,3 @@ }

width: !width || width === 'auto' ? width : '100%',
height: !height || height === 'auto' ? height : '100%',
display: url ? 'block' : 'none'
height: !height || height === 'auto' ? height : '100%'
};

@@ -270,46 +300,9 @@ return _react2['default'].createElement(

}
}], [{
key: 'canPlay',
value: function canPlay(url) {
if (url instanceof Array) {
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = url[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var item = _step.value;
if (typeof item === 'string' && this.canPlay(item)) {
return true;
}
if (this.canPlay(item.src)) {
return true;
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator['return']) {
_iterator['return']();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
return false;
}
return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url);
}
}]);
return FilePlayer;
}(_Base3['default']);
}(_react.Component);
FilePlayer.displayName = 'FilePlayer';
FilePlayer.canPlay = canPlay;
exports['default'] = FilePlayer;

@@ -11,4 +11,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -18,6 +16,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -36,14 +30,5 @@

var MATCH_URL = /^https?:\/\/(soundcloud.com|snd.sc)\/([a-z0-9-_]+\/[a-z0-9-_]+)$/;
var DEFAULT_OPTIONS = {
visual: true, // Undocumented, but makes player fill container and look better
buying: false,
liking: false,
download: false,
sharing: false,
show_comments: false,
show_playcount: false
};
var SoundCloud = function (_Base) {
_inherits(SoundCloud, _Base);
var SoundCloud = function (_Component) {
_inherits(SoundCloud, _Component);

@@ -61,3 +46,3 @@ function SoundCloud() {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = SoundCloud.__proto__ || Object.getPrototypeOf(SoundCloud)).call.apply(_ref, [this].concat(args))), _this), _this.duration = null, _this.currentTime = null, _this.fractionLoaded = null, _this.ref = function (iframe) {
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.ref = function (iframe) {
_this.iframe = iframe;

@@ -69,3 +54,3 @@ }, _temp), _possibleConstructorReturn(_this, _ret);

key: 'load',
value: function load(url) {
value: function load(url, isReady) {
var _this2 = this;

@@ -81,14 +66,6 @@

if (!_this2.isReady) {
if (!isReady) {
_this2.player = SC.Widget(_this2.iframe);
_this2.player.bind(PLAY, function () {
// Use widgetIsPlaying to prevent calling play() when widget
// is playing, which causes bugs with the SC widget
_this2.widgetIsPlaying = true;
_this2.onPlay();
});
_this2.player.bind(PAUSE, function () {
_this2.widgetIsPlaying = false;
_this2.props.onPause();
});
_this2.player.bind(PLAY, _this2.props.onPlay);
_this2.player.bind(PAUSE, _this2.props.onPause);
_this2.player.bind(PLAY_PROGRESS, function (e) {

@@ -105,8 +82,7 @@ _this2.currentTime = e.currentPosition / 1000;

}
_this2.player.load(url, _extends({}, DEFAULT_OPTIONS, _this2.props.config.soundcloud.options, {
_this2.player.load(url, _extends({}, _this2.props.config.soundcloud.options, {
callback: function callback() {
_this2.widgetIsPlaying = false;
_this2.player.getDuration(function (duration) {
_this2.duration = duration / 1000;
_this2.onReady();
_this2.props.onReady();
});

@@ -120,5 +96,3 @@ }

value: function play() {
if (!this.widgetIsPlaying) {
this.callPlayer('play');
}
this.callPlayer('play');
}

@@ -128,5 +102,3 @@ }, {

value: function pause() {
if (this.widgetIsPlaying) {
this.callPlayer('pause');
}
this.callPlayer('pause');
}

@@ -140,4 +112,3 @@ }, {

key: 'seekTo',
value: function seekTo(amount) {
var seconds = _get(SoundCloud.prototype.__proto__ || Object.getPrototypeOf(SoundCloud.prototype), 'seekTo', this).call(this, amount);
value: function seekTo(seconds) {
this.callPlayer('seekTo', seconds * 1000);

@@ -179,13 +150,14 @@ }

}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_URL.test(url);
}
}]);
return SoundCloud;
}(_Base3['default']);
}(_react.Component);
SoundCloud.displayName = 'SoundCloud';
SoundCloud.canPlay = function (url) {
return MATCH_URL.test(url);
};
SoundCloud.loopOnEnded = true;
exports['default'] = SoundCloud;

@@ -9,4 +9,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -16,6 +14,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -35,4 +29,4 @@

var Streamable = function (_Base) {
_inherits(Streamable, _Base);
var Streamable = function (_Component) {
_inherits(Streamable, _Component);

@@ -50,3 +44,3 @@ function Streamable() {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Streamable.__proto__ || Object.getPrototypeOf(Streamable)).call.apply(_ref, [this].concat(args))), _this), _this.duration = null, _this.currentTime = null, _this.secondsLoaded = null, _this.ref = function (iframe) {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Streamable.__proto__ || Object.getPrototypeOf(Streamable)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.duration = null, _this.currentTime = null, _this.secondsLoaded = null, _this.ref = function (iframe) {
_this.iframe = iframe;

@@ -61,11 +55,6 @@ }, _temp), _possibleConstructorReturn(_this, _ret);

if (this.loadingSDK) {
this.loadOnReady = url;
return;
}
this.loadingSDK = true;
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (playerjs) {
_this2.player = new playerjs.Player(_this2.iframe);
_this2.player.on('ready', _this2.onReady);
_this2.player.on('play', _this2.onPlay);
_this2.player.on('ready', _this2.props.onReady);
_this2.player.on('play', _this2.props.onPlay);
_this2.player.on('pause', _this2.props.onPause);

@@ -108,4 +97,3 @@ _this2.player.on('seeked', _this2.props.onSeek);

key: 'seekTo',
value: function seekTo(amount) {
var seconds = _get(Streamable.prototype.__proto__ || Object.getPrototypeOf(Streamable.prototype), 'seekTo', this).call(this, amount);
value: function seekTo(seconds) {
this.callPlayer('setCurrentTime', seconds);

@@ -150,13 +138,13 @@ }

}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_URL.test(url);
}
}]);
return Streamable;
}(_Base3['default']);
}(_react.Component);
Streamable.displayName = 'Streamable';
Streamable.canPlay = function (url) {
return MATCH_URL.test(url);
};
exports['default'] = Streamable;

@@ -9,4 +9,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -16,6 +14,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -37,4 +31,4 @@

var Twitch = function (_Base) {
_inherits(Twitch, _Base);
var Twitch = function (_Component) {
_inherits(Twitch, _Component);

@@ -52,12 +46,3 @@ function Twitch() {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Twitch.__proto__ || Object.getPrototypeOf(Twitch)).call.apply(_ref, [this].concat(args))), _this), _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.onEnded = function () {
var _this$props = _this.props,
loop = _this$props.loop,
onEnded = _this$props.onEnded;
if (loop) {
_this.seekTo(0);
}
onEnded();
}, _temp), _possibleConstructorReturn(_this, _ret);
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Twitch.__proto__ || Object.getPrototypeOf(Twitch)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _temp), _possibleConstructorReturn(_this, _ret);
}

@@ -67,3 +52,3 @@

key: 'load',
value: function load(url) {
value: function load(url, isReady) {
var _this2 = this;

@@ -77,3 +62,3 @@

var id = isChannel ? url.match(MATCH_CHANNEL_URL)[1] : url.match(MATCH_VIDEO_URL)[1];
if (this.isReady) {
if (isReady) {
if (isChannel) {

@@ -86,7 +71,2 @@ this.player.setChannel(id);

}
if (this.loadingSDK) {
this.loadOnReady = url;
return;
}
this.loadingSDK = true;
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Twitch) {

@@ -106,6 +86,6 @@ _this2.player = new Twitch.Player(_this2.playerID, {

_this2.player.addEventListener(READY, _this2.onReady);
_this2.player.addEventListener(PLAY, _this2.onPlay);
_this2.player.addEventListener(READY, _this2.props.onReady);
_this2.player.addEventListener(PLAY, _this2.props.onPlay);
_this2.player.addEventListener(PAUSE, _this2.props.onPause);
_this2.player.addEventListener(ENDED, _this2.onEnded);
_this2.player.addEventListener(ENDED, _this2.props.onEnded);
}, onError);

@@ -130,4 +110,3 @@ }

key: 'seekTo',
value: function seekTo(amount) {
var seconds = _get(Twitch.prototype.__proto__ || Object.getPrototypeOf(Twitch.prototype), 'seekTo', this).call(this, amount);
value: function seekTo(seconds) {
this.callPlayer('seek', seconds);

@@ -164,13 +143,14 @@ }

}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_VIDEO_URL.test(url) || MATCH_CHANNEL_URL.test(url);
}
}]);
return Twitch;
}(_Base3['default']);
}(_react.Component);
Twitch.displayName = 'Twitch';
Twitch.canPlay = function (url) {
return MATCH_VIDEO_URL.test(url) || MATCH_CHANNEL_URL.test(url);
};
Twitch.loopOnEnded = true;
exports['default'] = Twitch;

@@ -80,11 +80,5 @@ 'use strict';

this.getData(url).then(function (data) {
if (!_this2.mounted) return;
_this2.player.src = _this2.getURL(data);
}, onError);
}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_URL.test(url);
}
}]);

@@ -96,2 +90,7 @@

Vidme.displayName = 'Vidme';
Vidme.canPlay = function (url) {
return MATCH_URL.test(url);
};
exports['default'] = Vidme;

@@ -11,4 +11,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -18,6 +16,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -36,6 +30,5 @@

var MATCH_URL = /https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/;
var BLANK_VIDEO_URL = 'https://vimeo.com/127250231';
var Vimeo = function (_Base) {
_inherits(Vimeo, _Base);
var Vimeo = function (_Component) {
_inherits(Vimeo, _Component);

@@ -53,3 +46,3 @@ function Vimeo() {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Vimeo.__proto__ || Object.getPrototypeOf(Vimeo)).call.apply(_ref, [this].concat(args))), _this), _this.duration = null, _this.currentTime = null, _this.secondsLoaded = null, _this.ref = function (container) {
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.ref = function (container) {
_this.container = container;

@@ -60,17 +53,4 @@ }, _temp), _possibleConstructorReturn(_this, _ret);

_createClass(Vimeo, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _props = this.props,
url = _props.url,
config = _props.config;
if (!url && config.vimeo.preload) {
this.preloading = true;
this.load(BLANK_VIDEO_URL);
}
_get(Vimeo.prototype.__proto__ || Object.getPrototypeOf(Vimeo.prototype), 'componentDidMount', this).call(this);
}
}, {
key: 'load',
value: function load(url) {
value: function load(url, isReady) {
var _this2 = this;

@@ -80,11 +60,6 @@

this.duration = null;
if (this.isReady) {
if (isReady) {
this.player.loadVideo(id)['catch'](this.props.onError);
return;
}
if (this.loadingSDK) {
this.loadOnReady = url;
return;
}
this.loadingSDK = true;
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Vimeo) {

@@ -101,3 +76,3 @@ _this2.player = new Vimeo.Player(_this2.container, _extends({}, _this2.props.config.vimeo.playerOptions, {

_this2.player.on('loaded', function () {
_this2.onReady();
_this2.props.onReady();
_this2.player.getDuration().then(function (duration) {

@@ -107,3 +82,3 @@ _this2.duration = duration;

});
_this2.player.on('play', _this2.onPlay);
_this2.player.on('play', _this2.props.onPlay);
_this2.player.on('pause', _this2.props.onPause);

@@ -140,3 +115,2 @@ _this2.player.on('seeked', function (e) {

value: function stop() {
if (this.preloading) return;
this.callPlayer('unload');

@@ -146,4 +120,3 @@ }

key: 'seekTo',
value: function seekTo(amount) {
var seconds = _get(Vimeo.prototype.__proto__ || Object.getPrototypeOf(Vimeo.prototype), 'seekTo', this).call(this, amount);
value: function seekTo(seconds) {
this.callPlayer('setCurrentTime', seconds);

@@ -174,22 +147,21 @@ }

value: function render() {
var style = {
var style = _extends({
width: '100%',
height: '100%',
overflow: 'hidden',
backgroundColor: 'black',
display: this.props.url ? 'block' : 'none'
};
backgroundColor: 'black'
}, this.props.style);
return _react2['default'].createElement('div', { style: style, ref: this.ref });
}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_URL.test(url);
}
}]);
return Vimeo;
}(_Base3['default']);
}(_react.Component);
Vimeo.displayName = 'Vimeo';
Vimeo.canPlay = function (url) {
return MATCH_URL.test(url);
};
exports['default'] = Vimeo;

@@ -11,4 +11,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -18,6 +16,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -37,9 +31,17 @@

var Wistia = function (_Base) {
_inherits(Wistia, _Base);
var Wistia = function (_Component) {
_inherits(Wistia, _Component);
function Wistia() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Wistia);
return _possibleConstructorReturn(this, (Wistia.__proto__ || Object.getPrototypeOf(Wistia)).apply(this, arguments));
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Wistia.__proto__ || Object.getPrototypeOf(Wistia)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _temp), _possibleConstructorReturn(_this, _ret);
}

@@ -59,3 +61,4 @@

controls = _props.controls,
onStart = _props.onStart,
_onReady = _props.onReady,
onPlay = _props.onPlay,
onPause = _props.onPause,

@@ -66,3 +69,2 @@ onSeek = _props.onSeek,

this.loadingSDK = true;
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function () {

@@ -77,8 +79,7 @@ window._wq = window._wq || [];

_this2.player = player;
_this2.player.bind('start', onStart);
_this2.player.bind('play', _this2.onPlay);
_this2.player.bind('play', onPlay);
_this2.player.bind('pause', onPause);
_this2.player.bind('seek', onSeek);
_this2.player.bind('end', onEnded);
_this2.onReady();
_onReady();
}

@@ -105,4 +106,3 @@ });

key: 'seekTo',
value: function seekTo(amount) {
var seconds = _get(Wistia.prototype.__proto__ || Object.getPrototypeOf(Wistia.prototype), 'seekTo', this).call(this, amount);
value: function seekTo(seconds) {
this.callPlayer('time', seconds);

@@ -142,18 +142,18 @@ }

width: '100%',
height: '100%',
display: this.props.url ? 'block' : 'none'
height: '100%'
};
return _react2['default'].createElement('div', { key: id, className: className, style: style });
}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_URL.test(url);
}
}]);
return Wistia;
}(_Base3['default']);
}(_react.Component);
Wistia.displayName = 'Wistia';
Wistia.canPlay = function (url) {
return MATCH_URL.test(url);
};
Wistia.loopOnEnded = true;
exports['default'] = Wistia;

@@ -11,4 +11,2 @@ 'use strict';

var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');

@@ -18,6 +16,2 @@

var _Base2 = require('./Base');
var _Base3 = _interopRequireDefault(_Base2);
var _utils = require('../utils');

@@ -37,6 +31,5 @@

var MATCH_URL = /^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
var BLANK_VIDEO_URL = 'https://www.youtube.com/watch?v=GlCmAC4MHek';
var YouTube = function (_Base) {
_inherits(YouTube, _Base);
var YouTube = function (_Component) {
_inherits(YouTube, _Component);

@@ -54,7 +47,10 @@ function YouTube() {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = YouTube.__proto__ || Object.getPrototypeOf(YouTube)).call.apply(_ref, [this].concat(args))), _this), _this.onStateChange = function (_ref2) {
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) {
var data = _ref2.data;
var _this$props = _this.props,
onPlay = _this$props.onPlay,
onPause = _this$props.onPause,
onBuffer = _this$props.onBuffer;
onBuffer = _this$props.onBuffer,
onEnded = _this$props.onEnded,
onReady = _this$props.onReady;
var _window$SDK_GLOBAL$Pl = window[SDK_GLOBAL].PlayerState,

@@ -67,16 +63,7 @@ PLAYING = _window$SDK_GLOBAL$Pl.PLAYING,

if (data === PLAYING) _this.onPlay();
if (data === PLAYING) onPlay();
if (data === PAUSED) onPause();
if (data === BUFFERING) onBuffer();
if (data === ENDED) _this.onEnded();
if (data === CUED) _this.onReady();
}, _this.onEnded = function () {
var _this$props2 = _this.props,
loop = _this$props2.loop,
onEnded = _this$props2.onEnded;
if (loop) {
_this.seekTo(0);
}
onEnded();
if (data === ENDED) onEnded();
if (data === CUED) onReady();
}, _this.ref = function (container) {

@@ -88,27 +75,14 @@ _this.container = container;

_createClass(YouTube, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _props = this.props,
url = _props.url,
config = _props.config;
if (!url && config.youtube.preload) {
this.preloading = true;
this.load(BLANK_VIDEO_URL);
}
_get(YouTube.prototype.__proto__ || Object.getPrototypeOf(YouTube.prototype), 'componentDidMount', this).call(this);
}
}, {
key: 'load',
value: function load(url) {
value: function load(url, isReady) {
var _this2 = this;
var _props2 = this.props,
playsinline = _props2.playsinline,
controls = _props2.controls,
config = _props2.config,
_onError = _props2.onError;
var _props = this.props,
playsinline = _props.playsinline,
controls = _props.controls,
config = _props.config,
_onError = _props.onError;
var id = url && url.match(MATCH_URL)[1];
if (this.isReady) {
if (isReady) {
this.player.cueVideoById({

@@ -120,7 +94,2 @@ videoId: id,

}
if (this.loadingSDK) {
this.loadOnReady = url;
return;
}
this.loadingSDK = true;
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (YT) {

@@ -140,3 +109,3 @@ return YT.loaded;

events: {
onReady: _this2.onReady,
onReady: _this2.props.onReady,
onStateChange: _this2.onStateChange,

@@ -163,3 +132,2 @@ onError: function onError(event) {

value: function stop() {
if (this.preloading) return;
if (!document.body.contains(this.callPlayer('getIframe'))) return;

@@ -171,4 +139,3 @@ this.callPlayer('stopVideo');

value: function seekTo(amount) {
var seconds = _get(YouTube.prototype.__proto__ || Object.getPrototypeOf(YouTube.prototype), 'seekTo', this).call(this, amount);
this.callPlayer('seekTo', seconds);
this.callPlayer('seekTo', amount);
}

@@ -203,7 +170,6 @@ }, {

value: function render() {
var style = {
var style = _extends({
width: '100%',
height: '100%',
display: this.props.url ? 'block' : 'none'
};
height: '100%'
}, this.props.style);
return _react2['default'].createElement(

@@ -215,13 +181,14 @@ 'div',

}
}], [{
key: 'canPlay',
value: function canPlay(url) {
return MATCH_URL.test(url);
}
}]);
return YouTube;
}(_Base3['default']);
}(_react.Component);
YouTube.displayName = 'YouTube';
YouTube.canPlay = function (url) {
return MATCH_URL.test(url);
};
YouTube.loopOnEnded = true;
exports['default'] = YouTube;

@@ -19,18 +19,10 @@ 'use strict';

var _YouTube = require('./players/YouTube');
var _players = require('./players');
var _YouTube2 = _interopRequireDefault(_YouTube);
var _players2 = _interopRequireDefault(_players);
var _SoundCloud = require('./players/SoundCloud');
var _Player3 = require('./Player');
var _SoundCloud2 = _interopRequireDefault(_SoundCloud);
var _Player4 = _interopRequireDefault(_Player3);
var _Vimeo = require('./players/Vimeo');
var _Vimeo2 = _interopRequireDefault(_Vimeo);
var _Facebook = require('./players/Facebook');
var _Facebook2 = _interopRequireDefault(_Facebook);
var _FilePlayer = require('./players/FilePlayer');

@@ -40,22 +32,6 @@

var _Streamable = require('./players/Streamable');
var _preload = require('./preload');
var _Streamable2 = _interopRequireDefault(_Streamable);
var _preload2 = _interopRequireDefault(_preload);
var _Vidme = require('./players/Vidme');
var _Vidme2 = _interopRequireDefault(_Vidme);
var _Wistia = require('./players/Wistia');
var _Wistia2 = _interopRequireDefault(_Wistia);
var _DailyMotion = require('./players/DailyMotion');
var _DailyMotion2 = _interopRequireDefault(_DailyMotion);
var _Twitch = require('./players/Twitch');
var _Twitch2 = _interopRequireDefault(_Twitch);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

@@ -72,3 +48,2 @@

var SUPPORTED_PROPS = Object.keys(_props2.propTypes);
var SUPPORTED_PLAYERS = [_YouTube2['default'], _SoundCloud2['default'], _Vimeo2['default'], _Facebook2['default'], _Streamable2['default'], _Vidme2['default'], _Wistia2['default'], _Twitch2['default'], _DailyMotion2['default']];

@@ -126,17 +101,6 @@ var ReactPlayer = function (_Component) {

_this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency);
}, _this.renderPlayer = function (Player) {
return _react2['default'].createElement(Player, _extends({}, _this.props, {
ref: _this.activePlayerRef,
key: Player.displayName,
config: _this.config
}));
}, _this.wrapperRef = function (wrapper) {
_this.wrapper = wrapper;
}, _this.activePlayerRef = function (player) {
_this.player = player;
}, _this.wrapperRef = function (wrapper) {
_this.wrapper = wrapper;
}, _this.renderPreloadPlayer = function (Player) {
return _react2['default'].createElement(Player, {
key: Player.displayName,
config: _this.config
});
}, _temp), _possibleConstructorReturn(_this, _ret);

@@ -158,8 +122,2 @@ }

value: function shouldComponentUpdate(nextProps) {
return this.props.url !== nextProps.url || this.props.playing !== nextProps.playing || this.props.loop !== nextProps.loop || this.props.volume !== nextProps.volume || this.props.muted !== nextProps.muted || this.props.playbackRate !== nextProps.playbackRate || this.props.height !== nextProps.height || this.props.width !== nextProps.width || this.props.hidden !== nextProps.hidden;
}
}, {
key: 'renderActivePlayer',
value: function renderActivePlayer(url) {
if (!url) return null;
var _iteratorNormalCompletion = true;

@@ -170,10 +128,10 @@ var _didIteratorError = false;

try {
for (var _iterator = SUPPORTED_PLAYERS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var Player = _step.value;
for (var _iterator = Object.keys(this.props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var key = _step.value;
if (Player.canPlay(url)) {
return this.renderPlayer(Player);
var prop = this.props[key];
if (!(0, _utils.isObject)(prop) && prop !== nextProps[key]) {
return true;
}
}
// Fall back to FilePlayer if nothing else can play the URL
} catch (err) {

@@ -194,21 +152,50 @@ _didIteratorError = true;

return this.renderPlayer(_FilePlayer2['default']);
return false;
}
}, {
key: 'renderPreloadPlayers',
value: function renderPreloadPlayers(url) {
// Render additional players if preload config is set
var preloadPlayers = [];
if (!_YouTube2['default'].canPlay(url) && this.config.youtube.preload) {
preloadPlayers.push(_YouTube2['default']);
key: 'getActivePlayer',
value: function getActivePlayer(url) {
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (var _iterator2 = _players2['default'][Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var _Player = _step2.value;
if (_Player.canPlay(url)) {
return _Player;
}
}
// Fall back to FilePlayer if nothing else can play the URL
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2['return']) {
_iterator2['return']();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
if (!_Vimeo2['default'].canPlay(url) && this.config.vimeo.preload) {
preloadPlayers.push(_Vimeo2['default']);
}
if (!_DailyMotion2['default'].canPlay(url) && this.config.dailymotion.preload) {
preloadPlayers.push(_DailyMotion2['default']);
}
return preloadPlayers.map(this.renderPreloadPlayer);
return _FilePlayer2['default'];
}
}, {
key: 'renderActivePlayer',
value: function renderActivePlayer(url) {
if (!url) return null;
var activePlayer = this.getActivePlayer(url);
return _react2['default'].createElement(_Player4['default'], _extends({}, this.props, {
key: activePlayer.displayName,
ref: this.activePlayerRef,
config: this.config,
activePlayer: activePlayer
}));
}
}, {
key: 'render',

@@ -224,3 +211,3 @@ value: function render() {

var activePlayer = this.renderActivePlayer(url);
var preloadPlayers = this.renderPreloadPlayers(url);
var preloadPlayers = (0, _preload2['default'])(url, this.config);
return _react2['default'].createElement(

@@ -242,12 +229,11 @@ 'div',

ReactPlayer.canPlay = function (url) {
var players = [].concat(SUPPORTED_PLAYERS, [_FilePlayer2['default']]);
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator2 = players[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var Player = _step2.value;
for (var _iterator3 = _players2['default'][Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var _Player2 = _step3.value;
if (Player.canPlay(url)) {
if (_Player2.canPlay(url)) {
return true;

@@ -257,12 +243,12 @@ }

} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2['return']) {
_iterator2['return']();
if (!_iteratorNormalCompletion3 && _iterator3['return']) {
_iterator3['return']();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
if (_didIteratorError3) {
throw _iteratorError3;
}

@@ -269,0 +255,0 @@ }

@@ -7,2 +7,4 @@ 'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

@@ -15,2 +17,4 @@

exports.omit = omit;
exports.callPlayer = callPlayer;
exports.isObject = isObject;

@@ -177,2 +181,30 @@ var _loadScript = require('load-script');

return output;
}
function callPlayer(method) {
var _player;
// Util method for calling a method on this.player
// but guard against errors and console.warn instead
if (!this.player || !this.player[method]) {
var message = 'ReactPlayer: ' + this.constructor.displayName + ' player could not call %c' + method + '%c \u2013 ';
if (!this.player) {
message += 'The player was not available';
} else if (!this.player[method]) {
message += 'The method was not available';
}
console.warn(message, 'font-weight: bold', '');
return null;
}
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return (_player = this.player)[method].apply(_player, args);
}
function isObject(val) {
if (val === null) return false;
return typeof val === 'function' || (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object';
}
{
"name": "react-player",
"version": "0.25.3",
"version": "1.0.0-beta.0",
"description": "A react component for playing a variety of URLs, including file paths, YouTube, Facebook, SoundCloud, Streamable, Vidme, Vimeo and Wistia",

@@ -5,0 +5,0 @@ "main": "lib/ReactPlayer.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc