react-player
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "react-player", | ||
"description": "A react component for playing a variety of URLs, including file paths, YouTube, SoundCloud, Streamable, Vimeo and Wistia", | ||
"description": "A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion", | ||
"main": "dist/ReactPlayer.js", | ||
@@ -16,2 +16,4 @@ "authors": [ | ||
"youtube", | ||
"facebook", | ||
"twitch", | ||
"soundcloud", | ||
@@ -21,2 +23,5 @@ "streamable", | ||
"wistia", | ||
"dailymotion", | ||
"hls", | ||
"dash", | ||
"react-component" | ||
@@ -34,3 +39,3 @@ ], | ||
"!README.md", | ||
"!LICENSE" | ||
"!LICENSE.md" | ||
], | ||
@@ -37,0 +42,0 @@ "dependencies": { |
@@ -6,2 +6,8 @@ ### Changelog | ||
#### [v1.1.0](https://github.com/CookPete/react-player/compare/v1.0.0...v1.1.0) | ||
> 18 January 2018 | ||
- Tidy up readme [`5befbfa`](https://github.com/CookPete/react-player/commit/5befbfab44313a48d7770cf00f3cda200ebc3bbb) | ||
- Add standalone player [`4ffd201`](https://github.com/CookPete/react-player/commit/4ffd20112f18c2c7b3c25e39c283f8cfe9be88fc) | ||
- Use px values for default width and height [`b430ad6`](https://github.com/CookPete/react-player/commit/b430ad63c2f42a22322aefa7784e120120543236) | ||
#### [v1.0.0](https://github.com/CookPete/react-player/compare/v1.0.0-beta.7...v1.0.0) | ||
@@ -8,0 +14,0 @@ > 17 January 2018 |
@@ -5,2 +5,12 @@ # Contributing to ReactPlayer | ||
Running the demo locally is relatively easy: | ||
```bash | ||
git clone https://github.com/CookPete/react-player.git | ||
cd react-player | ||
npm install # or yarn | ||
npm start | ||
open http://localhost:3000 | ||
``` | ||
## `dist` files | ||
@@ -7,0 +17,0 @@ |
@@ -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=9)}([function(e,t){e.exports=React},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=e.match(k);if(t){var n=t[1];if(n.match(w))return i(n);if(_.test(n))return parseInt(n,10)}return 0}function i(e){for(var t=0,n=w.exec(e);null!==n;){var r=n,o=h(r,3),a=o[1],i=o[2];"h"===i&&(t+=60*parseInt(a,10)*60),"m"===i&&(t+=60*parseInt(a,10)),"s"===i&&(t+=parseInt(a,10)),n=w.exec(e)}return t}function l(){return Math.random().toString(36).substr(2,5)}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise(function(r,o){if(n){var a=window[n];window[n]=function(){a&&a(),r(window[t])}}(0,m.default)(e,function(e){e&&o(e),n||r(window[t])})})}function s(e,t,n){var r=(0,g.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=P.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=u.value;if(e[c]){var f=c.replace(/Config$/,"");if(r=(0,g.default)(r,o({},f,e[c])),n){var p="ReactPlayer: %c"+c+" %cis deprecated, please use the config prop instead – https://github.com/CookPete/react-player#config-prop";console.warn(p,"font-weight: bold","")}}}}catch(e){i=!0,l=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw l}}return r}function c(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a=(t=[]).concat.apply(t,r),i={},l=Object.keys(e),u=!0,s=!1,c=void 0;try{for(var f,p=l[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var y=f.value;-1===a.indexOf(y)&&(i[y]=e[y])}}catch(e){s=!0,c=e}finally{try{!u&&p.return&&p.return()}finally{if(s)throw c}}return i}function f(e){var t;if(!this.player||!this.player[e]){var n="ReactPlayer: "+this.constructor.displayName+" player could not call %c"+e+"%c – ";return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return(t=this.player)[e].apply(t,o)}function p(e){return null!==e&&"object"===(void 0===e?"undefined":d(e))}function y(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(!y(e[n],t[n]))return!1;return!0}if(p(e)&&p(t)){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(!y(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}Object.defineProperty(t,"__esModule",{value:!0});var d="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},h=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.parseStartTime=a,t.randomString=l,t.getSDK=u,t.getConfig=s,t.omit=c,t.callPlayer=f,t.isObject=p,t.isEqual=y;var v=n(15),m=r(v),b=n(16),g=r(b),P=n(2),k=/[?&#](?:start|t)=([0-9hms]+)/,w=/(\d+)(h|m|s)/g,_=/^\d+$/},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEPRECATED_CONFIG_PROPS=t.defaultProps=t.propTypes=void 0;var r=n(10),o=function(e){return e&&e.__esModule?e:{default:e}}(r),a=o.default.string,i=o.default.bool,l=o.default.number,u=o.default.array,s=o.default.oneOfType,c=o.default.shape,f=o.default.object,p=o.default.func;t.propTypes={url:s([a,u]),playing:i,loop:i,controls:i,volume:l,muted:i,playbackRate:l,width:s([a,l]),height:s([a,l]),style:f,progressFrequency:l,playsinline:i,config:c({soundcloud:c({options:f}),youtube:c({playerVars:f,preload:i}),facebook:c({appId:a}),dailymotion:c({params:f,preload:i}),vimeo:c({iframeParams:f,preload:i}),file:c({attributes:f,tracks:u,forceAudio:i,forceHLS:i,forceDASH:i}),wistia:c({options:f})}),onReady:p,onStart:p,onPlay:p,onPause:p,onBuffer:p,onEnded:p,onError:p,onDuration:p,onSeek:p,onProgress:p},t.defaultProps={playing:!1,loop:!1,controls:!1,volume:.8,muted:!1,playbackRate:1,width:640,height:360,style:{},progressFrequency:1e3,playsinline:!1,config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{autoplay:0,playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},preload:!1},facebook:{appId:"1309697205772819"},dailymotion:{params:{api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,autoplay:!1,byline:!1,portrait:!1,title:!1},preload:!1},file:{attributes:{},tracks:[],forceAudio:!1,forceHLS:!1,forceDASH:!1},wistia:{options:{}}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onSeek:function(){},onProgress:function(){}},t.DEPRECATED_CONFIG_PROPS=["soundcloudConfig","youtubeConfig","facebookConfig","dailymotionConfig","vimeoConfig","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(1),f="YT",p=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})$/,y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.onStateChange=function(e){var t=e.data,n=a.props,r=n.onPlay,o=n.onPause,i=n.onBuffer,l=n.onEnded,u=n.onReady,s=window[f].PlayerState,c=s.PLAYING,p=s.PAUSED,y=s.BUFFERING,d=s.ENDED,h=s.CUED;t===c&&r(),t===p&&o(),t===y&&i(),t===d&&l(),t===h&&u()},a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.controls,l=r.config,u=r.onError,s=e&&e.match(p)[1];if(t)return void this.player.cueVideoById({videoId:s,startSeconds:(0,c.parseStartTime)(e)});(0,c.getSDK)("https://www.youtube.com/iframe_api",f,"onYouTubeIframeAPIReady",function(e){return e.loaded}).then(function(t){n.container&&(n.player=new t.Player(n.container,{width:"100%",height:"100%",videoId:s,playerVars:i({controls:a?1:0,start:(0,c.parseStartTime)(e),origin:window.location.origin,playsinline:o},l.youtube.playerVars),events:{onReady:n.props.onReady,onStateChange:n.onStateChange,onError:function(e){return u(e.data)}}}))},u)}},{key:"play",value:function(){this.callPlayer("playVideo")}},{key:"pause",value:function(){this.callPlayer("pauseVideo")}},{key:"stop",value:function(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var e=i({width:"100%",height:"100%"},this.props.style);return s.default.createElement("div",{style:e},s.default.createElement("div",{ref:this.ref}))}}]),t}(u.Component);y.displayName="YouTube",y.canPlay=function(e){return p.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/(soundcloud.com|snd.sc)\/([a-z0-9-_]+\/[a-z0-9-_]+)$/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.duration=null,a.currentTime=null,a.fractionLoaded=null,a.ref=function(e){a.iframe=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this;(0,c.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(function(r){if(n.iframe){var o=r.Widget.Events,a=o.PLAY,l=o.PLAY_PROGRESS,u=o.PAUSE,s=o.FINISH,c=o.ERROR;t||(n.player=r.Widget(n.iframe),n.player.bind(a,n.props.onPlay),n.player.bind(u,n.props.onPause),n.player.bind(l,function(e){n.currentTime=e.currentPosition/1e3,n.fractionLoaded=e.loadedProgress}),n.player.bind(s,function(){return n.props.onEnded()}),n.player.bind(c,function(e){return n.props.onError(e)})),n.player.load(e,i({},n.props.config.soundcloud.options,{callback:function(){n.player.getDuration(function(e){n.duration=e/1e3,n.props.onReady()})}}))}})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",1e3*e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var e=i({width:"100%",height:"100%"},this.props.style);return s.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url="+encodeURIComponent(this.props.url),style:e,frameBorder:0})}}]),t}(u.Component);p.displayName="SoundCloud",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/(?:www\.|player\.)?vimeo.com\/(?:(?:channels|ondemand)\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.duration=null,a.currentTime=null,a.secondsLoaded=null,a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this,r=e.match(f)[3];if(this.duration=null,t)return void this.player.loadVideo(r).catch(this.props.onError);(0,c.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(function(t){n.container&&(n.player=new t.Player(n.container,i({},n.props.config.vimeo.playerOptions,{url:e,loop:n.props.loop})),n.player.ready().then(function(){var e=n.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"}).catch(n.props.onError),n.player.on("loaded",function(){n.props.onReady(),n.player.getDuration().then(function(e){n.duration=e})}),n.player.on("play",n.props.onPlay),n.player.on("pause",n.props.onPause),n.player.on("seeked",function(e){return n.props.onSeek(e.seconds)}),n.player.on("ended",n.props.onEnded),n.player.on("error",n.props.onError),n.player.on("timeupdate",function(e){var t=e.seconds;n.currentTime=t}),n.player.on("progress",function(e){var t=e.seconds;n.secondsLoaded=t}))},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("unload")}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=i({width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"},this.props.style);return s.default.createElement("div",{style:e,ref:this.ref})}}]),t}(u.Component);p.displayName="Vimeo",p.canPlay=function(e){return f.test(e)},t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.onDurationChange=function(){var e=a.getDuration();a.props.onDuration(e)},a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"parseId",value:function(e){var t=e.match(f);return t[4]||t[2]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.config,a=n.onError,l=n.playing,u=this.parseId(e);if(this.player)return void this.player.load(u,{start:(0,c.parseStartTime)(e),autoplay:l});(0,c.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",function(e){return e.player}).then(function(n){if(t.container){var l=n.player;t.player=new l(t.container,{width:"100%",height:"100%",video:u,params:i({controls:r,autoplay:t.props.playing,start:(0,c.parseStartTime)(e),origin:window.location.origin},o.dailymotion.params),events:{apiready:t.props.onReady,seeked:function(){return t.props.onSeek(t.player.currentTime)},video_end:t.props.onEnded,durationchange:t.onDurationChange,pause:t.props.onPause,playing:t.props.onPlay,waiting:t.props.onBuffer,error:function(e){return a(e)}}})}},a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var e=i({width:"100%",height:"100%",backgroundColor:"black"},this.props.style);return s.default.createElement("div",{style:e},s.default.createElement("div",{ref:this.ref}))}}]),t}(u.Component);p.displayName="DailyMotion",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){if(e instanceof Array){var t=!0,n=!1,r=void 0;try{for(var o,a=e[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var l=o.value;if("string"==typeof l&&i(l))return!0;if(i(l.src))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1}return p.test(e)||y.test(e)||d.test(e)||h.test(e)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=function(e){return e&&e.__esModule?e:{default:e}}(s),f=n(1),p=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,y=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,d=/\.(m3u8)($|\?)/i,h=/\.(mpd)($|\?)/i,v=function(e){function t(){var e,n,a,i;r(this,t);for(var u=arguments.length,s=Array(u),f=0;f<u;f++)s[f]=arguments[f];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),a.onSeek=function(e){a.props.onSeek(e.target.currentTime)},a.renderSource=function(e,t){if("string"==typeof e)return c.default.createElement("source",{key:t,src:e});var n=e.src,r=e.type;return c.default.createElement("source",{key:t,src:n,type:r})},a.renderTrack=function(e,t){return c.default.createElement("track",l({key:t},e))},a.ref=function(e){a.player=e},i=n,o(a,i)}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillReceiveProps",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.removeListeners()}},{key:"componentDidUpdate",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"addListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onPause,o=e.onEnded,a=e.onError,i=e.playsinline;this.player.addEventListener("canplay",t),this.player.addEventListener("play",n),this.player.addEventListener("pause",r),this.player.addEventListener("seeked",this.onSeek),this.player.addEventListener("ended",o),this.player.addEventListener("error",a),i&&(this.player.setAttribute("playsinline",""),this.player.setAttribute("webkit-playsinline",""))}},{key:"removeListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onPause,o=e.onEnded,a=e.onError;this.player.removeEventListener("canplay",t),this.player.removeEventListener("play",n),this.player.removeEventListener("pause",r),this.player.removeEventListener("seeked",this.onSeek),this.player.removeEventListener("ended",o),this.player.removeEventListener("error",a)}},{key:"shouldUseAudio",value:function(e){return p.test(e.url)||e.config.file.forceAudio}},{key:"shouldUseHLS",value:function(e){var t=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;return d.test(e)&&!t||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return h.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this;this.shouldUseHLS(e)&&(0,f.getSDK)("https://cdn.jsdelivr.net/hls.js/latest/hls.min.js","Hls").then(function(n){t.hls=new n,t.hls.loadSource(e),t.hls.attachMedia(t.player)}),this.shouldUseDASH(e)&&(0,f.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.5.0/dash.all.min.js","dashjs").then(function(n){t.dash=n.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.getDebug().setLogToBrowserConsole(!1)})}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.hls&&this.hls.destroy(),this.dash&&this.dash.reset()}},{key:"seekTo",value:function(e){this.player.currentTime=e}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){return this.player.duration}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return 0===this.player.buffered.length?0:this.player.buffered.end(0)}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.loop,r=e.controls,o=e.config,a=e.width,i=e.height,u=this.shouldUseAudio(this.props),s=this.shouldUseHLS(t),f=this.shouldUseDASH(t),p=u?"audio":"video",y=t instanceof Array||s||f?void 0:t,d={width:a&&"auto"!==a?"100%":a,height:i&&"auto"!==i?"100%":i};return c.default.createElement(p,l({ref:this.ref,src:y,style:d,preload:"auto",controls:r,loop:n},o.file.attributes),t instanceof Array&&t.map(this.renderSource),o.file.tracks.map(this.renderTrack))}}]),t}(s.Component);v.displayName="FilePlayer",v.canPlay=i,t.default=v,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(2),f=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.mounted=!1,a.isReady=!1,a.isPlaying=!1,a.isLoading=!0,a.startOnPlay=!0,a.seekOnPlay=null,a.onDurationCalled=!1,a.getInternalPlayer=function(e){return a.player?a.player[e]:null},a.onReady=function(){if(a.mounted){a.isReady=!0,a.isLoading=!1;var e=a.props,t=e.onReady,n=e.playing;t(),n&&a.player.play(),a.onDurationCheck()}},a.onPlay=function(){a.isPlaying=!0,a.isLoading=!1;var e=a.props,t=e.volume,n=e.muted,r=e.onStart,o=e.onPlay,i=e.playbackRate;a.startOnPlay&&(a.player.setPlaybackRate&&a.player.setPlaybackRate(i),r(),a.startOnPlay=!1),a.player.setVolume(n?0:t),o(),a.seekOnPlay&&(a.seekTo(a.seekOnPlay),a.seekOnPlay=null),a.onDurationCheck()},a.onPause=function(){a.isPlaying=!1,a.isLoading||a.props.onPause()},a.onEnded=function(){var e=a.props,t=e.activePlayer,n=e.loop,r=e.onEnded;t.loopOnEnded&&n&&a.seekTo(0),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.ref=function(e){e&&(a.player=e)},i=n,o(a,i)}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.mounted=!0,this.player.load(this.props.url)}},{key:"componentWillUnmount",value:function(){this.isReady&&this.player.stop(),this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.url,r=t.playing,o=t.volume,a=t.muted,i=t.playbackRate;n!==e.url&&(this.isLoading=!0,this.onDurationCalled=!1,this.player.load(e.url,this.isReady)),r||!e.playing||this.isPlaying||this.player.play(),r&&!e.playing&&this.isPlaying&&this.player.pause(),o===e.volume||e.muted||this.player.setVolume(e.volume),a!==e.muted&&this.player.setVolume(e.muted?0:e.volume),i!==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 s.default.createElement(e,i({},this.props,{ref:this.ref,onReady:this.onReady,onPlay:this.onPlay,onPause:this.onPause,onEnded:this.onEnded}))}}]),t}(u.Component);f.displayName="Player",f.propTypes=c.propTypes,f.defaultProps=c.defaultProps,t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),p=n(2),y=n(1),d=n(17),h=r(d),v=n(8),m=r(v),b=n(7),g=r(b),P=n(22),k=r(P),w=Object.keys(p.propTypes),ReactPlayer=function(e){function ReactPlayer(){var e,t,n,r;a(this,ReactPlayer);for(var o=arguments.length,l=Array(o),u=0;u<o;u++)l[u]=arguments[u];return t=n=i(this,(e=ReactPlayer.__proto__||Object.getPrototypeOf(ReactPlayer)).call.apply(e,[this].concat(l))),n.config=(0,y.getConfig)(n.props,p.defaultProps,!0),n.getDuration=function(){return n.player?n.player.getDuration():null},n.getCurrentTime=function(){return n.player?n.player.getCurrentTime():null},n.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return n.player?n.player.getInternalPlayer(e):null},n.seekTo=function(e){if(!n.player)return null;n.player.seekTo(e)},n.progress=function(){if(n.props.url&&n.player&&n.player.isReady){var e=n.player.getCurrentTime()||0,t=n.player.getSecondsLoaded(),r=n.player.getDuration();if(r){var o={playedSeconds:e,played:e/r};null!==t&&(o.loadedSeconds=t,o.loaded=t/r),o.played===n.prevPlayed&&o.loaded===n.prevLoaded||n.props.onProgress(o),n.prevPlayed=o.played,n.prevLoaded=o.loaded}}n.progressTimeout=setTimeout(n.progress,n.props.progressFrequency)},n.wrapperRef=function(e){n.wrapper=e},n.activePlayerRef=function(e){n.player=e},r=t,i(n,r)}return l(ReactPlayer,e),s(ReactPlayer,[{key:"componentDidMount",value:function(){this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout)}},{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"getActivePlayer",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=h.default[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var i=o.value;if(i.canPlay(e))return i}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return g.default}},{key:"renderActivePlayer",value:function(e){if(!e)return null;var t=this.getActivePlayer(e);return f.default.createElement(m.default,u({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t}))}},{key:"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=(0,y.omit)(this.props,w,p.DEPRECATED_CONFIG_PROPS),l=this.renderActivePlayer(t),s=(0,k.default)(t,this.config),c=[l].concat(o(s)).sort(this.sortPlayers);return f.default.createElement("div",u({ref:this.wrapperRef,style:u({},n,{width:r,height:a})},i),c)}}]),ReactPlayer}(c.Component);ReactPlayer.displayName="ReactPlayer",ReactPlayer.propTypes=p.propTypes,ReactPlayer.defaultProps=p.defaultProps,ReactPlayer.canPlay=function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=h.default[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){if(o.value.canPlay(e))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1},t.default=ReactPlayer,e.exports=t.default},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=n(11)()},function(e,t,n){"use strict";var r=n(12),o=n(13),a=n(14);e.exports=function(){function e(e,t,n,r,i,l){l!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,a,i,l,u){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,i,l,u],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function r(e,t){for(var n in t)e.setAttribute(n,t[n])}function o(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function a(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,t,n){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("script");"function"==typeof t&&(n=t,t={}),t=t||{},n=n||function(){},l.type=t.type||"text/javascript",l.charset=t.charset||"utf8",l.async=!("async"in t)||!!t.async,l.src=e,t.attrs&&r(l,t.attrs),t.text&&(l.text=""+t.text),("onload"in l?o:a)(l,n),l.onload||o(l,n),i.appendChild(l)}},function(e,t,n){"use strict";function r(e){return!!e&&"object"===(void 0===e?"undefined":f(e))}function o(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||a(e)}function a(e){return e.$$typeof===d}function i(e){return Array.isArray(e)?[]:{}}function l(e,t){return t&&!1===t.clone||!p(e)?e:c(i(e),e,t)}function u(e,t,n){return e.concat(t).map(function(e){return l(e,n)})}function s(e,t,n){var r={};return p(e)&&Object.keys(e).forEach(function(t){r[t]=l(e[t],n)}),Object.keys(t).forEach(function(o){p(t[o])&&e[o]?r[o]=c(e[o],t[o],n):r[o]=l(t[o],n)}),r}function c(e,t,n){var r=Array.isArray(t),o=Array.isArray(e),a=n||{arrayMerge:u};if(r===o)return r?(a.arrayMerge||u)(e,t,n):s(e,t,n);return l(t,n)}Object.defineProperty(t,"__esModule",{value:!0});var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=function(e){return r(e)&&!o(e)},y="function"==typeof Symbol&&Symbol.for,d=y?Symbol.for("react.element"):60103;c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return c(e,n,t)},{})};var h=c;t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),a=r(o),i=n(4),l=r(i),u=n(5),s=r(u),c=n(18),f=r(c),p=n(19),y=r(p),d=n(20),h=r(d),v=n(21),m=r(v),b=n(6),g=r(b),P=n(7),k=r(P);t.default=[a.default,l.default,s.default,f.default,y.default,h.default,m.default,g.default,k.default],e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c="//connect.facebook.net/en_US/sdk.js",f=/facebook\.com\/([^\/?].+\/)?video(s|\.php)[\/?].*$/,p="facebook-player-",y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.playerID=p+(0,s.randomString)(),i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e,t){var n=this;if(t)return void(0,s.getSDK)(c,"FB","fbAsyncInit").then(function(e){return e.XFBML.parse()});(0,s.getSDK)(c,"FB","fbAsyncInit").then(function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:"v2.5"}),e.Event.subscribe("xfbml.ready",function(e){"video"===e.type&&e.id===n.playerID&&(n.player=e.instance,n.player.subscribe("startedPlaying",n.props.onPlay),n.player.subscribe("paused",n.props.onPause),n.player.subscribe("finishedPlaying",n.props.onEnded),n.player.subscribe("startedBuffering",n.props.onBuffer),n.player.subscribe("error",n.props.onError),n.props.onReady())})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){0!==e&&this.callPlayer("unmute"),this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%",backgroundColor:"black"};return u.default.createElement("div",{style:e,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-allowfullscreen":"true","data-controls":this.props.controls?void 0:"false"})}}]),t}(l.Component);y.displayName="Facebook",y.canPlay=function(e){return f.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c=/streamable.com\/([a-z0-9]+)$/,f=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.duration=null,a.currentTime=null,a.secondsLoaded=null,a.ref=function(e){a.iframe=e},i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e){var t=this;(0,s.getSDK)("//cdn.embed.ly/player-0.0.12.min.js","playerjs").then(function(e){t.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)}))},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=this.props.url.match(c)[1],t={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/"+e,frameBorder:"0",scrolling:"no",style:t,allowFullScreen:!0})}}]),t}(l.Component);f.displayName="Streamable",f.canPlay=function(e){return c.test(e)},t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/(?:wistia.com|wi.st)\/(?:medias|embed)\/(.*)$/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,i=n,o(a,i)}return a(t,e),l(t,[{key:"getID",value:function(e){return e&&e.match(f)[1]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.onReady,a=n.onPlay,l=n.onPause,u=n.onSeek,s=n.onEnded,f=n.config;(0,c.getSDK)("//fast.wistia.com/assets/external/E-v1.js","Wistia").then(function(){window._wq=window._wq||[],window._wq.push({id:t.getID(e),options:i({controlsVisibleOnLoad:r},f.wistia.options),onReady:function(e){t.player=e,t.player.bind("play",a),t.player.bind("pause",l),t.player.bind("seek",u),t.player.bind("end",s),o()}})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("remove")}},{key:"seekTo",value:function(e){this.callPlayer("time",e)}},{key:"setVolume",value:function(e){this.callPlayer("volume",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("playbackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.getID(this.props.url),t="wistia_embed wistia_async_"+e,n={width:"100%",height:"100%"};return s.default.createElement("div",{key:e,className:t,style:n})}}]),t}(u.Component);p.displayName="Wistia",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,f=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,p="twitch-player-",y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.playerID=p+(0,s.randomString)(),i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,i=f.test(e),l=i?e.match(f)[1]:e.match(c)[1];if(t)return void(i?this.player.setChannel(l):this.player.setVideo("v"+l));(0,s.getSDK)("//player.twitch.tv/js/embed/v1.js","Twitch").then(function(e){n.player=new e.Player(n.playerID,{video:i?"":l,channel:i?l:"",height:"100%",width:"100%",playsinline:o,autoplay:n.props.playing});var t=e.Player,r=t.READY,a=t.PLAY,u=t.PAUSE,s=t.ENDED;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(a,n.props.onPlay),n.player.addEventListener(u,n.props.onPause),n.player.addEventListener(s,n.props.onEnded)},a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("pause")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return u.default.createElement("div",{style:e,id:this.playerID})}}]),t}(l.Component);y.displayName="Twitch",y.canPlay=function(e){return c.test(e)||f.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var l,s=m[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var c=l.value;!c.Player.canPlay(e)&&t[c.configKey].preload&&n.push(i.default.createElement(u.default,{key:c.Player.displayName,activePlayer:c.Player,url:c.url,playing:!0,style:{display:"none"}}))}}catch(e){o=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw a}}return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=n(0),i=r(a),l=n(8),u=r(l),s=n(3),c=r(s),f=n(4),p=r(f),y=n(5),d=r(y),h=n(6),v=r(h),m=[{Player:c.default,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:p.default,configKey:"soundcloud",url:"https://soundcloud.com/seucheu/john-cage-433-8-bit-version"},{Player:d.default,configKey:"vimeo",url:"https://vimeo.com/127250231"},{Player:v.default,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=9)}([function(e,t){e.exports=React},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=e.match(k);if(t){var n=t[1];if(n.match(w))return i(n);if(_.test(n))return parseInt(n,10)}return 0}function i(e){for(var t=0,n=w.exec(e);null!==n;){var r=n,o=h(r,3),a=o[1],i=o[2];"h"===i&&(t+=60*parseInt(a,10)*60),"m"===i&&(t+=60*parseInt(a,10)),"s"===i&&(t+=parseInt(a,10)),n=w.exec(e)}return t}function l(){return Math.random().toString(36).substr(2,5)}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise(function(r,o){if(n){var a=window[n];window[n]=function(){a&&a(),r(window[t])}}(0,m.default)(e,function(e){e&&o(e),n||r(window[t])})})}function s(e,t,n){var r=(0,g.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=P.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=u.value;if(e[c]){var f=c.replace(/Config$/,"");if(r=(0,g.default)(r,o({},f,e[c])),n){var p="ReactPlayer: %c"+c+" %cis deprecated, please use the config prop instead – https://github.com/CookPete/react-player#config-prop";console.warn(p,"font-weight: bold","")}}}}catch(e){i=!0,l=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw l}}return r}function c(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a=(t=[]).concat.apply(t,r),i={},l=Object.keys(e),u=!0,s=!1,c=void 0;try{for(var f,p=l[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var y=f.value;-1===a.indexOf(y)&&(i[y]=e[y])}}catch(e){s=!0,c=e}finally{try{!u&&p.return&&p.return()}finally{if(s)throw c}}return i}function f(e){var t;if(!this.player||!this.player[e]){var n="ReactPlayer: "+this.constructor.displayName+" player could not call %c"+e+"%c – ";return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return(t=this.player)[e].apply(t,o)}function p(e){return null!==e&&"object"===(void 0===e?"undefined":d(e))}function y(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(!y(e[n],t[n]))return!1;return!0}if(p(e)&&p(t)){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(!y(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}Object.defineProperty(t,"__esModule",{value:!0});var d="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},h=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.parseStartTime=a,t.randomString=l,t.getSDK=u,t.getConfig=s,t.omit=c,t.callPlayer=f,t.isObject=p,t.isEqual=y;var v=n(15),m=r(v),b=n(16),g=r(b),P=n(2),k=/[?&#](?:start|t)=([0-9hms]+)/,w=/(\d+)(h|m|s)/g,_=/^\d+$/},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEPRECATED_CONFIG_PROPS=t.defaultProps=t.propTypes=void 0;var r=n(10),o=function(e){return e&&e.__esModule?e:{default:e}}(r),a=o.default.string,i=o.default.bool,l=o.default.number,u=o.default.array,s=o.default.oneOfType,c=o.default.shape,f=o.default.object,p=o.default.func;t.propTypes={url:s([a,u]),playing:i,loop:i,controls:i,volume:l,muted:i,playbackRate:l,width:s([a,l]),height:s([a,l]),style:f,progressFrequency:l,playsinline:i,config:c({soundcloud:c({options:f}),youtube:c({playerVars:f,preload:i}),facebook:c({appId:a}),dailymotion:c({params:f,preload:i}),vimeo:c({iframeParams:f,preload:i}),file:c({attributes:f,tracks:u,forceAudio:i,forceHLS:i,forceDASH:i}),wistia:c({options:f})}),onReady:p,onStart:p,onPlay:p,onPause:p,onBuffer:p,onEnded:p,onError:p,onDuration:p,onSeek:p,onProgress:p},t.defaultProps={playing:!1,loop:!1,controls:!1,volume:.8,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressFrequency:1e3,playsinline:!1,config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{autoplay:0,playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},preload:!1},facebook:{appId:"1309697205772819"},dailymotion:{params:{api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,autoplay:!1,byline:!1,portrait:!1,title:!1},preload:!1},file:{attributes:{},tracks:[],forceAudio:!1,forceHLS:!1,forceDASH:!1},wistia:{options:{}}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onSeek:function(){},onProgress:function(){}},t.DEPRECATED_CONFIG_PROPS=["soundcloudConfig","youtubeConfig","facebookConfig","dailymotionConfig","vimeoConfig","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(1),f="YT",p=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})$/,y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.onStateChange=function(e){var t=e.data,n=a.props,r=n.onPlay,o=n.onPause,i=n.onBuffer,l=n.onEnded,u=n.onReady,s=window[f].PlayerState,c=s.PLAYING,p=s.PAUSED,y=s.BUFFERING,d=s.ENDED,h=s.CUED;t===c&&r(),t===p&&o(),t===y&&i(),t===d&&l(),t===h&&u()},a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.controls,l=r.config,u=r.onError,s=e&&e.match(p)[1];if(t)return void this.player.cueVideoById({videoId:s,startSeconds:(0,c.parseStartTime)(e)});(0,c.getSDK)("https://www.youtube.com/iframe_api",f,"onYouTubeIframeAPIReady",function(e){return e.loaded}).then(function(t){n.container&&(n.player=new t.Player(n.container,{width:"100%",height:"100%",videoId:s,playerVars:i({controls:a?1:0,start:(0,c.parseStartTime)(e),origin:window.location.origin,playsinline:o},l.youtube.playerVars),events:{onReady:n.props.onReady,onStateChange:n.onStateChange,onError:function(e){return u(e.data)}}}))},u)}},{key:"play",value:function(){this.callPlayer("playVideo")}},{key:"pause",value:function(){this.callPlayer("pauseVideo")}},{key:"stop",value:function(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var e=i({width:"100%",height:"100%"},this.props.style);return s.default.createElement("div",{style:e},s.default.createElement("div",{ref:this.ref}))}}]),t}(u.Component);y.displayName="YouTube",y.canPlay=function(e){return p.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/(soundcloud.com|snd.sc)\/([a-z0-9-_]+\/[a-z0-9-_]+)$/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.duration=null,a.currentTime=null,a.fractionLoaded=null,a.ref=function(e){a.iframe=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this;(0,c.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(function(r){if(n.iframe){var o=r.Widget.Events,a=o.PLAY,l=o.PLAY_PROGRESS,u=o.PAUSE,s=o.FINISH,c=o.ERROR;t||(n.player=r.Widget(n.iframe),n.player.bind(a,n.props.onPlay),n.player.bind(u,n.props.onPause),n.player.bind(l,function(e){n.currentTime=e.currentPosition/1e3,n.fractionLoaded=e.loadedProgress}),n.player.bind(s,function(){return n.props.onEnded()}),n.player.bind(c,function(e){return n.props.onError(e)})),n.player.load(e,i({},n.props.config.soundcloud.options,{callback:function(){n.player.getDuration(function(e){n.duration=e/1e3,n.props.onReady()})}}))}})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",1e3*e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var e=i({width:"100%",height:"100%"},this.props.style);return s.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url="+encodeURIComponent(this.props.url),style:e,frameBorder:0})}}]),t}(u.Component);p.displayName="SoundCloud",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/(?:www\.|player\.)?vimeo.com\/(?:(?:channels|ondemand)\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.duration=null,a.currentTime=null,a.secondsLoaded=null,a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"load",value:function(e,t){var n=this,r=e.match(f)[3];if(this.duration=null,t)return void this.player.loadVideo(r).catch(this.props.onError);(0,c.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(function(t){n.container&&(n.player=new t.Player(n.container,i({},n.props.config.vimeo.playerOptions,{url:e,loop:n.props.loop})),n.player.ready().then(function(){var e=n.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"}).catch(n.props.onError),n.player.on("loaded",function(){n.props.onReady(),n.player.getDuration().then(function(e){n.duration=e})}),n.player.on("play",n.props.onPlay),n.player.on("pause",n.props.onPause),n.player.on("seeked",function(e){return n.props.onSeek(e.seconds)}),n.player.on("ended",n.props.onEnded),n.player.on("error",n.props.onError),n.player.on("timeupdate",function(e){var t=e.seconds;n.currentTime=t}),n.player.on("progress",function(e){var t=e.seconds;n.secondsLoaded=t}))},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("unload")}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=i({width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"},this.props.style);return s.default.createElement("div",{style:e,ref:this.ref})}}]),t}(u.Component);p.displayName="Vimeo",p.canPlay=function(e){return f.test(e)},t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,a.onDurationChange=function(){var e=a.getDuration();a.props.onDuration(e)},a.ref=function(e){a.container=e},i=n,o(a,i)}return a(t,e),l(t,[{key:"parseId",value:function(e){var t=e.match(f);return t[4]||t[2]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.config,a=n.onError,l=n.playing,u=this.parseId(e);if(this.player)return void this.player.load(u,{start:(0,c.parseStartTime)(e),autoplay:l});(0,c.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",function(e){return e.player}).then(function(n){if(t.container){var l=n.player;t.player=new l(t.container,{width:"100%",height:"100%",video:u,params:i({controls:r,autoplay:t.props.playing,start:(0,c.parseStartTime)(e),origin:window.location.origin},o.dailymotion.params),events:{apiready:t.props.onReady,seeked:function(){return t.props.onSeek(t.player.currentTime)},video_end:t.props.onEnded,durationchange:t.onDurationChange,pause:t.props.onPause,playing:t.props.onPlay,waiting:t.props.onBuffer,error:function(e){return a(e)}}})}},a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var e=i({width:"100%",height:"100%",backgroundColor:"black"},this.props.style);return s.default.createElement("div",{style:e},s.default.createElement("div",{ref:this.ref}))}}]),t}(u.Component);p.displayName="DailyMotion",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){if(e instanceof Array){var t=!0,n=!1,r=void 0;try{for(var o,a=e[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var l=o.value;if("string"==typeof l&&i(l))return!0;if(i(l.src))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1}return p.test(e)||y.test(e)||d.test(e)||h.test(e)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=function(e){return e&&e.__esModule?e:{default:e}}(s),f=n(1),p=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,y=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,d=/\.(m3u8)($|\?)/i,h=/\.(mpd)($|\?)/i,v=function(e){function t(){var e,n,a,i;r(this,t);for(var u=arguments.length,s=Array(u),f=0;f<u;f++)s[f]=arguments[f];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),a.onSeek=function(e){a.props.onSeek(e.target.currentTime)},a.renderSource=function(e,t){if("string"==typeof e)return c.default.createElement("source",{key:t,src:e});var n=e.src,r=e.type;return c.default.createElement("source",{key:t,src:n,type:r})},a.renderTrack=function(e,t){return c.default.createElement("track",l({key:t},e))},a.ref=function(e){a.player=e},i=n,o(a,i)}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillReceiveProps",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.removeListeners()}},{key:"componentDidUpdate",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"addListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onPause,o=e.onEnded,a=e.onError,i=e.playsinline;this.player.addEventListener("canplay",t),this.player.addEventListener("play",n),this.player.addEventListener("pause",r),this.player.addEventListener("seeked",this.onSeek),this.player.addEventListener("ended",o),this.player.addEventListener("error",a),i&&(this.player.setAttribute("playsinline",""),this.player.setAttribute("webkit-playsinline",""))}},{key:"removeListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onPause,o=e.onEnded,a=e.onError;this.player.removeEventListener("canplay",t),this.player.removeEventListener("play",n),this.player.removeEventListener("pause",r),this.player.removeEventListener("seeked",this.onSeek),this.player.removeEventListener("ended",o),this.player.removeEventListener("error",a)}},{key:"shouldUseAudio",value:function(e){return p.test(e.url)||e.config.file.forceAudio}},{key:"shouldUseHLS",value:function(e){var t=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;return d.test(e)&&!t||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return h.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this;this.shouldUseHLS(e)&&(0,f.getSDK)("https://cdn.jsdelivr.net/hls.js/latest/hls.min.js","Hls").then(function(n){t.hls=new n,t.hls.loadSource(e),t.hls.attachMedia(t.player)}),this.shouldUseDASH(e)&&(0,f.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.5.0/dash.all.min.js","dashjs").then(function(n){t.dash=n.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.getDebug().setLogToBrowserConsole(!1)})}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.hls&&this.hls.destroy(),this.dash&&this.dash.reset()}},{key:"seekTo",value:function(e){this.player.currentTime=e}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){return this.player.duration}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return 0===this.player.buffered.length?0:this.player.buffered.end(0)}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.loop,r=e.controls,o=e.config,a=e.width,i=e.height,u=this.shouldUseAudio(this.props),s=this.shouldUseHLS(t),f=this.shouldUseDASH(t),p=u?"audio":"video",y=t instanceof Array||s||f?void 0:t,d={width:a&&"auto"!==a?"100%":a,height:i&&"auto"!==i?"100%":i};return c.default.createElement(p,l({ref:this.ref,src:y,style:d,preload:"auto",controls:r,loop:n},o.file.attributes),t instanceof Array&&t.map(this.renderSource),o.file.tracks.map(this.renderTrack))}}]),t}(s.Component);v.displayName="FilePlayer",v.canPlay=i,t.default=v,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(2),f=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.mounted=!1,a.isReady=!1,a.isPlaying=!1,a.isLoading=!0,a.startOnPlay=!0,a.seekOnPlay=null,a.onDurationCalled=!1,a.getInternalPlayer=function(e){return a.player?a.player[e]:null},a.onReady=function(){if(a.mounted){a.isReady=!0,a.isLoading=!1;var e=a.props,t=e.onReady,n=e.playing;t(),n&&a.player.play(),a.onDurationCheck()}},a.onPlay=function(){a.isPlaying=!0,a.isLoading=!1;var e=a.props,t=e.volume,n=e.muted,r=e.onStart,o=e.onPlay,i=e.playbackRate;a.startOnPlay&&(a.player.setPlaybackRate&&a.player.setPlaybackRate(i),r(),a.startOnPlay=!1),a.player.setVolume(n?0:t),o(),a.seekOnPlay&&(a.seekTo(a.seekOnPlay),a.seekOnPlay=null),a.onDurationCheck()},a.onPause=function(){a.isPlaying=!1,a.isLoading||a.props.onPause()},a.onEnded=function(){var e=a.props,t=e.activePlayer,n=e.loop,r=e.onEnded;t.loopOnEnded&&n&&a.seekTo(0),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.ref=function(e){e&&(a.player=e)},i=n,o(a,i)}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.mounted=!0,this.player.load(this.props.url)}},{key:"componentWillUnmount",value:function(){this.isReady&&this.player.stop(),this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.url,r=t.playing,o=t.volume,a=t.muted,i=t.playbackRate;n!==e.url&&(this.isLoading=!0,this.onDurationCalled=!1,this.player.load(e.url,this.isReady)),r||!e.playing||this.isPlaying||this.player.play(),r&&!e.playing&&this.isPlaying&&this.player.pause(),o===e.volume||e.muted||this.player.setVolume(e.volume),a!==e.muted&&this.player.setVolume(e.muted?0:e.volume),i!==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 s.default.createElement(e,i({},this.props,{ref:this.ref,onReady:this.onReady,onPlay:this.onPlay,onPause:this.onPause,onEnded:this.onEnded}))}}]),t}(u.Component);f.displayName="Player",f.propTypes=c.propTypes,f.defaultProps=c.defaultProps,t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),p=n(2),y=n(1),d=n(17),h=r(d),v=n(8),m=r(v),b=n(7),g=r(b),P=n(22),k=r(P),w=Object.keys(p.propTypes),ReactPlayer=function(e){function ReactPlayer(){var e,t,n,r;a(this,ReactPlayer);for(var o=arguments.length,l=Array(o),u=0;u<o;u++)l[u]=arguments[u];return t=n=i(this,(e=ReactPlayer.__proto__||Object.getPrototypeOf(ReactPlayer)).call.apply(e,[this].concat(l))),n.config=(0,y.getConfig)(n.props,p.defaultProps,!0),n.getDuration=function(){return n.player?n.player.getDuration():null},n.getCurrentTime=function(){return n.player?n.player.getCurrentTime():null},n.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return n.player?n.player.getInternalPlayer(e):null},n.seekTo=function(e){if(!n.player)return null;n.player.seekTo(e)},n.progress=function(){if(n.props.url&&n.player&&n.player.isReady){var e=n.player.getCurrentTime()||0,t=n.player.getSecondsLoaded(),r=n.player.getDuration();if(r){var o={playedSeconds:e,played:e/r};null!==t&&(o.loadedSeconds=t,o.loaded=t/r),o.played===n.prevPlayed&&o.loaded===n.prevLoaded||n.props.onProgress(o),n.prevPlayed=o.played,n.prevLoaded=o.loaded}}n.progressTimeout=setTimeout(n.progress,n.props.progressFrequency)},n.wrapperRef=function(e){n.wrapper=e},n.activePlayerRef=function(e){n.player=e},r=t,i(n,r)}return l(ReactPlayer,e),s(ReactPlayer,[{key:"componentDidMount",value:function(){this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout)}},{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"getActivePlayer",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=h.default[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var i=o.value;if(i.canPlay(e))return i}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return g.default}},{key:"renderActivePlayer",value:function(e){if(!e)return null;var t=this.getActivePlayer(e);return f.default.createElement(m.default,u({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t}))}},{key:"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=(0,y.omit)(this.props,w,p.DEPRECATED_CONFIG_PROPS),l=this.renderActivePlayer(t),s=(0,k.default)(t,this.config),c=[l].concat(o(s)).sort(this.sortPlayers);return f.default.createElement("div",u({ref:this.wrapperRef,style:u({},n,{width:r,height:a})},i),c)}}]),ReactPlayer}(c.Component);ReactPlayer.displayName="ReactPlayer",ReactPlayer.propTypes=p.propTypes,ReactPlayer.defaultProps=p.defaultProps,ReactPlayer.canPlay=function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=h.default[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){if(o.value.canPlay(e))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1},t.default=ReactPlayer,e.exports=t.default},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=n(11)()},function(e,t,n){"use strict";var r=n(12),o=n(13),a=n(14);e.exports=function(){function e(e,t,n,r,i,l){l!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,a,i,l,u){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,i,l,u],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function r(e,t){for(var n in t)e.setAttribute(n,t[n])}function o(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function a(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,t,n){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("script");"function"==typeof t&&(n=t,t={}),t=t||{},n=n||function(){},l.type=t.type||"text/javascript",l.charset=t.charset||"utf8",l.async=!("async"in t)||!!t.async,l.src=e,t.attrs&&r(l,t.attrs),t.text&&(l.text=""+t.text),("onload"in l?o:a)(l,n),l.onload||o(l,n),i.appendChild(l)}},function(e,t,n){"use strict";function r(e){return!!e&&"object"===(void 0===e?"undefined":f(e))}function o(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||a(e)}function a(e){return e.$$typeof===d}function i(e){return Array.isArray(e)?[]:{}}function l(e,t){return t&&!1===t.clone||!p(e)?e:c(i(e),e,t)}function u(e,t,n){return e.concat(t).map(function(e){return l(e,n)})}function s(e,t,n){var r={};return p(e)&&Object.keys(e).forEach(function(t){r[t]=l(e[t],n)}),Object.keys(t).forEach(function(o){p(t[o])&&e[o]?r[o]=c(e[o],t[o],n):r[o]=l(t[o],n)}),r}function c(e,t,n){var r=Array.isArray(t),o=Array.isArray(e),a=n||{arrayMerge:u};if(r===o)return r?(a.arrayMerge||u)(e,t,n):s(e,t,n);return l(t,n)}Object.defineProperty(t,"__esModule",{value:!0});var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=function(e){return r(e)&&!o(e)},y="function"==typeof Symbol&&Symbol.for,d=y?Symbol.for("react.element"):60103;c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return c(e,n,t)},{})};var h=c;t.default=h,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(3),a=r(o),i=n(4),l=r(i),u=n(5),s=r(u),c=n(18),f=r(c),p=n(19),y=r(p),d=n(20),h=r(d),v=n(21),m=r(v),b=n(6),g=r(b),P=n(7),k=r(P);t.default=[a.default,l.default,s.default,f.default,y.default,h.default,m.default,g.default,k.default],e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c="//connect.facebook.net/en_US/sdk.js",f=/facebook\.com\/([^\/?].+\/)?video(s|\.php)[\/?].*$/,p="facebook-player-",y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.playerID=p+(0,s.randomString)(),i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e,t){var n=this;if(t)return void(0,s.getSDK)(c,"FB","fbAsyncInit").then(function(e){return e.XFBML.parse()});(0,s.getSDK)(c,"FB","fbAsyncInit").then(function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:"v2.5"}),e.Event.subscribe("xfbml.ready",function(e){"video"===e.type&&e.id===n.playerID&&(n.player=e.instance,n.player.subscribe("startedPlaying",n.props.onPlay),n.player.subscribe("paused",n.props.onPause),n.player.subscribe("finishedPlaying",n.props.onEnded),n.player.subscribe("startedBuffering",n.props.onBuffer),n.player.subscribe("error",n.props.onError),n.props.onReady())})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){0!==e&&this.callPlayer("unmute"),this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%",backgroundColor:"black"};return u.default.createElement("div",{style:e,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-allowfullscreen":"true","data-controls":this.props.controls?void 0:"false"})}}]),t}(l.Component);y.displayName="Facebook",y.canPlay=function(e){return f.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c=/streamable.com\/([a-z0-9]+)$/,f=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.duration=null,a.currentTime=null,a.secondsLoaded=null,a.ref=function(e){a.iframe=e},i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e){var t=this;(0,s.getSDK)("//cdn.embed.ly/player-0.0.12.min.js","playerjs").then(function(e){t.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)}))},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=this.props.url.match(c)[1],t={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/"+e,frameBorder:"0",scrolling:"no",style:t,allowFullScreen:!0})}}]),t}(l.Component);f.displayName="Streamable",f.canPlay=function(e){return c.test(e)},t.default=f,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(1),f=/(?:wistia.com|wi.st)\/(?:medias|embed)\/(.*)$/,p=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=c.callPlayer,i=n,o(a,i)}return a(t,e),l(t,[{key:"getID",value:function(e){return e&&e.match(f)[1]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.onReady,a=n.onPlay,l=n.onPause,u=n.onSeek,s=n.onEnded,f=n.config;(0,c.getSDK)("//fast.wistia.com/assets/external/E-v1.js","Wistia").then(function(){window._wq=window._wq||[],window._wq.push({id:t.getID(e),options:i({controlsVisibleOnLoad:r},f.wistia.options),onReady:function(e){t.player=e,t.player.bind("play",a),t.player.bind("pause",l),t.player.bind("seek",u),t.player.bind("end",s),o()}})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("remove")}},{key:"seekTo",value:function(e){this.callPlayer("time",e)}},{key:"setVolume",value:function(e){this.callPlayer("volume",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("playbackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.getID(this.props.url),t="wistia_embed wistia_async_"+e,n={width:"100%",height:"100%"};return s.default.createElement("div",{key:e,className:t,style:n})}}]),t}(u.Component);p.displayName="Wistia",p.canPlay=function(e){return f.test(e)},p.loopOnEnded=!0,t.default=p,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),s=n(1),c=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,f=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,p="twitch-player-",y=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.callPlayer=s.callPlayer,a.playerID=p+(0,s.randomString)(),i=n,o(a,i)}return a(t,e),i(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,i=f.test(e),l=i?e.match(f)[1]:e.match(c)[1];if(t)return void(i?this.player.setChannel(l):this.player.setVideo("v"+l));(0,s.getSDK)("//player.twitch.tv/js/embed/v1.js","Twitch").then(function(e){n.player=new e.Player(n.playerID,{video:i?"":l,channel:i?l:"",height:"100%",width:"100%",playsinline:o,autoplay:n.props.playing});var t=e.Player,r=t.READY,a=t.PLAY,u=t.PAUSE,s=t.ENDED;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(a,n.props.onPlay),n.player.addEventListener(u,n.props.onPause),n.player.addEventListener(s,n.props.onEnded)},a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("pause")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return u.default.createElement("div",{style:e,id:this.playerID})}}]),t}(l.Component);y.displayName="Twitch",y.canPlay=function(e){return c.test(e)||f.test(e)},y.loopOnEnded=!0,t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var l,s=m[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var c=l.value;!c.Player.canPlay(e)&&t[c.configKey].preload&&n.push(i.default.createElement(u.default,{key:c.Player.displayName,activePlayer:c.Player,url:c.url,playing:!0,style:{display:"none"}}))}}catch(e){o=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw a}}return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=n(0),i=r(a),l=n(8),u=r(l),s=n(3),c=r(s),f=n(4),p=r(f),y=n(5),d=r(y),h=n(6),v=r(h),m=[{Player:c.default,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:p.default,configKey:"soundcloud",url:"https://soundcloud.com/seucheu/john-cage-433-8-bit-version"},{Player:d.default,configKey:"vimeo",url:"https://vimeo.com/127250231"},{Player:v.default,configKey:"dailymotion",url:"http://www.dailymotion.com/video/xqdpyk"}];e.exports=t.default}]); | ||
//# sourceMappingURL=ReactPlayer.js.map |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ The MIT License |
{ | ||
"name": "react-player", | ||
"version": "1.0.0", | ||
"description": "A react component for playing a variety of URLs, including file paths, YouTube, Facebook, SoundCloud, Streamable, Vimeo and Wistia", | ||
"version": "1.1.0", | ||
"description": "A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion", | ||
"main": "lib/ReactPlayer.js", | ||
@@ -16,4 +16,5 @@ "typings": "index.d.ts", | ||
"build:dist": "cross-env NODE_ENV=production webpack --config webpack.dist.babel.js", | ||
"build:standalone": "cross-env NODE_ENV=production webpack --config webpack.standalone.babel.js", | ||
"preversion": "npm run lint", | ||
"version": "auto-changelog -p && npm run build:dist && git add CHANGELOG.md dist", | ||
"version": "auto-changelog -p && npm run build:dist && npm run build:standalone && git add CHANGELOG.md dist", | ||
"prepublishOnly": "npm run build:lib && npm run build:dist", | ||
@@ -33,2 +34,4 @@ "postpublish": "npm run clean" | ||
"youtube", | ||
"facebook", | ||
"twitch", | ||
"soundcloud", | ||
@@ -38,2 +41,5 @@ "streamable", | ||
"wistia", | ||
"dailymotion", | ||
"hls", | ||
"dash", | ||
"react-component" | ||
@@ -40,0 +46,0 @@ ], |
212
README.md
@@ -1,14 +0,27 @@ | ||
ReactPlayer | ||
=========== | ||
<h2 align="center"> | ||
ReactPlayer | ||
</h2> | ||
[![Latest npm version](https://img.shields.io/npm/v/react-player.svg)](https://www.npmjs.com/package/react-player) | ||
[![Build Status](https://img.shields.io/travis/CookPete/react-player/master.svg)](https://travis-ci.org/CookPete/react-player) | ||
[![Dependency Status](https://img.shields.io/david/CookPete/react-player.svg)](https://david-dm.org/CookPete/react-player) | ||
[![Test Coverage](https://img.shields.io/codecov/c/github/cookpete/react-player.svg)](https://codecov.io/gh/CookPete/react-player) | ||
[![Donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/ckpt) | ||
<p align="center"> | ||
<a href='https://www.npmjs.com/package/react-player'> | ||
<img src='https://img.shields.io/npm/v/react-player.svg' alt='Latest npm version'> | ||
</a> | ||
<a href='https://travis-ci.org/CookPete/react-player'> | ||
<img src='https://img.shields.io/travis/CookPete/react-player/master.svg' alt='Build Status'> | ||
</a> | ||
<a href='https://david-dm.org/CookPete/react-player'> | ||
<img src='https://img.shields.io/david/CookPete/react-player.svg' alt='Dependency Status'> | ||
</a> | ||
<a href='https://codecov.io/gh/CookPete/react-player'> | ||
<img src='https://img.shields.io/codecov/c/github/cookpete/react-player.svg' alt='Test Coverage'> | ||
</a> | ||
<a href='https://paypal.me/ckpt'> | ||
<img src='https://img.shields.io/badge/donate-PayPal-blue.svg' alt='Donate'> | ||
</a> | ||
</p> | ||
A react component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion. | ||
<p align="center"> | ||
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion. | ||
</p> | ||
The component parses a URL and loads in the appropriate markup and external SDKs to play media from [various sources](#supported-media). [Props](#props) can be passed in to control playback and react to events such as buffering or media ending. | ||
#### Migrating to `1.0.0` | ||
@@ -18,7 +31,2 @@ | ||
### Polyfills | ||
* If you are using `npm` and need to support [browsers without `Promise`](http://caniuse.com/#feat=promises) you will need a [`Promise` polyfill](https://github.com/stefanpenner/es6-promise). | ||
* To support IE11 you will need to use [`babel-polyfill`](https://babeljs.io/docs/usage/polyfill) or a similar ES2015+ polyfill. | ||
### Usage | ||
@@ -43,42 +51,13 @@ | ||
See [the demo source](https://github.com/CookPete/react-player/blob/master/src/demo/App.js) for a full example. | ||
Demo page: [`https://cookpete.com/react-player`](https://cookpete.com/react-player) | ||
For platforms like [Meteor](https://www.meteor.com) without direct use of `npm` modules, a minified version of `ReactPlayer` is located in `dist` after installing. To generate this file yourself, checkout the repo and run `npm run build:dist` | ||
The component parses a URL and loads in the appropriate markup and external SDKs to play media from [various sources](#supported-media). [Props](#props) can be passed in to control playback and react to events such as buffering or media ending. See [the demo source](https://github.com/CookPete/react-player/blob/master/src/demo/App.js) for a full example. | ||
#### Bower | ||
For platforms like [Meteor](https://www.meteor.com) without direct use of `npm` modules, a minified version of `ReactPlayer` is located in `dist` after installing. To generate this file yourself, checkout the repo and run `npm run build:dist`. | ||
```bash | ||
bower install react-player --save | ||
``` | ||
#### Polyfills | ||
```html | ||
<script src='bower_components/react/react.js'></script> | ||
<script src='bower_components/react/react-dom.js'></script> | ||
<script src='bower_components/react-player/dist/ReactPlayer.js'></script> | ||
<script> | ||
ReactDOM.render( | ||
<ReactPlayer url='https://www.youtube.com/watch?v=d46Azg3Pm4c' playing />, | ||
document.getElementById('container') | ||
) | ||
</script> | ||
``` | ||
* If you are using `npm` and need to support [browsers without `Promise`](http://caniuse.com/#feat=promises) you will need a [`Promise` polyfill](https://github.com/stefanpenner/es6-promise). | ||
* To support IE11 you will need to use [`babel-polyfill`](https://babeljs.io/docs/usage/polyfill) or a similar ES2015+ polyfill. | ||
### Demo | ||
See a [live demo](http://cookpete.com/react-player), or run: | ||
```bash | ||
git clone https://github.com/CookPete/react-player.git | ||
cd react-player | ||
npm install # or yarn | ||
npm start | ||
open http://localhost:3000 | ||
``` | ||
### Mobile considerations | ||
Due to various restrictions, `ReactPlayer` is not guaranteed to function properly on mobile devices. The [YouTube player documentation](https://developers.google.com/youtube/iframe_api_reference), for example, explains that [certain mobile browsers require user interaction](https://developers.google.com/youtube/iframe_api_reference#Mobile_considerations) before playing: | ||
> The HTML5 `<video>` element, in certain mobile browsers (such as Chrome and Safari), only allows playback to take place if it’s initiated by a user interaction (such as tapping on the player). | ||
### Props | ||
@@ -95,4 +74,4 @@ | ||
`playbackRate` | Sets the playback rate of the appropriate player<br />*Note: Only supported by YouTube, Wistia, and file paths* | `1` | ||
`width` | Sets the width of the player | `640` | ||
`height` | Sets the height of the player | `360` | ||
`width` | Sets the width of the player | `640px` | ||
`height` | Sets the height of the player | `360px` | ||
`style` | Add [inline styles](https://facebook.github.io/react/tips/inline-styles.html) to the root element | `{}` | ||
@@ -164,2 +143,103 @@ `progressFrequency` | The time between `onProgress` callbacks, in milliseconds | `1000` | ||
### Methods | ||
#### Static Methods | ||
Method | Description | ||
---- | ----------- | ||
`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. | ||
#### Instance Methods | ||
Use [`ref`](https://facebook.github.io/react/docs/refs-and-the-dom.html) to call instance methods on the player. See [the demo app](src/demo/App.js) for an example of this. | ||
Method | Description | ||
---- | ----------- | ||
`seekTo(amount)` | Seek to the given number of seconds, or fraction if `amount` is between `0` and `1` | ||
`getCurrentTime()` | Returns the number of seconds that has been played<br /> ◦ Returns `null` if duration is unavailable | ||
`getDuration()` | Returns the duration (in seconds) of the currently playing media<br /> ◦ Returns `null` if duration is unavailable | ||
`getInternalPlayer()` | Returns the internal player of whatever is currently playing<br /> ◦ eg the [YouTube player instance](https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player), or the [`<video>`](https://developer.mozilla.org/en/docs/Web/HTML/Element/video) element when playing a video file<br /> ◦ Use `getInternalPlayer('hls')` to get the [hls.js](https://github.com/video-dev/hls.js) player<br /> ◦ Use `getInternalPlayer('dash')` to get the [dash.js](https://github.com/Dash-Industry-Forum/dash.js) player<br /> ◦ Returns `null` if the internal player is unavailable | ||
### Advanced Usage | ||
#### Responsive player | ||
Set `width` and `height` to `100%` and wrap the player in a [fixed aspect ratio box](https://css-tricks.com/aspect-ratio-boxes) to get a responsive player: | ||
```js | ||
class ResponsivePlayer extends Component { | ||
render () { | ||
return ( | ||
<div className='player-wrapper'> | ||
<ReactPlayer | ||
className='react-player' | ||
url='https://www.youtube.com/watch?v=ysz5S6PUM-U' | ||
width='100%' | ||
height='100%' | ||
/> | ||
</div> | ||
) | ||
} | ||
} | ||
``` | ||
```css | ||
.player-wrapper { | ||
position: relative; | ||
padding-top: 56.25% /* Player ratio: 100 / (1280 / 720) */ | ||
} | ||
.react-player { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} | ||
``` | ||
See [`jsFiddle` example](https://jsfiddle.net/e6w3rtj1/) | ||
#### Standalone player | ||
If you aren’t using React, you can still render a player using the standalone library: | ||
```html | ||
<script src='https://cdn.rawgit.com/CookPete/react-player/standalone/dist/ReactPlayer.standalone.js'></script> | ||
<script> | ||
const container = document.getElementById('container') | ||
const url = 'https://www.youtube.com/watch?v=d46Azg3Pm4c' | ||
renderReactPlayer(container, { url, playing: true }) | ||
function pausePlayer () { | ||
renderReactPlayer(container, { url, playing: false }) | ||
} | ||
</script> | ||
``` | ||
See [`jsFiddle` example](https://jsfiddle.net/krkcvx9s/) | ||
#### Using Bower | ||
```bash | ||
bower install react-player --save | ||
``` | ||
```html | ||
<script src='bower_components/react/react.js'></script> | ||
<script src='bower_components/react/react-dom.js'></script> | ||
<script src='bower_components/react-player/dist/ReactPlayer.js'></script> | ||
<script> | ||
ReactDOM.render( | ||
<ReactPlayer url='https://www.youtube.com/watch?v=d46Azg3Pm4c' playing />, | ||
document.getElementById('container') | ||
) | ||
</script> | ||
``` | ||
#### Mobile considerations | ||
Due to various restrictions, `ReactPlayer` is not guaranteed to function properly on mobile devices. The [YouTube player documentation](https://developers.google.com/youtube/iframe_api_reference), for example, explains that [certain mobile browsers require user interaction](https://developers.google.com/youtube/iframe_api_reference#Mobile_considerations) before playing: | ||
> The HTML5 `<video>` element, in certain mobile browsers (such as Chrome and Safari), only allows playback to take place if it’s initiated by a user interaction (such as tapping on the player). | ||
#### Multiple Sources and Tracks | ||
@@ -201,22 +281,2 @@ | ||
### Methods | ||
#### Static Methods | ||
Method | Description | ||
---- | ----------- | ||
`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. | ||
#### Instance Methods | ||
Use [`ref`](https://facebook.github.io/react/docs/refs-and-the-dom.html) to call instance methods on the player. See [the demo app](src/demo/App.js) for an example of this. | ||
Method | Description | ||
---- | ----------- | ||
`seekTo(amount)` | Seek to the given number of seconds, or fraction if `amount` is between `0` and `1` | ||
`getCurrentTime()` | Returns the number of seconds that has been played<br /> ◦ Returns `null` if duration is unavailable | ||
`getDuration()` | Returns the duration (in seconds) of the currently playing media<br /> ◦ Returns `null` if duration is unavailable | ||
`getInternalPlayer()` | Returns the internal player of whatever is currently playing<br /> ◦ eg the [YouTube player instance](https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player), or the [`<video>`](https://developer.mozilla.org/en/docs/Web/HTML/Element/video) element when playing a video file<br /> ◦ Use `getInternalPlayer('hls')` to get the [hls.js](https://github.com/video-dev/hls.js) player<br /> ◦ Use `getInternalPlayer('dash')` to get the [dash.js](https://github.com/Dash-Industry-Forum/dash.js) player<br /> ◦ Returns `null` if the internal player is unavailable | ||
### Supported media | ||
@@ -227,3 +287,3 @@ | ||
* SoundCloud tracks use the [SoundCloud Widget API](https://developers.soundcloud.com/docs/api/html5-widget) | ||
* Streamable videos are [resolved](https://streamable.com/documentation#retrieve-video) and played in a [`<video>`](https://developer.mozilla.org/en/docs/Web/HTML/Element/video) element using the track’s `mp4` path | ||
* Streamable videos use [`Player.js`](https://github.com/embedly/player.js) | ||
* Vidme videos are [no longer supported](https://medium.com/vidme/goodbye-for-now-120b40becafa) | ||
@@ -235,4 +295,4 @@ * Vimeo videos use the [Vimeo Player API](https://developer.vimeo.com/player/js-api) | ||
* [Supported file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats) are playing using [`<video>`](https://developer.mozilla.org/en/docs/Web/HTML/Element/video) or [`<audio>`](https://developer.mozilla.org/en/docs/Web/HTML/Element/audio) elements | ||
* HLS streams are played using [hls.js](https://github.com/video-dev/hls.js) | ||
* DASH streams are played using [dash.js](https://github.com/Dash-Industry-Forum/dash.js) | ||
* HLS streams are played using [`hls.js`](https://github.com/video-dev/hls.js) | ||
* DASH streams are played using [`dash.js`](https://github.com/Dash-Industry-Forum/dash.js) | ||
@@ -245,2 +305,2 @@ ### Contributing | ||
Huge thanks to anyone who has [contributed](https://github.com/CookPete/react-player/graphs/contributors) | ||
Huge thanks to anyone who has [contributed](https://github.com/CookPete/react-player/graphs/contributors). |
@@ -0,0 +0,0 @@ import webpack from 'webpack' |
@@ -0,0 +0,0 @@ import path from 'path' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1486114
299
19
1037
1
1