react-player
Advanced tools
Comparing version 1.6.6 to 1.7.0
@@ -6,2 +6,16 @@ ### Changelog | ||
#### [v1.7.0](https://github.com/CookPete/react-player/compare/v1.6.6...v1.7.0) | ||
> 17 November 2018 | ||
- Support Chrome Picture In Picture (PIP) mode [`#504`](https://github.com/CookPete/react-player/pull/504) | ||
- Typings - label in TrackProps [`#489`](https://github.com/CookPete/react-player/pull/489) | ||
- fix: fix onProgress callback not firing during iOS live streams [`#497`](https://github.com/CookPete/react-player/pull/497) | ||
- Update vimeo preload URL [`#509`](https://github.com/CookPete/react-player/pull/509) | ||
- add absent methods signature [`#507`](https://github.com/CookPete/react-player/pull/507) | ||
- Add hlsVersion and dashVersion file config [`#513`](https://github.com/CookPete/react-player/pull/513) | ||
- Export single player exports to main file [`#421`](https://github.com/CookPete/react-player/issues/421) | ||
- Refresh vimeo duration on play [`#514`](https://github.com/CookPete/react-player/issues/514) | ||
- Use PLAYING event instead of PLAY for Twitch player [`#498`](https://github.com/CookPete/react-player/issues/498) | ||
- Do not call onEnded when looping [`#496`](https://github.com/CookPete/react-player/issues/496) | ||
- Prevent singlePlayer from returning null when forcing via config [`#500`](https://github.com/CookPete/react-player/issues/500) | ||
#### [v1.6.6](https://github.com/CookPete/react-player/compare/v1.6.5...v1.6.6) | ||
@@ -8,0 +22,0 @@ > 20 September 2018 |
@@ -1,2 +0,2 @@ | ||
var ReactPlayer=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=10)}([function(e,t){e.exports=React},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=e.match(t);if(n){var r=n[1];if(r.match(S))return i(r);if(T.test(r))return parseInt(r)}}function i(e){for(var t=0,n=S.exec(e);null!==n;){var r=n,o=g(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=S.exec(e)}return t}function l(e){return a(e,E)}function u(e){return a(e,j)}function s(){return Math.random().toString(36).substr(2,5)}function c(e){return Object.keys(e).map(function(t){return t+"="+e[t]}).join("&")}function p(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},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:w.default;return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise(function(r,a){if(R[e])return void R[e].push(r);R[e]=[r];var i=function(t){R[e].forEach(function(e){return e(t)})};if(n){var l=window[n];window[n]=function(){l&&l(),i(window[t])}}o(e,function(e){e&&a(e),n||i(window[t])})})}function f(e,t,n){var r=(0,O.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=_.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=u.value;if(e[c]){var p=c.replace(/Config$/,"");if(r=(0,O.default)(r,o({},p,e[c])),n){var f="ReactPlayer: %c"+c+" %cis deprecated, please use the config prop instead – https://github.com/CookPete/react-player#config-prop";console.warn(f,"font-weight: bold","")}}}}catch(e){i=!0,l=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw l}}return r}function y(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 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}function d(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 h(e){return null!==e&&"object"===(void 0===e?"undefined":b(e))}function v(e,t){if("function"==typeof e&&"function"==typeof t)return!0;if(e instanceof Array&&t instanceof Array){if(e.length!==t.length)return!1;for(var n=0;n!==e.length;n++)if(!v(e[n],t[n]))return!1;return!0}if(h(e)&&h(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;var r=!0,o=!1,a=void 0;try{for(var i,l=Object.keys(e)[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var u=i.value;if(!v(e[u],t[u]))return!1}}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return!0}return e===t}function m(e){return"undefined"!=typeof window&&void 0!==window.MediaStream&&e instanceof window.MediaStream}Object.defineProperty(t,"__esModule",{value:!0});var b="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},g=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=l,t.parseEndTime=u,t.randomString=s,t.queryString=c,t.getSDK=p,t.getConfig=f,t.omit=y,t.callPlayer=d,t.isObject=h,t.isEqual=v,t.isMediaStream=m;var P=n(16),w=r(P),k=n(17),O=r(k),_=n(3),E=/[?&#](?:start|t)=([0-9hms]+)/,j=/[?&#]end=([0-9hms]+)/,S=/(\d+)(h|m|s)/g,T=/^\d+$/,R={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){var t,n;return n=t=function(t){function n(){var e,t,r,i;o(this,n);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return t=r=a(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(u))),r.config=(0,y.getConfig)(r.props,f.defaultProps,!0),r.getDuration=function(){return r.player?r.player.getDuration():null},r.getCurrentTime=function(){return r.player?r.player.getCurrentTime():null},r.getSecondsLoaded=function(){return r.player?r.player.getSecondsLoaded():null},r.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return r.player?r.player.getInternalPlayer(e):null},r.seekTo=function(e){if(!r.player)return null;r.player.seekTo(e)},r.ref=function(e){r.player=e},i=t,a(r,i)}return i(n,t),s(n,[{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,y.getConfig)(e,f.defaultProps)}},{key:"render",value:function(){if(!e.canPlay(this.props.url))return null;var t=this.props,n=t.style,r=t.width,o=t.height,a=t.wrapper,i=(0,y.omit)(this.props,v,f.DEPRECATED_CONFIG_PROPS);return p.default.createElement(a,u({style:u({},n,{width:r,height:o})},i),p.default.createElement(h.default,u({},this.props,{ref:this.ref,activePlayer:e,config:this.config})))}}]),n}(c.Component),t.displayName=e.displayName+"Player",t.propTypes=f.propTypes,t.defaultProps=f.defaultProps,t.canPlay=e.canPlay,n}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;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}}();t.default=l;var c=n(0),p=r(c),f=n(3),y=n(1),d=n(4),h=r(d),v=Object.keys(f.propTypes);e.exports=t.default},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(11),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,p=o.default.object,f=o.default.func;t.propTypes={url:s([a,u,p]),playing:i,loop:i,controls:i,volume:l,muted:i,playbackRate:l,width:s([a,l]),height:s([a,l]),style:p,progressInterval:l,playsinline:i,wrapper:s([a,f]),config:c({soundcloud:c({options:p}),youtube:c({playerVars:p,preload:i}),facebook:c({appId:a}),dailymotion:c({params:p,preload:i}),vimeo:c({playerOptions:p,preload:i}),file:c({attributes:p,tracks:u,forceVideo:i,forceAudio:i,forceHLS:i,forceDASH:i,hlsOptions:p}),wistia:c({options:p}),mixcloud:c({options:p}),twitch: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:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,wrapper:"div",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},preload:!1},facebook:{appId:"1309697205772819"},dailymotion:{params:{api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},preload:!1},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,hlsOptions:{}},wistia:{options:{}},mixcloud:{options:{hide_cover:1}},twitch:{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","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)}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(3),p=n(1),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.isLoading=!0,a.loadOnReady=null,a.startOnPlay=!0,a.seekOnPlay=null,a.onDurationCalled=!1,a.getInternalPlayer=function(e){return a.player?a.player[e]:null},a.progress=function(){if(a.props.url&&a.player&&a.isReady){var e=a.getCurrentTime()||0,t=a.getSecondsLoaded(),n=a.getDuration();if(n){var r={playedSeconds:e,played:e/n};null!==t&&(r.loadedSeconds=t,r.loaded=t/n),r.played===a.prevPlayed&&r.loaded===a.prevLoaded||a.props.onProgress(r),a.prevPlayed=r.played,a.prevLoaded=r.loaded}}a.progressTimeout=setTimeout(a.progress,a.props.progressFrequency||a.props.progressInterval)},a.onReady=function(){if(a.mounted){a.isReady=!0,a.isLoading=!1;var e=a.props,t=e.onReady,n=e.playing,r=e.volume,o=e.muted;t(),o||null===r||a.player.setVolume(r),a.loadOnReady?(a.player.load(a.loadOnReady,!0),a.loadOnReady=null):n&&a.player.play(),a.onDurationCheck()}},a.onPlay=function(){a.isPlaying=!0,a.isLoading=!1;var e=a.props,t=e.onStart,n=e.onPlay,r=e.playbackRate;a.startOnPlay&&(a.player.setPlaybackRate&&a.player.setPlaybackRate(r),t(),a.startOnPlay=!1),n(),a.seekOnPlay&&(a.seekTo(a.seekOnPlay),a.seekOnPlay=null),a.onDurationCheck()},a.onPause=function(e){a.isPlaying=!1,a.isLoading||a.props.onPause(e)},a.onEnded=function(){var e=a.props,t=e.activePlayer,n=e.loop,r=e.onEnded;t.loopOnEnded&&n&&a.seekTo(0),n||(a.isPlaying=!1),r()},a.onDurationCheck=function(){clearTimeout(a.durationCheckTimeout);var e=a.getDuration();e?a.onDurationCalled||(a.props.onDuration(e),a.onDurationCalled=!0):a.durationCheckTimeout=setTimeout(a.onDurationCheck,100)},a.onLoaded=function(){a.isLoading=!1},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),this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.player.stop(),this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=this.props,r=n.url,o=n.playing,a=n.volume,i=n.muted,l=n.playbackRate;if(!(0,p.isEqual)(r,e.url)){if(this.isLoading)return console.warn("ReactPlayer: the attempt to load "+e.url+" is being deferred until the player has loaded"),void(this.loadOnReady=e.url);this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(e.url,this.isReady)}o||!e.playing||this.isPlaying||this.player.play(),o&&!e.playing&&this.isPlaying&&this.player.pause(),a!==e.volume&&null!==e.volume&&this.player.setVolume(e.volume),i!==e.muted&&(e.muted?this.player.mute():(this.player.unmute(),null!==e.volume&&setTimeout(function(){return t.player.setVolume(e.volume)}))),l!==e.playbackRate&&this.player.setPlaybackRate&&this.player.setPlaybackRate(e.playbackRate)}},{key:"getDuration",value:function(){return this.isReady?this.player.getDuration():null}},{key:"getCurrentTime",value:function(){return this.isReady?this.player.getCurrentTime():null}},{key:"getSecondsLoaded",value:function(){return this.isReady?this.player.getSecondsLoaded():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 e?s.default.createElement(e,i({},this.props,{ref:this.ref,onReady:this.onReady,onPlay:this.onPlay,onPause:this.onPause,onEnded:this.onEnded,onLoaded:this.onLoaded})):null}}]),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,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.YouTube=void 0;var l=Object.assign||function(e){for(var t=1;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=r(s),p=n(1),f=n(2),y=r(f),d="YT",h=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/,v=t.YouTube=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.onStateChange=function(e){var t=e.data,n=r.props,o=n.onPlay,a=n.onPause,i=n.onBuffer,l=n.onEnded,u=n.onReady,s=window[d].PlayerState,c=s.PLAYING,p=s.PAUSED,f=s.BUFFERING,y=s.ENDED,h=s.CUED;t===c&&o(),t===p&&a(),t===f&&i(),t===y&&l(),t===h&&u()},r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unMute")},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playing,a=r.muted,i=r.playsinline,u=r.controls,s=r.config,c=r.onError,f=s.youtube.playerVars,y=e&&e.match(h)[1];if(t)return void this.player.cueVideoById({videoId:y,startSeconds:(0,p.parseStartTime)(e)||f.start,endSeconds:(0,p.parseEndTime)(e)||f.end});(0,p.getSDK)("https://www.youtube.com/iframe_api",d,"onYouTubeIframeAPIReady",function(e){return e.loaded}).then(function(t){n.container&&(n.player=new t.Player(n.container,{width:"100%",height:"100%",videoId:y,playerVars:l({autoplay:o?1:0,mute:a?1:0,controls:u?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:i},f),events:{onReady:n.props.onReady,onStateChange:n.onStateChange,onError:function(e){return c(e.data)}}}))},c)}},{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),this.props.playing||this.pause()}},{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=l({width:"100%",height:"100%"},this.props.style);return c.default.createElement("div",{style:e},c.default.createElement("div",{ref:this.ref}))}}]),t}(s.Component);v.displayName="YouTube",v.canPlay=function(e){return h.test(e)},v.loopOnEnded=!0,t.default=(0,y.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.SoundCloud=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/(soundcloud\.com|snd\.sc)\/.+$/,h=t.SoundCloud=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.fractionLoaded=null,r.mute=function(){r.setVolume(0)},r.unmute=function(){null!==r.props.volume&&r.setVolume(r.props.volume)},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e,t){var n=this;(0,p.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(function(r){if(n.iframe){var o=r.Widget.Events,a=o.PLAY,i=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(i,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,l({},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=l({width:"100%",height:"100%"},this.props.style);return c.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url="+encodeURIComponent(this.props.url),style:e,frameBorder:0})}}]),t}(s.Component);h.displayName="SoundCloud",h.canPlay=function(e){return d.test(e)},h.loopOnEnded=!0,t.default=(0,y.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Vimeo=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/vimeo\.com\/.+/,h=/vimeo\.com\/external\/.+\.mp4/,v=t.Vimeo=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){r.setVolume(0)},r.unmute=function(){null!==r.props.volume&&r.setVolume(r.props.volume)},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e){var t=this;this.duration=null,(0,p.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(function(n){t.container&&(t.player=new n.Player(t.container,l({},t.props.config.vimeo.playerOptions,{url:e,autoplay:t.props.playing,muted:t.props.muted,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.props.onReady(),t.player.getDuration().then(function(e){t.duration=e})}),t.player.on("play",t.props.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 n=e.seconds;t.currentTime=n}),t.player.on("progress",function(e){var n=e.seconds;t.secondsLoaded=n}))},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=l({width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"},this.props.style);return c.default.createElement("div",{key:this.props.url,ref:this.ref,style:e})}}]),t}(s.Component);v.displayName="Vimeo",v.canPlay=function(e){return!h.test(e)&&d.test(e)},t.default=(0,y.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.DailyMotion=void 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){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")}}(),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),p=r(c),f=n(1),y=n(2),d=r(y),h=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/,v=t.DailyMotion=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=f.callPlayer,r.onDurationChange=function(){var e=r.getDuration();r.props.onDuration(e)},r.mute=function(){r.callPlayer("setMuted",!0)},r.unmute=function(){r.callPlayer("setMuted",!1)},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),s(t,[{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.config,a=n.onError,i=n.playing,s=e.match(h),c=u(s,2),p=c[1];if(this.player)return void this.player.load(p,{start:(0,f.parseStartTime)(e),autoplay:i});(0,f.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",function(e){return e.player}).then(function(n){if(t.container){var i=n.player;t.player=new i(t.container,{width:"100%",height:"100%",video:p,params:l({controls:r,autoplay:t.props.playing,mute:t.props.muted,start:(0,f.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=l({width:"100%",height:"100%",backgroundColor:"black"},this.props.style);return p.default.createElement("div",{style:e},p.default.createElement("div",{ref:this.ref}))}}]),t}(c.Component);v.displayName="DailyMotion",v.canPlay=function(e){return h.test(e)},v.loopOnEnded=!0,t.default=(0,d.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(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 i=o.value;if("string"==typeof i&&l(i))return!0;if(l(i.src))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1}return!!(0,f.isMediaStream)(e)||(v.test(e)||m.test(e)||b.test(e)||g.test(e))}Object.defineProperty(t,"__esModule",{value:!0}),t.FilePlayer=void 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),p=r(c),f=n(1),y=n(2),d=r(y),h="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,v=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,m=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,b=/\.(m3u8)($|\?)/i,g=/\.(mpd)($|\?)/i,P=/www\.dropbox\.com\/.+/,w=t.FilePlayer=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,s=Array(l),c=0;c<l;c++)s[c]=arguments[c];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.onSeek=function(e){r.props.onSeek(e.target.currentTime)},r.mute=function(){r.player.muted=!0},r.unmute=function(){r.player.muted=!1},r.renderSourceElement=function(e,t){return"string"==typeof e?p.default.createElement("source",{key:t,src:e}):p.default.createElement("source",u({key:t},e))},r.renderTrack=function(e,t){return p.default.createElement("track",u({key:t},e))},r.ref=function(e){r.player=e},i=n,a(r,i)}return i(t,e),s(t,[{key:"componentDidMount",value:function(){this.addListeners(),h&&this.player.load()}},{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!e.config.file.forceVideo&&(!e.config.file.attributes.poster&&(v.test(e.url)||e.config.file.forceAudio))}},{key:"shouldUseHLS",value:function(e){return b.test(e)&&!h||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return g.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this;if(this.shouldUseHLS(e)&&(0,f.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/hls.js/0.9.1/hls.min.js","Hls").then(function(n){t.hls=new n(t.props.config.file.hlsOptions),t.hls.on(n.Events.ERROR,function(e,r){t.props.onError(e,r,t.hls,n)}),t.hls.loadSource(e),t.hls.attachMedia(t.player)}),this.shouldUseDASH(e)&&(0,f.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.6.5/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)}),e instanceof Array)this.player.load();else if((0,f.isMediaStream)(e))try{this.player.srcObject=e}catch(t){this.player.src=window.URL.createObjectURL(e)}}},{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?this.player.duration:null}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var e=this.player.buffered;if(0===e.length)return 0;var t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}},{key:"getSource",value:function(e){var t=this.shouldUseHLS(e),n=this.shouldUseDASH(e);if(!(e instanceof Array||(0,f.isMediaStream)(e)||t||n))return P.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.playing,r=e.loop,o=e.controls,a=e.muted,i=e.config,l=e.width,s=e.height,c=this.shouldUseAudio(this.props),f=c?"audio":"video",y={width:"auto"===l?l:"100%",height:"auto"===s?s:"100%"};return p.default.createElement(f,u({ref:this.ref,src:this.getSource(t),style:y,preload:"auto",autoPlay:n||void 0,controls:o,muted:a,loop:r},i.file.attributes),t instanceof Array&&t.map(this.renderSourceElement),i.file.tracks.map(this.renderTrack))}}]),t}(c.Component);w.displayName="FilePlayer",w.canPlay=l,t.default=(0,d.default)(w)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);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),p=r(c),f=n(3),y=n(1),d=n(18),h=r(d),v=n(4),m=r(v),b=n(9),g=n(24),P=r(g),w=Object.keys(f.propTypes),k=[],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,f.defaultProps,!0),n.getDuration=function(){return n.player?n.player.getDuration():null},n.getCurrentTime=function(){return n.player?n.player.getCurrentTime():null},n.getSecondsLoaded=function(){return n.player?n.player.getSecondsLoaded():null},n.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return n.player?n.player.getInternalPlayer(e):null},n.seekTo=function(e){if(!n.player)return null;n.player.seekTo(e)},n.onReady=function(){n.props.onReady(n)},n.wrapperRef=function(e){n.wrapper=e},n.activePlayerRef=function(e){n.player=e},r=t,i(n,r)}return l(ReactPlayer,e),s(ReactPlayer,[{key:"componentDidMount",value:function(){if(this.props.progressFrequency){console.warn("ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead","font-weight: bold","","font-weight: bold","")}}},{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,y.getConfig)(e,f.defaultProps)}},{key:"getActivePlayer",value:function(e){for(var t=[].concat(o(k),o(h.default)),n=0;n<t.length;n++){var r=t[n];if(r.canPlay(e))return r}return b.FilePlayer}},{key:"renderActivePlayer",value:function(e){if(!e)return null;var t=this.getActivePlayer(e);return p.default.createElement(m.default,u({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t,onReady:this.onReady}))}},{key:"sortPlayers",value:function(e,t){return e&&t?e.key<t.key?-1:1:0}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.style,r=e.width,a=e.height,i=e.wrapper,l=(0,y.omit)(this.props,w,f.DEPRECATED_CONFIG_PROPS),s=this.renderActivePlayer(t),c=(0,P.default)(t,this.config),d=[s].concat(o(c)).sort(this.sortPlayers);return p.default.createElement(i,u({ref:this.wrapperRef,style:u({},n,{width:r,height:a})},l),d)}}]),ReactPlayer}(c.Component);ReactPlayer.addCustomPlayer=function(e){k.push(e)},ReactPlayer.removeCustomPlayers=function(){k=[]},ReactPlayer.displayName="ReactPlayer",ReactPlayer.propTypes=f.propTypes,ReactPlayer.defaultProps=f.defaultProps,ReactPlayer.canPlay=function(e){for(var t=[].concat(o(k),o(h.default)),n=0;n<t.length;n++){if(t[n].canPlay(e))return!0}return!1},t.default=ReactPlayer,e.exports=t.default},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=n(12)()},function(e,t,n){"use strict";var r=n(13),o=n(14),a=n(15);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],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=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":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,n){return e.concat(t).map(function(e){return l(e,n)})}function s(e,t,n){var r={};return f(e)&&Object.keys(e).forEach(function(t){r[t]=l(e[t],n)}),Object.keys(t).forEach(function(o){f(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 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 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";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(6),a=n(7),i=n(19),l=n(20),u=n(21),s=n(22),c=n(8),p=n(23),f=n(9);t.default=[r.YouTube,o.SoundCloud,a.Vimeo,i.Facebook,l.Streamable,u.Wistia,s.Twitch,c.DailyMotion,p.Mixcloud,f.FilePlayer],e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Facebook=void 0;var 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=r(u),c=n(1),p=n(2),f=r(p),y="//connect.facebook.net/en_US/sdk.js",d=/facebook\.com\/([^\/?].+\/)?video(s|\.php)[\/?].*$/,h="facebook-player-",v=t.Facebook=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=c.callPlayer,r.playerID=h+(0,c.randomString)(),r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e,t){var n=this;if(t)return void(0,c.getSDK)(y,"FB","fbAsyncInit").then(function(e){return e.XFBML.parse()});(0,c.getSDK)(y,"FB","fbAsyncInit").then(function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:"v2.5"}),e.Event.subscribe("xfbml.render",function(e){n.props.onLoaded()}),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.muted||n.callPlayer("unmute"),n.props.onReady(),document.getElementById(n.playerID).querySelector("iframe").style.visibility="visible")})})}},{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.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 s.default.createElement("div",{style:e,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"})}}]),t}(u.Component);v.displayName="Facebook",v.canPlay=function(e){return d.test(e)},v.loopOnEnded=!0,t.default=(0,f.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Streamable=void 0;var 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=r(u),c=n(1),p=n(2),f=r(p),y=/streamable\.com\/([a-z0-9]+)$/,d=t.Streamable=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=c.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e){var t=this;(0,c.getSDK)("//cdn.embed.ly/player-0.1.0.min.js","playerjs").then(function(e){t.iframe&&(t.player=new e.Player(t.iframe),t.player.setLoop(t.props.loop),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("buffered",function(e){var n=e.percent;t.duration&&(t.secondsLoaded=t.duration*n)}),t.props.muted&&t.player.mute())},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(y)[1],t={width:"100%",height:"100%"};return s.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/"+e,frameBorder:"0",scrolling:"no",style:t,allowFullScreen:!0})}}]),t}(u.Component);d.displayName="Streamable",d.canPlay=function(e){return y.test(e)},t.default=(0,f.default)(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Wistia=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/,h=t.Wistia=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},i=n,a(r,i)}return i(t,e),u(t,[{key:"getID",value:function(e){return e&&e.match(d)[1]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.playing,o=n.muted,a=n.controls,i=n.onReady,u=n.onPlay,s=n.onPause,c=n.onSeek,f=n.onEnded,y=n.config;(0,p.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({autoPlay:r,silentAutoPlay:"allow",muted:o,controlsVisibleOnLoad:a},y.wistia.options),onReady:function(e){t.player=e,t.player.bind("play",u),t.player.bind("pause",s),t.player.bind("seek",c),t.player.bind("end",f),i()}})})}},{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 c.default.createElement("div",{key:e,className:t,style:n})}}]),t}(s.Component);h.displayName="Wistia",h.canPlay=function(e){return d.test(e)},h.loopOnEnded=!0,t.default=(0,y.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Twitch=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,h=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,v="twitch-player-",m=t.Twitch=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.playerID=v+(0,p.randomString)(),r.mute=function(){r.callPlayer("setMuted",!0)},r.unmute=function(){r.callPlayer("setMuted",!1)},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,i=r.config,u=h.test(e),s=u?e.match(h)[1]:e.match(d)[1];if(t)return void(u?this.player.setChannel(s):this.player.setVideo("v"+s));(0,p.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then(function(e){n.player=new e.Player(n.playerID,l({video:u?"":s,channel:u?s:"",height:"100%",width:"100%",playsinline:o,autoplay:n.props.playing,muted:n.props.muted},i.twitch.options));var t=e.Player,r=t.READY,a=t.PLAY,c=t.PAUSE,p=t.ENDED;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(a,n.props.onPlay),n.player.addEventListener(c,n.props.onPause),n.player.addEventListener(p,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 c.default.createElement("div",{style:e,id:this.playerID})}}]),t}(s.Component);m.displayName="Twitch",m.canPlay=function(e){return d.test(e)||h.test(e)},m.loopOnEnded=!0,t.default=(0,y.default)(m)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Mixcloud=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/mixcloud\.com\/([^\/]+\/[^\/]+)/,h=t.Mixcloud=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){},r.unmute=function(){},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e){var t=this;(0,p.getSDK)("//widget.mixcloud.com/media/js/widgetApi.js","Mixcloud").then(function(e){t.player=e.PlayerWidget(t.iframe),t.player.ready.then(function(){t.player.events.play.on(t.props.onPlay),t.player.events.pause.on(t.props.onPause),t.player.events.ended.on(t.props.onEnded),t.player.events.error.on(t.props.error),t.player.events.progress.on(function(e,n){t.currentTime=e,t.duration=n}),t.props.onReady()})},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("seek",e)}},{key:"setVolume",value:function(e){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.config,r=t.match(d)[1],o={width:"100%",height:"100%"},a=(0,p.queryString)(l({},n.mixcloud.options,{feed:"/"+r+"/"}));return c.default.createElement("iframe",{key:r,ref:this.ref,style:o,src:"https://www.mixcloud.com/widget/iframe/?"+a,frameBorder:"0"})}}]),t}(s.Component);h.displayName="Mixcloud",h.canPlay=function(e){return d.test(e)},t.default=(0,y.default)(h)},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=y[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,muted:!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(4),u=r(l),s=n(5),c=n(6),p=n(7),f=n(8),y=[{Player:s.YouTube,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:c.SoundCloud,configKey:"soundcloud",url:"https://soundcloud.com/seucheu/john-cage-433-8-bit-version"},{Player:p.Vimeo,configKey:"vimeo",url:"https://vimeo.com/127250231"},{Player:f.DailyMotion,configKey:"dailymotion",url:"http://www.dailymotion.com/video/xqdpyk"}];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=15)}([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,t){var n=e.match(t);if(n){var r=n[1];if(r.match(S))return i(r);if(T.test(r))return parseInt(r)}}function i(e){for(var t=0,n=S.exec(e);null!==n;){var r=n,o=P(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=S.exec(e)}return t}function l(e){return a(e,E)}function u(e){return a(e,j)}function s(){return Math.random().toString(36).substr(2,5)}function c(e){return Object.keys(e).map(function(t){return t+"="+e[t]}).join("&")}function p(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},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:w.default;return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise(function(r,a){if(R[e])return void R[e].push(r);R[e]=[r];var i=function(t){R[e].forEach(function(e){return e(t)})};if(n){var l=window[n];window[n]=function(){l&&l(),i(window[t])}}o(e,function(e){e&&a(e),n||i(window[t])})})}function f(e,t,n){var r=(0,O.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=_.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=u.value;if(e[c]){var p=c.replace(/Config$/,"");if(r=(0,O.default)(r,o({},p,e[c])),n){var f="ReactPlayer: %c"+c+" %cis deprecated, please use the config prop instead – https://github.com/CookPete/react-player#config-prop";console.warn(f,"font-weight: bold","")}}}}catch(e){i=!0,l=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw l}}return r}function y(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 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}function d(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 h(e){return null!==e&&"object"===(void 0===e?"undefined":b(e))}function v(e,t){if("function"==typeof e&&"function"==typeof t)return!0;if(e instanceof Array&&t instanceof Array){if(e.length!==t.length)return!1;for(var n=0;n!==e.length;n++)if(!v(e[n],t[n]))return!1;return!0}if(h(e)&&h(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;var r=!0,o=!1,a=void 0;try{for(var i,l=Object.keys(e)[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var u=i.value;if(!v(e[u],t[u]))return!1}}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return!0}return e===t}function m(e){return"undefined"!=typeof window&&void 0!==window.MediaStream&&e instanceof window.MediaStream}Object.defineProperty(t,"__esModule",{value:!0});var b="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(){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=l,t.parseEndTime=u,t.randomString=s,t.queryString=c,t.getSDK=p,t.getConfig=f,t.omit=y,t.callPlayer=d,t.isObject=h,t.isEqual=v,t.isMediaStream=m;var g=n(16),w=r(g),k=n(17),O=r(k),_=n(3),E=/[?&#](?:start|t)=([0-9hms]+)/,j=/[?&#]end=([0-9hms]+)/,S=/(\d+)(h|m|s)/g,T=/^\d+$/,R={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){var t,n;return n=t=function(t){function n(){var e,t,r,i;o(this,n);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return t=r=a(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(u))),r.config=(0,y.getConfig)(r.props,f.defaultProps,!0),r.getDuration=function(){return r.player?r.player.getDuration():null},r.getCurrentTime=function(){return r.player?r.player.getCurrentTime():null},r.getSecondsLoaded=function(){return r.player?r.player.getSecondsLoaded():null},r.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return r.player?r.player.getInternalPlayer(e):null},r.seekTo=function(e){if(!r.player)return null;r.player.seekTo(e)},r.ref=function(e){r.player=e},i=t,a(r,i)}return i(n,t),s(n,[{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,y.getConfig)(e,f.defaultProps)}},{key:"render",value:function(){var t=this.config.file,n=t.forceVideo,r=t.forceAudio,o=t.forceHLS,a=t.forceDASH,i=n||r||o||a;if(!e.canPlay(this.props.url)&&!i)return null;var l=this.props,s=l.style,c=l.width,d=l.height,m=l.wrapper,b=(0,y.omit)(this.props,v,f.DEPRECATED_CONFIG_PROPS);return p.default.createElement(m,u({style:u({},s,{width:c,height:d})},b),p.default.createElement(h.default,u({},this.props,{ref:this.ref,activePlayer:e,config:this.config})))}}]),n}(c.Component),t.displayName=e.displayName+"Player",t.propTypes=f.propTypes,t.defaultProps=f.defaultProps,t.canPlay=e.canPlay,n}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;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}}();t.default=l;var c=n(0),p=r(c),f=n(3),y=n(1),d=n(5),h=r(d),v=Object.keys(f.propTypes);e.exports=t.default},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(18),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,p=o.default.object,f=o.default.func;t.propTypes={url:s([a,u,p]),playing:i,loop:i,controls:i,volume:l,muted:i,playbackRate:l,width:s([a,l]),height:s([a,l]),style:p,progressInterval:l,playsinline:i,pip:i,wrapper:s([a,f]),config:c({soundcloud:c({options:p}),youtube:c({playerVars:p,preload:i}),facebook:c({appId:a}),dailymotion:c({params:p,preload:i}),vimeo:c({playerOptions:p,preload:i}),file:c({attributes:p,tracks:u,forceVideo:i,forceAudio:i,forceHLS:i,forceDASH:i,hlsOptions:p,hlsVersion:a,dashVersion:a}),wistia:c({options:p}),mixcloud:c({options:p}),twitch:c({options:p})}),onReady:f,onStart:f,onPlay:f,onPause:f,onBuffer:f,onEnded:f,onError:f,onDuration:f,onSeek:f,onProgress:f,onEnablePIP:f,onDisablePIP:f},t.defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,wrapper:"div",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},preload:!1},facebook:{appId:"1309697205772819"},dailymotion:{params:{api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},preload:!1},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,hlsOptions:{},hlsVersion:"0.10.1",dashVersion:"2.9.2"},wistia:{options:{}},mixcloud:{options:{hide_cover:1}},twitch:{options:{}}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onSeek:function(){},onProgress:function(){},onEnablePIP:function(){},onDisablePIP:function(){}},t.DEPRECATED_CONFIG_PROPS=["soundcloudConfig","youtubeConfig","facebookConfig","dailymotionConfig","vimeoConfig","fileConfig","wistiaConfig"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.YouTube=void 0;var l=Object.assign||function(e){for(var t=1;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=r(s),p=n(1),f=n(2),y=r(f),d="YT",h=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/,v=t.YouTube=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.onStateChange=function(e){var t=e.data,n=r.props,o=n.onPlay,a=n.onPause,i=n.onBuffer,l=n.onEnded,u=n.onReady,s=window[d].PlayerState,c=s.PLAYING,p=s.PAUSED,f=s.BUFFERING,y=s.ENDED,h=s.CUED;t===c&&o(),t===p&&a(),t===f&&i(),t===y&&l(),t===h&&u()},r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unMute")},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playing,a=r.muted,i=r.playsinline,u=r.controls,s=r.config,c=r.onError,f=s.youtube.playerVars,y=e&&e.match(h)[1];if(t)return void this.player.cueVideoById({videoId:y,startSeconds:(0,p.parseStartTime)(e)||f.start,endSeconds:(0,p.parseEndTime)(e)||f.end});(0,p.getSDK)("https://www.youtube.com/iframe_api",d,"onYouTubeIframeAPIReady",function(e){return e.loaded}).then(function(t){n.container&&(n.player=new t.Player(n.container,{width:"100%",height:"100%",videoId:y,playerVars:l({autoplay:o?1:0,mute:a?1:0,controls:u?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:i},f),events:{onReady:n.props.onReady,onStateChange:n.onStateChange,onError:function(e){return c(e.data)}}}))},c)}},{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),this.props.playing||this.pause()}},{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=l({width:"100%",height:"100%"},this.props.style);return c.default.createElement("div",{style:e},c.default.createElement("div",{ref:this.ref}))}}]),t}(s.Component);v.displayName="YouTube",v.canPlay=function(e){return h.test(e)},v.loopOnEnded=!0,t.default=(0,y.default)(v)},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(3),p=n(1),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.isLoading=!0,a.loadOnReady=null,a.startOnPlay=!0,a.seekOnPlay=null,a.onDurationCalled=!1,a.getInternalPlayer=function(e){return a.player?a.player[e]:null},a.progress=function(){if(a.props.url&&a.player&&a.isReady){var e=a.getCurrentTime()||0,t=a.getSecondsLoaded(),n=a.getDuration();if(n){var r={playedSeconds:e,played:e/n};null!==t&&(r.loadedSeconds=t,r.loaded=t/n),r.played===a.prevPlayed&&r.loaded===a.prevLoaded||a.props.onProgress(r),a.prevPlayed=r.played,a.prevLoaded=r.loaded}}a.progressTimeout=setTimeout(a.progress,a.props.progressFrequency||a.props.progressInterval)},a.onReady=function(){if(a.mounted){a.isReady=!0,a.isLoading=!1;var e=a.props,t=e.onReady,n=e.playing,r=e.volume,o=e.muted;t(),o||null===r||a.player.setVolume(r),a.loadOnReady?(a.player.load(a.loadOnReady,!0),a.loadOnReady=null):n&&a.player.play(),a.onDurationCheck()}},a.onPlay=function(){a.isPlaying=!0,a.isLoading=!1;var e=a.props,t=e.onStart,n=e.onPlay,r=e.playbackRate;a.startOnPlay&&(a.player.setPlaybackRate&&a.player.setPlaybackRate(r),t(),a.startOnPlay=!1),n(),a.seekOnPlay&&(a.seekTo(a.seekOnPlay),a.seekOnPlay=null),a.onDurationCheck()},a.onPause=function(e){a.isPlaying=!1,a.isLoading||a.props.onPause(e)},a.onEnded=function(){var e=a.props,t=e.activePlayer,n=e.loop,r=e.onEnded;t.loopOnEnded&&n&&a.seekTo(0),n||(a.isPlaying=!1,r())},a.onDurationCheck=function(){clearTimeout(a.durationCheckTimeout);var e=a.getDuration();e?a.onDurationCalled||(a.props.onDuration(e),a.onDurationCalled=!0):a.durationCheckTimeout=setTimeout(a.onDurationCheck,100)},a.onLoaded=function(){a.isLoading=!1},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),this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.player.stop(),this.player.disablePIP&&this.player.disablePIP(),this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=this.props,r=n.url,o=n.playing,a=n.volume,i=n.muted,l=n.playbackRate,u=n.pip;if(!(0,p.isEqual)(r,e.url)){if(this.isLoading)return console.warn("ReactPlayer: the attempt to load "+e.url+" is being deferred until the player has loaded"),void(this.loadOnReady=e.url);this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(e.url,this.isReady)}o||!e.playing||this.isPlaying||this.player.play(),o&&!e.playing&&this.isPlaying&&this.player.pause(),!u&&e.pip&&this.player.enablePIP?this.player.enablePIP():u&&!e.pip&&this.player.disablePIP&&this.player.disablePIP(),a!==e.volume&&null!==e.volume&&this.player.setVolume(e.volume),i!==e.muted&&(e.muted?this.player.mute():(this.player.unmute(),null!==e.volume&&setTimeout(function(){return t.player.setVolume(e.volume)}))),l!==e.playbackRate&&this.player.setPlaybackRate&&this.player.setPlaybackRate(e.playbackRate)}},{key:"getDuration",value:function(){return this.isReady?this.player.getDuration():null}},{key:"getCurrentTime",value:function(){return this.isReady?this.player.getCurrentTime():null}},{key:"getSecondsLoaded",value:function(){return this.isReady?this.player.getSecondsLoaded():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 e?s.default.createElement(e,i({},this.props,{ref:this.ref,onReady:this.onReady,onPlay:this.onPlay,onPause:this.onPause,onEnded:this.onEnded,onLoaded:this.onLoaded})):null}}]),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,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.SoundCloud=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/(soundcloud\.com|snd\.sc)\/.+$/,h=t.SoundCloud=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.fractionLoaded=null,r.mute=function(){r.setVolume(0)},r.unmute=function(){null!==r.props.volume&&r.setVolume(r.props.volume)},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e,t){var n=this;(0,p.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(function(r){if(n.iframe){var o=r.Widget.Events,a=o.PLAY,i=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(i,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,l({},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=l({width:"100%",height:"100%"},this.props.style);return c.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url="+encodeURIComponent(this.props.url),style:e,frameBorder:0})}}]),t}(s.Component);h.displayName="SoundCloud",h.canPlay=function(e){return d.test(e)},h.loopOnEnded=!0,t.default=(0,y.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Vimeo=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/vimeo\.com\/.+/,h=/vimeo\.com\/external\/.+\.mp4/,v=t.Vimeo=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){r.setVolume(0)},r.unmute=function(){null!==r.props.volume&&r.setVolume(r.props.volume)},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e){var t=this;this.duration=null,(0,p.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(function(n){t.container&&(t.player=new n.Player(t.container,l({},t.props.config.vimeo.playerOptions,{url:e,autoplay:t.props.playing,muted:t.props.muted,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.props.onReady(),t.refreshDuration()}),t.player.on("play",function(){t.props.onPlay(),t.refreshDuration()}),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 n=e.seconds;t.currentTime=n}),t.player.on("progress",function(e){var n=e.seconds;t.secondsLoaded=n}))},this.props.onError)}},{key:"refreshDuration",value:function(){var e=this;this.player.getDuration().then(function(t){e.duration=t})}},{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=l({width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"},this.props.style);return c.default.createElement("div",{key:this.props.url,ref:this.ref,style:e})}}]),t}(s.Component);v.displayName="Vimeo",v.canPlay=function(e){return!h.test(e)&&d.test(e)},t.default=(0,y.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.DailyMotion=void 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){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")}}(),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),p=r(c),f=n(1),y=n(2),d=r(y),h=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/,v=t.DailyMotion=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=f.callPlayer,r.onDurationChange=function(){var e=r.getDuration();r.props.onDuration(e)},r.mute=function(){r.callPlayer("setMuted",!0)},r.unmute=function(){r.callPlayer("setMuted",!1)},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),s(t,[{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.config,a=n.onError,i=n.playing,s=e.match(h),c=u(s,2),p=c[1];if(this.player)return void this.player.load(p,{start:(0,f.parseStartTime)(e),autoplay:i});(0,f.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",function(e){return e.player}).then(function(n){if(t.container){var i=n.player;t.player=new i(t.container,{width:"100%",height:"100%",video:p,params:l({controls:r,autoplay:t.props.playing,mute:t.props.muted,start:(0,f.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=l({width:"100%",height:"100%",backgroundColor:"black"},this.props.style);return p.default.createElement("div",{style:e},p.default.createElement("div",{ref:this.ref}))}}]),t}(c.Component);v.displayName="DailyMotion",v.canPlay=function(e){return h.test(e)},v.loopOnEnded=!0,t.default=(0,d.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Facebook=void 0;var 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=r(u),c=n(1),p=n(2),f=r(p),y="//connect.facebook.net/en_US/sdk.js",d=/facebook\.com\/([^\/?].+\/)?video(s|\.php)[\/?].*$/,h="facebook-player-",v=t.Facebook=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=c.callPlayer,r.playerID=h+(0,c.randomString)(),r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e,t){var n=this;if(t)return void(0,c.getSDK)(y,"FB","fbAsyncInit").then(function(e){return e.XFBML.parse()});(0,c.getSDK)(y,"FB","fbAsyncInit").then(function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:"v2.5"}),e.Event.subscribe("xfbml.render",function(e){n.props.onLoaded()}),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.muted||n.callPlayer("unmute"),n.props.onReady(),document.getElementById(n.playerID).querySelector("iframe").style.visibility="visible")})})}},{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.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 s.default.createElement("div",{style:e,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"})}}]),t}(u.Component);v.displayName="Facebook",v.canPlay=function(e){return d.test(e)},v.loopOnEnded=!0,t.default=(0,f.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Streamable=void 0;var 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=r(u),c=n(1),p=n(2),f=r(p),y=/streamable\.com\/([a-z0-9]+)$/,d=t.Streamable=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=c.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e){var t=this;(0,c.getSDK)("//cdn.embed.ly/player-0.1.0.min.js","playerjs").then(function(e){t.iframe&&(t.player=new e.Player(t.iframe),t.player.setLoop(t.props.loop),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("buffered",function(e){var n=e.percent;t.duration&&(t.secondsLoaded=t.duration*n)}),t.props.muted&&t.player.mute())},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(y)[1],t={width:"100%",height:"100%"};return s.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/"+e,frameBorder:"0",scrolling:"no",style:t,allowFullScreen:!0})}}]),t}(u.Component);d.displayName="Streamable",d.canPlay=function(e){return y.test(e)},t.default=(0,f.default)(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Wistia=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/,h=t.Wistia=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},i=n,a(r,i)}return i(t,e),u(t,[{key:"getID",value:function(e){return e&&e.match(d)[1]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.playing,o=n.muted,a=n.controls,i=n.onReady,u=n.onPlay,s=n.onPause,c=n.onSeek,f=n.onEnded,y=n.config;(0,p.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({autoPlay:r,silentAutoPlay:"allow",muted:o,controlsVisibleOnLoad:a},y.wistia.options),onReady:function(e){t.player=e,t.player.bind("play",u),t.player.bind("pause",s),t.player.bind("seek",c),t.player.bind("end",f),i()}})})}},{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 c.default.createElement("div",{key:e,className:t,style:n})}}]),t}(s.Component);h.displayName="Wistia",h.canPlay=function(e){return d.test(e)},h.loopOnEnded=!0,t.default=(0,y.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Twitch=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,h=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,v="twitch-player-",m=t.Twitch=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.playerID=v+(0,p.randomString)(),r.mute=function(){r.callPlayer("setMuted",!0)},r.unmute=function(){r.callPlayer("setMuted",!1)},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,i=r.config,u=h.test(e),s=u?e.match(h)[1]:e.match(d)[1];if(t)return void(u?this.player.setChannel(s):this.player.setVideo("v"+s));(0,p.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then(function(e){n.player=new e.Player(n.playerID,l({video:u?"":s,channel:u?s:"",height:"100%",width:"100%",playsinline:o,autoplay:n.props.playing,muted:n.props.muted},i.twitch.options));var t=e.Player,r=t.READY,a=t.PLAYING,c=t.PAUSE,p=t.ENDED;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(a,n.props.onPlay),n.player.addEventListener(c,n.props.onPause),n.player.addEventListener(p,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 c.default.createElement("div",{style:e,id:this.playerID})}}]),t}(s.Component);m.displayName="Twitch",m.canPlay=function(e){return d.test(e)||h.test(e)},m.loopOnEnded=!0,t.default=(0,y.default)(m)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Mixcloud=void 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=r(s),p=n(1),f=n(2),y=r(f),d=/mixcloud\.com\/([^\/]+\/[^\/]+)/,h=t.Mixcloud=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){},r.unmute=function(){},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e){var t=this;(0,p.getSDK)("//widget.mixcloud.com/media/js/widgetApi.js","Mixcloud").then(function(e){t.player=e.PlayerWidget(t.iframe),t.player.ready.then(function(){t.player.events.play.on(t.props.onPlay),t.player.events.pause.on(t.props.onPause),t.player.events.ended.on(t.props.onEnded),t.player.events.error.on(t.props.error),t.player.events.progress.on(function(e,n){t.currentTime=e,t.duration=n}),t.props.onReady()})},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("seek",e)}},{key:"setVolume",value:function(e){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.config,r=t.match(d)[1],o={width:"100%",height:"100%"},a=(0,p.queryString)(l({},n.mixcloud.options,{feed:"/"+r+"/"}));return c.default.createElement("iframe",{key:r,ref:this.ref,style:o,src:"https://www.mixcloud.com/widget/iframe/?"+a,frameBorder:"0"})}}]),t}(s.Component);h.displayName="Mixcloud",h.canPlay=function(e){return d.test(e)},t.default=(0,y.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(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 i=o.value;if("string"==typeof i&&l(i))return!0;if(l(i.src))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1}return!!(0,y.isMediaStream)(e)||(m.test(e)||b.test(e)||P.test(e)||w.test(e))}function u(e){return l(e)&&!!document.pictureInPictureEnabled&&!m.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.FilePlayer=void 0;var s=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},c=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}}(),p=n(0),f=r(p),y=n(1),d=n(2),h=r(d),v="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,m=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,b=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,P=/\.(m3u8)($|\?)/i,g="https://cdnjs.cloudflare.com/ajax/libs/hls.js/VERSION/hls.min.js",w=/\.(mpd)($|\?)/i,k="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",O=/www\.dropbox\.com\/.+/,_=t.FilePlayer=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.onDisablePIP=function(e){var t=r.props,n=t.onDisablePIP,o=t.playing;n(e),o&&r.play()},r.onSeek=function(e){r.props.onSeek(e.target.currentTime)},r.mute=function(){r.player.muted=!0},r.unmute=function(){r.player.muted=!1},r.renderSourceElement=function(e,t){return"string"==typeof e?f.default.createElement("source",{key:t,src:e}):f.default.createElement("source",s({key:t},e))},r.renderTrack=function(e,t){return f.default.createElement("track",s({key:t},e))},r.ref=function(e){r.player=e},i=n,a(r,i)}return i(t,e),c(t,[{key:"componentDidMount",value:function(){this.addListeners(),v&&this.player.load()}},{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,l=e.onEnablePIP;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),this.player.addEventListener("enterpictureinpicture",l),this.player.addEventListener("leavepictureinpicture",this.onDisablePIP),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,i=e.onEnablePIP;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),this.player.removeEventListener("enterpictureinpicture",i),this.player.removeEventListener("leavepictureinpicture",this.onDisablePIP)}},{key:"shouldUseAudio",value:function(e){return!e.config.file.forceVideo&&(!e.config.file.attributes.poster&&(m.test(e.url)||e.config.file.forceAudio))}},{key:"shouldUseHLS",value:function(e){return P.test(e)&&!v||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return w.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this,n=this.props.config.file,r=n.hlsVersion,o=n.dashVersion;if(this.shouldUseHLS(e)&&(0,y.getSDK)(g.replace("VERSION",r),"Hls").then(function(n){t.hls=new n(t.props.config.file.hlsOptions),t.hls.on(n.Events.ERROR,function(e,r){t.props.onError(e,r,t.hls,n)}),t.hls.loadSource(e),t.hls.attachMedia(t.player)}),this.shouldUseDASH(e)&&(0,y.getSDK)(k.replace("VERSION",o),"dashjs").then(function(n){t.dash=n.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.getDebug().setLogToBrowserConsole(!1)}),e instanceof Array)this.player.load();else if((0,y.isMediaStream)(e))try{this.player.srcObject=e}catch(t){this.player.src=window.URL.createObjectURL(e)}}},{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:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){if(!this.player)return null;var e=this.player,t=e.duration,n=e.seekable;return t===1/0&&n.length>0?n.end(n.length-1):t}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var e=this.player.buffered;if(0===e.length)return 0;var t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}},{key:"getSource",value:function(e){var t=this.shouldUseHLS(e),n=this.shouldUseDASH(e);if(!(e instanceof Array||(0,y.isMediaStream)(e)||t||n))return O.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.playing,r=e.loop,o=e.controls,a=e.muted,i=e.config,l=e.width,u=e.height,c=this.shouldUseAudio(this.props),p=c?"audio":"video",y={width:"auto"===l?l:"100%",height:"auto"===u?u:"100%"};return f.default.createElement(p,s({ref:this.ref,src:this.getSource(t),style:y,preload:"auto",autoPlay:n||void 0,controls:o,muted:a,loop:r},i.file.attributes),t instanceof Array&&t.map(this.renderSourceElement),i.file.tracks.map(this.renderTrack))}}]),t}(p.Component);_.displayName="FilePlayer",_.canPlay=l,_.canEnablePIP=u,t.default=(0,h.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}),t.FilePlayer=t.Mixcloud=t.DailyMotion=t.Twitch=t.Wistia=t.Streamable=t.Facebook=t.Vimeo=t.SoundCloud=t.YouTube=void 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(4);Object.defineProperty(t,"YouTube",{enumerable:!0,get:function(){return r(c).default}});var p=n(6);Object.defineProperty(t,"SoundCloud",{enumerable:!0,get:function(){return r(p).default}});var f=n(7);Object.defineProperty(t,"Vimeo",{enumerable:!0,get:function(){return r(f).default}});var y=n(9);Object.defineProperty(t,"Facebook",{enumerable:!0,get:function(){return r(y).default}});var d=n(10);Object.defineProperty(t,"Streamable",{enumerable:!0,get:function(){return r(d).default}});var h=n(11);Object.defineProperty(t,"Wistia",{enumerable:!0,get:function(){return r(h).default}});var v=n(12);Object.defineProperty(t,"Twitch",{enumerable:!0,get:function(){return r(v).default}});var m=n(8);Object.defineProperty(t,"DailyMotion",{enumerable:!0,get:function(){return r(m).default}});var b=n(13);Object.defineProperty(t,"Mixcloud",{enumerable:!0,get:function(){return r(b).default}});var P=n(14);Object.defineProperty(t,"FilePlayer",{enumerable:!0,get:function(){return r(P).default}});var g=n(0),w=r(g),k=n(3),O=n(1),_=n(23),E=r(_),j=n(5),S=r(j),T=n(24),R=r(T),D=Object.keys(k.propTypes),C=[],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,O.getConfig)(n.props,k.defaultProps,!0),n.getDuration=function(){return n.player?n.player.getDuration():null},n.getCurrentTime=function(){return n.player?n.player.getCurrentTime():null},n.getSecondsLoaded=function(){return n.player?n.player.getSecondsLoaded():null},n.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return n.player?n.player.getInternalPlayer(e):null},n.seekTo=function(e){if(!n.player)return null;n.player.seekTo(e)},n.onReady=function(){n.props.onReady(n)},n.wrapperRef=function(e){n.wrapper=e},n.activePlayerRef=function(e){n.player=e},r=t,i(n,r)}return l(ReactPlayer,e),s(ReactPlayer,[{key:"componentDidMount",value:function(){if(this.props.progressFrequency){console.warn("ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead","font-weight: bold","","font-weight: bold","")}}},{key:"shouldComponentUpdate",value:function(e){return!(0,O.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,O.getConfig)(e,k.defaultProps)}},{key:"getActivePlayer",value:function(e){for(var t=[].concat(o(C),o(E.default)),n=0;n<t.length;n++){var r=t[n];if(r.canPlay(e))return r}return P.FilePlayer}},{key:"renderActivePlayer",value:function(e){if(!e)return null;var t=this.getActivePlayer(e);return w.default.createElement(S.default,u({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t,onReady:this.onReady}))}},{key:"sortPlayers",value:function(e,t){return e&&t?e.key<t.key?-1:1:0}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.style,r=e.width,a=e.height,i=e.wrapper,l=(0,O.omit)(this.props,D,k.DEPRECATED_CONFIG_PROPS),s=this.renderActivePlayer(t),c=(0,R.default)(t,this.config),p=[s].concat(o(c)).sort(this.sortPlayers);return w.default.createElement(i,u({ref:this.wrapperRef,style:u({},n,{width:r,height:a})},l),p)}}]),ReactPlayer}(g.Component);ReactPlayer.addCustomPlayer=function(e){C.push(e)},ReactPlayer.removeCustomPlayers=function(){C=[]},ReactPlayer.displayName="ReactPlayer",ReactPlayer.propTypes=k.propTypes,ReactPlayer.defaultProps=k.defaultProps,ReactPlayer.canPlay=function(e){for(var t=[].concat(o(C),o(E.default)),n=0;n<t.length;n++){if(t[n].canPlay(e))return!0}return!1},ReactPlayer.canEnablePIP=function(e){for(var t=[].concat(o(C),o(E.default)),n=0;n<t.length;n++){var r=t[n];if(r.canEnablePIP&&r.canEnablePIP(e))return!0}return!1},t.default=ReactPlayer},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":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,n){return e.concat(t).map(function(e){return l(e,n)})}function s(e,t,n){var r={};return f(e)&&Object.keys(e).forEach(function(t){r[t]=l(e[t],n)}),Object.keys(t).forEach(function(o){f(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 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 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"==typeof Symbol&&Symbol.iterator;e.exports=n(19)()},function(e,t,n){"use strict";var r=n(20),o=n(21),a=n(22);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],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=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";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(6),a=n(7),i=n(9),l=n(10),u=n(11),s=n(12),c=n(8),p=n(13),f=n(14);t.default=[r.YouTube,o.SoundCloud,a.Vimeo,i.Facebook,l.Streamable,u.Wistia,s.Twitch,c.DailyMotion,p.Mixcloud,f.FilePlayer],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=y[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,muted:!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(5),u=r(l),s=n(4),c=n(6),p=n(7),f=n(8),y=[{Player:s.YouTube,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:c.SoundCloud,configKey:"soundcloud",url:"https://soundcloud.com/seucheu/john-cage-433-8-bit-version"},{Player:p.Vimeo,configKey:"vimeo",url:"https://vimeo.com/300970506"},{Player:f.DailyMotion,configKey:"dailymotion",url:"http://www.dailymotion.com/video/xqdpyk"}];e.exports=t.default}]); | ||
//# sourceMappingURL=ReactPlayer.js.map |
@@ -12,2 +12,3 @@ import * as React from 'react'; | ||
srcLang: string; | ||
label: string; | ||
default?: boolean; | ||
@@ -55,2 +56,4 @@ } | ||
hlsOptions?: Object; | ||
hlsVersion?: string; | ||
dashVersion?: string; | ||
} | ||
@@ -82,2 +85,3 @@ | ||
playsinline?: boolean; | ||
pip?: boolean; | ||
wrapper?: any; | ||
@@ -98,2 +102,4 @@ config?: Config; | ||
onEnded?(): void; | ||
onEnablePIP?(): void; | ||
onDisablePIP?(): void; | ||
onError?(error: any): void; | ||
@@ -108,2 +114,5 @@ onDuration?(duration: number): void; | ||
static canPlay(url: string): boolean; | ||
static canEnablePIP(url: string): boolean; | ||
static addCustomPlayer(player: ReactPlayer): void; | ||
static removeCustomPlayers(): void; | ||
seekTo(fraction: number): void; | ||
@@ -110,0 +119,0 @@ getCurrentTime(): number; |
@@ -127,4 +127,4 @@ 'use strict'; | ||
_this.isPlaying = false; | ||
onEnded(); | ||
} | ||
onEnded(); | ||
}, _this.onDurationCheck = function () { | ||
@@ -169,2 +169,5 @@ clearTimeout(_this.durationCheckTimeout); | ||
} | ||
if (this.player.disablePIP) { | ||
this.player.disablePIP(); | ||
} | ||
this.mounted = false; | ||
@@ -183,3 +186,4 @@ } | ||
muted = _props.muted, | ||
playbackRate = _props.playbackRate; | ||
playbackRate = _props.playbackRate, | ||
pip = _props.pip; | ||
@@ -203,2 +207,7 @@ if (!(0, _utils.isEqual)(url, nextProps.url)) { | ||
} | ||
if (!pip && nextProps.pip && this.player.enablePIP) { | ||
this.player.enablePIP(); | ||
} else if (pip && !nextProps.pip && this.player.disablePIP) { | ||
this.player.disablePIP(); | ||
} | ||
if (volume !== nextProps.volume && nextProps.volume !== null) { | ||
@@ -205,0 +214,0 @@ this.player.setVolume(nextProps.volume); |
@@ -34,6 +34,6 @@ 'use strict'; | ||
var HLS_EXTENSIONS = /\.(m3u8)($|\?)/i; | ||
var HLS_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/hls.js/0.9.1/hls.min.js'; | ||
var HLS_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/hls.js/VERSION/hls.min.js'; | ||
var HLS_GLOBAL = 'Hls'; | ||
var DASH_EXTENSIONS = /\.(mpd)($|\?)/i; | ||
var DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.6.5/dash.all.min.js'; | ||
var DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js'; | ||
var DASH_GLOBAL = 'dashjs'; | ||
@@ -82,2 +82,6 @@ var MATCH_DROPBOX_URL = /www\.dropbox\.com\/.+/; | ||
function canEnablePIP(url) { | ||
return canPlay(url) && !!document.pictureInPictureEnabled && !AUDIO_EXTENSIONS.test(url); | ||
} | ||
var FilePlayer = exports.FilePlayer = function (_Component) { | ||
@@ -97,3 +101,12 @@ _inherits(FilePlayer, _Component); | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FilePlayer.__proto__ || Object.getPrototypeOf(FilePlayer)).call.apply(_ref, [this].concat(args))), _this), _this.onSeek = function (e) { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FilePlayer.__proto__ || Object.getPrototypeOf(FilePlayer)).call.apply(_ref, [this].concat(args))), _this), _this.onDisablePIP = function (e) { | ||
var _this$props = _this.props, | ||
onDisablePIP = _this$props.onDisablePIP, | ||
playing = _this$props.playing; | ||
onDisablePIP(e); | ||
if (playing) { | ||
_this.play(); | ||
} | ||
}, _this.onSeek = function (e) { | ||
_this.props.onSeek(e.target.currentTime); | ||
@@ -152,3 +165,4 @@ }, _this.mute = function () { | ||
onError = _props.onError, | ||
playsinline = _props.playsinline; | ||
playsinline = _props.playsinline, | ||
onEnablePIP = _props.onEnablePIP; | ||
@@ -161,2 +175,4 @@ this.player.addEventListener('canplay', onReady); | ||
this.player.addEventListener('error', onError); | ||
this.player.addEventListener('enterpictureinpicture', onEnablePIP); | ||
this.player.addEventListener('leavepictureinpicture', this.onDisablePIP); | ||
if (playsinline) { | ||
@@ -175,3 +191,4 @@ this.player.setAttribute('playsinline', ''); | ||
onEnded = _props2.onEnded, | ||
onError = _props2.onError; | ||
onError = _props2.onError, | ||
onEnablePIP = _props2.onEnablePIP; | ||
@@ -184,2 +201,4 @@ this.player.removeEventListener('canplay', onReady); | ||
this.player.removeEventListener('error', onError); | ||
this.player.removeEventListener('enterpictureinpicture', onEnablePIP); | ||
this.player.removeEventListener('leavepictureinpicture', this.onDisablePIP); | ||
} | ||
@@ -212,4 +231,8 @@ }, { | ||
var _props$config$file = this.props.config.file, | ||
hlsVersion = _props$config$file.hlsVersion, | ||
dashVersion = _props$config$file.dashVersion; | ||
if (this.shouldUseHLS(url)) { | ||
(0, _utils.getSDK)(HLS_SDK_URL, HLS_GLOBAL).then(function (Hls) { | ||
(0, _utils.getSDK)(HLS_SDK_URL.replace('VERSION', hlsVersion), HLS_GLOBAL).then(function (Hls) { | ||
_this2.hls = new Hls(_this2.props.config.file.hlsOptions); | ||
@@ -224,3 +247,3 @@ _this2.hls.on(Hls.Events.ERROR, function (e, data) { | ||
if (this.shouldUseDASH(url)) { | ||
(0, _utils.getSDK)(DASH_SDK_URL, DASH_GLOBAL).then(function (dashjs) { | ||
(0, _utils.getSDK)(DASH_SDK_URL.replace('VERSION', dashVersion), DASH_GLOBAL).then(function (dashjs) { | ||
_this2.dash = dashjs.MediaPlayer().create(); | ||
@@ -281,2 +304,16 @@ _this2.dash.initialize(_this2.player, url, _this2.props.playing); | ||
}, { | ||
key: 'enablePIP', | ||
value: function enablePIP() { | ||
if (this.player.requestPictureInPicture && document.pictureInPictureElement !== this.player) { | ||
this.player.requestPictureInPicture(); | ||
} | ||
} | ||
}, { | ||
key: 'disablePIP', | ||
value: function disablePIP() { | ||
if (document.exitPictureInPicture && document.pictureInPictureElement === this.player) { | ||
document.exitPictureInPicture(); | ||
} | ||
} | ||
}, { | ||
key: 'setPlaybackRate', | ||
@@ -290,3 +327,12 @@ value: function setPlaybackRate(rate) { | ||
if (!this.player) return null; | ||
return this.player.duration; | ||
var _player = this.player, | ||
duration = _player.duration, | ||
seekable = _player.seekable; | ||
// on iOS, live streams return Infinity for the duration | ||
// so instead we use the end of the seekable timerange | ||
if (duration === Infinity && seekable.length > 0) { | ||
return seekable.end(seekable.length - 1); | ||
} | ||
return duration; | ||
} | ||
@@ -370,2 +416,3 @@ }, { | ||
FilePlayer.canPlay = canPlay; | ||
FilePlayer.canEnablePIP = canEnablePIP; | ||
exports['default'] = (0, _singlePlayer2['default'])(FilePlayer); |
@@ -89,3 +89,3 @@ 'use strict'; | ||
READY = _Twitch$Player.READY, | ||
PLAY = _Twitch$Player.PLAY, | ||
PLAYING = _Twitch$Player.PLAYING, | ||
PAUSE = _Twitch$Player.PAUSE, | ||
@@ -95,3 +95,3 @@ ENDED = _Twitch$Player.ENDED; | ||
_this2.player.addEventListener(READY, _this2.props.onReady); | ||
_this2.player.addEventListener(PLAY, _this2.props.onPlay); | ||
_this2.player.addEventListener(PLAYING, _this2.props.onPlay); | ||
_this2.player.addEventListener(PAUSE, _this2.props.onPause); | ||
@@ -98,0 +98,0 @@ _this2.player.addEventListener(ENDED, _this2.props.onEnded); |
@@ -81,7 +81,8 @@ 'use strict'; | ||
_this2.props.onReady(); | ||
_this2.player.getDuration().then(function (duration) { | ||
_this2.duration = duration; | ||
}); | ||
_this2.refreshDuration(); | ||
}); | ||
_this2.player.on('play', _this2.props.onPlay); | ||
_this2.player.on('play', function () { | ||
_this2.props.onPlay(); | ||
_this2.refreshDuration(); | ||
}); | ||
_this2.player.on('pause', _this2.props.onPause); | ||
@@ -106,2 +107,11 @@ _this2.player.on('seeked', function (e) { | ||
}, { | ||
key: 'refreshDuration', | ||
value: function refreshDuration() { | ||
var _this3 = this; | ||
this.player.getDuration().then(function (duration) { | ||
_this3.duration = duration; | ||
}); | ||
} | ||
}, { | ||
key: 'play', | ||
@@ -108,0 +118,0 @@ value: function play() { |
@@ -37,3 +37,3 @@ 'use strict'; | ||
configKey: 'vimeo', | ||
url: 'https://vimeo.com/127250231' | ||
url: 'https://vimeo.com/300970506' | ||
}, { | ||
@@ -40,0 +40,0 @@ Player: _DailyMotion.DailyMotion, |
@@ -35,2 +35,3 @@ 'use strict'; | ||
playsinline: bool, | ||
pip: bool, | ||
wrapper: oneOfType([string, func]), | ||
@@ -63,3 +64,5 @@ config: shape({ | ||
forceDASH: bool, | ||
hlsOptions: object | ||
hlsOptions: object, | ||
hlsVersion: string, | ||
dashVersion: string | ||
}), | ||
@@ -85,3 +88,5 @@ wistia: shape({ | ||
onSeek: func, | ||
onProgress: func | ||
onProgress: func, | ||
onEnablePIP: func, | ||
onDisablePIP: func | ||
}; | ||
@@ -101,2 +106,3 @@ | ||
playsinline: false, | ||
pip: false, | ||
wrapper: 'div', | ||
@@ -151,3 +157,5 @@ config: { | ||
forceDASH: false, | ||
hlsOptions: {} | ||
hlsOptions: {}, | ||
hlsVersion: '0.10.1', | ||
dashVersion: '2.9.2' | ||
}, | ||
@@ -175,5 +183,7 @@ wistia: { | ||
onSeek: function onSeek() {}, | ||
onProgress: function onProgress() {} | ||
onProgress: function onProgress() {}, | ||
onEnablePIP: function onEnablePIP() {}, | ||
onDisablePIP: function onDisablePIP() {} | ||
}; | ||
var DEPRECATED_CONFIG_PROPS = exports.DEPRECATED_CONFIG_PROPS = ['soundcloudConfig', 'youtubeConfig', 'facebookConfig', 'dailymotionConfig', 'vimeoConfig', 'fileConfig', 'wistiaConfig']; |
@@ -6,2 +6,3 @@ 'use strict'; | ||
}); | ||
exports.FilePlayer = exports.Mixcloud = exports.DailyMotion = exports.Twitch = exports.Wistia = exports.Streamable = exports.Facebook = exports.Vimeo = exports.SoundCloud = exports.YouTube = undefined; | ||
@@ -12,2 +13,92 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _YouTube = require('./players/YouTube'); | ||
Object.defineProperty(exports, 'YouTube', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_YouTube)['default']; | ||
} | ||
}); | ||
var _SoundCloud = require('./players/SoundCloud'); | ||
Object.defineProperty(exports, 'SoundCloud', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_SoundCloud)['default']; | ||
} | ||
}); | ||
var _Vimeo = require('./players/Vimeo'); | ||
Object.defineProperty(exports, 'Vimeo', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_Vimeo)['default']; | ||
} | ||
}); | ||
var _Facebook = require('./players/Facebook'); | ||
Object.defineProperty(exports, 'Facebook', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_Facebook)['default']; | ||
} | ||
}); | ||
var _Streamable = require('./players/Streamable'); | ||
Object.defineProperty(exports, 'Streamable', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_Streamable)['default']; | ||
} | ||
}); | ||
var _Wistia = require('./players/Wistia'); | ||
Object.defineProperty(exports, 'Wistia', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_Wistia)['default']; | ||
} | ||
}); | ||
var _Twitch = require('./players/Twitch'); | ||
Object.defineProperty(exports, 'Twitch', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_Twitch)['default']; | ||
} | ||
}); | ||
var _DailyMotion = require('./players/DailyMotion'); | ||
Object.defineProperty(exports, 'DailyMotion', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_DailyMotion)['default']; | ||
} | ||
}); | ||
var _Mixcloud = require('./players/Mixcloud'); | ||
Object.defineProperty(exports, 'Mixcloud', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_Mixcloud)['default']; | ||
} | ||
}); | ||
var _FilePlayer = require('./players/FilePlayer'); | ||
Object.defineProperty(exports, 'FilePlayer', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_FilePlayer)['default']; | ||
} | ||
}); | ||
var _react = require('react'); | ||
@@ -25,8 +116,6 @@ | ||
var _Player3 = require('./Player'); | ||
var _Player4 = require('./Player'); | ||
var _Player4 = _interopRequireDefault(_Player3); | ||
var _Player5 = _interopRequireDefault(_Player4); | ||
var _FilePlayer = require('./players/FilePlayer'); | ||
var _preload = require('./preload'); | ||
@@ -127,3 +216,3 @@ | ||
var activePlayer = this.getActivePlayer(url); | ||
return _react2['default'].createElement(_Player4['default'], _extends({}, this.props, { | ||
return _react2['default'].createElement(_Player5['default'], _extends({}, this.props, { | ||
key: activePlayer.displayName, | ||
@@ -194,2 +283,14 @@ ref: this.activePlayerRef, | ||
ReactPlayer.canEnablePIP = function (url) { | ||
var _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players2['default'])); | ||
for (var _i3 = 0; _i3 < _arr3.length; _i3++) { | ||
var _Player3 = _arr3[_i3]; | ||
if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
exports['default'] = ReactPlayer; |
@@ -87,3 +87,10 @@ 'use strict'; | ||
value: function render() { | ||
if (!activePlayer.canPlay(this.props.url)) { | ||
var _config$file = this.config.file, | ||
forceVideo = _config$file.forceVideo, | ||
forceAudio = _config$file.forceAudio, | ||
forceHLS = _config$file.forceHLS, | ||
forceDASH = _config$file.forceDASH; | ||
var skipCanPlay = forceVideo || forceAudio || forceHLS || forceDASH; | ||
if (!activePlayer.canPlay(this.props.url) && !skipCanPlay) { | ||
return null; | ||
@@ -90,0 +97,0 @@ } |
{ | ||
"name": "react-player", | ||
"version": "1.6.6", | ||
"version": "1.7.0", | ||
"description": "A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion", | ||
@@ -5,0 +5,0 @@ "main": "lib/ReactPlayer.js", |
@@ -77,2 +77,3 @@ <h1 align='center'> | ||
`playsinline` | Applies the `playsinline` attribute where supported | `false` | ||
`pip` | Set to `true` or `false` to enable or disable [picture-in-picture mode](https://developers.google.com/web/updates/2018/10/watch-video-using-picture-in-picture) | `false` | ||
`wrapper` | Element or component to use as the container element | `div` | ||
@@ -95,4 +96,6 @@ `config` | Override options for the various players, see [config prop](#config-prop) | ||
`onSeek` | Called when media seeks with `seconds` parameter | ||
`onEnded` | Called when media finishes playing | ||
`onEnded` | Called when media finishes playing<br /> ◦ Does not fire when `loop` is set to `true` | ||
`onError` | Called when an error occurs whilst attempting to play media | ||
`onEnablePIP` | Called when picture-in-picture mode is enabled | ||
`onDisablePIP` | Called when picture-in-picture mode is disabled | ||
@@ -139,3 +142,3 @@ #### Config prop | ||
`twitch` | `options`: Override the [default player options](https://dev.twitch.tv/docs/embed) | ||
`file` | `attributes`: Apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes)<br />`forceVideo`: Always render a `<video>` element<br />`forceAudio`: Always render an `<audio>` element<br />`forceHLS`: Use [hls.js](https://github.com/video-dev/hls.js) for HLS streams<br />`forceDASH`: Always use [dash.js](https://github.com/Dash-Industry-Forum/dash.js) for DASH streams<br />`hlsOptions`: Override the [default `hls.js` options](https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning) | ||
`file` | `attributes`: Apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes)<br />`forceVideo`: Always render a `<video>` element<br />`forceAudio`: Always render an `<audio>` element<br />`forceHLS`: Use [hls.js](https://github.com/video-dev/hls.js) for HLS streams<br />`forceDASH`: Always use [dash.js](https://github.com/Dash-Industry-Forum/dash.js) for DASH streams<br />`hlsOptions`: Override the [default `hls.js` options](https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning)<br />`hlsVersion`: Override the [`hls.js`](https://github.com/video-dev/hls.js) version loaded from [`cdnjs`](https://cdnjs.com/libraries/hls.js), default: `0.10.1`<br />`dashVersion`: Override the [`dash.js`](https://github.com/Dash-Industry-Forum/dash.js) version loaded from [`cdnjs`](https://cdnjs.com/libraries/dashjs), default: `2.9.2` | ||
@@ -153,2 +156,3 @@ ##### Preloading | ||
`ReactPlayer.canPlay(url)` | Determine if a URL can be played. This does *not* detect media that is unplayable due to privacy settings, streaming permissions, etc. In that case, the `onError` prop will be invoked after attemping to play. Any URL that does not match any patterns will fall back to a native HTML5 media player. | ||
`ReactPlayer.canEnablePiP(url)` | Determine if a URL can be played in [picture-in-picture mode](https://developers.google.com/web/updates/2018/10/watch-video-using-picture-in-picture) | ||
`ReactPlayer.addCustomPlayer(CustomPlayer)` | Add a custom player. See [Adding custom players](#adding-custom-players) | ||
@@ -155,0 +159,0 @@ `ReactPlayer.removeCustomPlayers()` | Remove any players that have been added using `addCustomPlayer()` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1971569
3894
344
37