react-player
Advanced tools
Comparing version 0.14.3 to 0.15.0
@@ -7,2 +7,13 @@ # Change Log | ||
#### [v0.15.0](https://github.com/CookPete/react-player/compare/v0.14.3...v0.15.0) | ||
> 14 April 2017 | ||
* Add vidmeConfig with choice of video format [`#162`](https://github.com/CookPete/react-player/issues/162) | ||
* Call player.load() when loading files [`#177`](https://github.com/CookPete/react-player/issues/177) | ||
* Add getCurrentTime and getDuration methods [`#178`](https://github.com/CookPete/react-player/issues/178) | ||
* Use prop-types library [`#179`](https://github.com/CookPete/react-player/issues/179) | ||
* Add loadedSeconds and playedSeconds to onProgress [`#164`](https://github.com/CookPete/react-player/issues/164) | ||
* Add playsinline prop [`#148`](https://github.com/CookPete/react-player/issues/148) | ||
#### [v0.14.3](https://github.com/CookPete/react-player/compare/v0.14.2...v0.14.3) | ||
@@ -9,0 +20,0 @@ > 21 February 2017 |
@@ -1,2 +0,1 @@ | ||
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.i=function(e){return e},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=21)}([function(e,t){e.exports=React},function(e,t,n){(function(t,r,o){!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function r(e){return"function"==typeof e}function i(e){z=e}function a(e){J=e}function u(){return function(){return t.nextTick(p)}}function s(){return"undefined"!=typeof Y?function(){Y(p)}:f()}function l(){var e=0,t=new Z(p),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function c(){var e=new MessageChannel;return e.port1.onmessage=p,function(){return e.port2.postMessage(0)}}function f(){var e=setTimeout;return function(){return e(p,1)}}function p(){for(var e=0;e<G;e+=2){var t=ne[e],n=ne[e+1];t(n),ne[e]=void 0,ne[e+1]=void 0}G=0}function y(){try{var e=n(20);return Y=e.runOnLoop||e.runOnContext,s()}catch(e){return f()}}function d(e,t){var n=arguments,r=this,o=new this.constructor(v);void 0===o[oe]&&I(o);var i=r._state;return i?!function(){var e=n[i-1];J(function(){return D(i,o,e,r._result)})}():R(r,o,e,t),o}function h(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(v);return k(n,e),n}function v(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function g(e){try{return e.then}catch(e){return se.error=e,se}}function w(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}function _(e,t,n){J(function(e){var r=!1,o=w(n,t,function(n){r||(r=!0,t!==n?k(e,n):E(e,n))},function(t){r||(r=!0,T(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,T(e,o))},e)}function O(e,t){t._state===ae?E(e,t._result):t._state===ue?T(e,t._result):R(t,void 0,function(t){return k(e,t)},function(t){return T(e,t)})}function P(e,t,n){t.constructor===e.constructor&&n===d&&t.constructor.resolve===h?O(e,t):n===se?T(e,se.error):void 0===n?E(e,t):r(n)?_(e,t,n):E(e,t)}function k(t,n){t===n?T(t,b()):e(n)?P(t,n,g(n)):E(t,n)}function j(e){e._onerror&&e._onerror(e._result),C(e)}function E(e,t){e._state===ie&&(e._result=t,e._state=ae,0!==e._subscribers.length&&J(C,e))}function T(e,t){e._state===ie&&(e._state=ue,e._result=t,J(j,e))}function R(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ae]=n,o[i+ue]=r,0===i&&e._state&&J(C,e)}function C(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,i=e._result,a=0;a<t.length;a+=3)r=t[a],o=t[a+n],r?D(n,r,o,i):o(i);e._subscribers.length=0}}function A(){this.error=null}function S(e,t){try{return e(t)}catch(e){return le.error=e,le}}function D(e,t,n,o){var i=r(n),a=void 0,u=void 0,s=void 0,l=void 0;if(i){if(a=S(n,o),a===le?(l=!0,u=a.error,a=null):s=!0,t===a)return void T(t,m())}else a=o,s=!0;t._state!==ie||(i&&s?k(t,a):l?T(t,u):e===ae?E(t,a):e===ue&&T(t,a))}function x(e,t){try{t(function(t){k(e,t)},function(t){T(e,t)})}catch(t){T(e,t)}}function M(){return ce++}function I(e){e[oe]=ce++,e._state=void 0,e._result=void 0,e._subscribers=[]}function B(e,t){this._instanceConstructor=e,this.promise=new e(v),this.promise[oe]||I(this.promise),H(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?E(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&E(this.promise,this._result))):T(this.promise,F())}function F(){return new Error("Array Methods must be provided an Array")}function U(e){return new B(this,e).promise}function L(e){var t=this;return new t(H(e)?function(n,r){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(n,r)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function N(e){var t=this,n=new t(v);return T(n,e),n}function V(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function W(e){this[oe]=M(),this._result=this._state=void 0,this._subscribers=[],v!==e&&("function"!=typeof e&&V(),this instanceof W?x(this,e):q())}function K(){var e=void 0;if("undefined"!=typeof o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=W}var $=void 0;$=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var H=$,G=0,Y=void 0,z=void 0,J=function(e,t){ne[G]=e,ne[G+1]=t,G+=2,2===G&&(z?z(p):re())},X="undefined"!=typeof window?window:void 0,Q=X||{},Z=Q.MutationObserver||Q.WebKitMutationObserver,ee="undefined"==typeof self&&"undefined"!=typeof t&&"[object process]"==={}.toString.call(t),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ne=new Array(1e3),re=void 0;re=ee?u():Z?l():te?c():void 0===X?y():f();var oe=Math.random().toString(36).substring(16),ie=void 0,ae=1,ue=2,se=new A,le=new A,ce=0;return B.prototype._enumerate=function(){for(var e=this.length,t=this._input,n=0;this._state===ie&&n<e;n++)this._eachEntry(t[n],n)},B.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=g(e);if(o===d&&e._state!==ie)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(n===W){var i=new n(v);P(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(r(e),t)},B.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===ie&&(this._remaining--,e===ue?T(r,n):this._result[t]=n),0===this._remaining&&E(r,this._result)},B.prototype._willSettleAt=function(e,t){var n=this;R(e,void 0,function(e){return n._settledAt(ae,t,e)},function(e){return n._settledAt(ue,t,e)})},W.all=U,W.race=L,W.resolve=h,W.reject=N,W._setScheduler=i,W._setAsap=a,W._asap=J,W.prototype={constructor:W,then:d,catch:function(e){return this.then(null,e)}},W.polyfill=K,W.Promise=W,W}),e.exports=o.Promise}).call(t,n(16),n(1),n(19))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var 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}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},c=n(0),f=r(c),p=n(3),y=r(p),d=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,h=function(e){function t(){var e,n,r,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.ref=function(e){r.player=e},a=n,i(r,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this,n=this.props,r=n.onPause,o=n.onEnded,i=n.onError;this.player.addEventListener("canplay",this.onReady),this.player.addEventListener("play",this.onPlay),this.player.addEventListener("pause",function(){e.mounted&&r()}),this.player.addEventListener("ended",o),this.player.addEventListener("error",i),this.player.setAttribute("webkit-playsinline",""),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"componentWillUnmount",value:function(){var e=this.props,n=e.onPause,r=e.onEnded,o=e.onError;this.player.removeEventListener("canplay",this.onReady),this.player.removeEventListener("play",this.onPlay),this.player.removeEventListener("pause",n),this.player.removeEventListener("ended",r),this.player.removeEventListener("error",o),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillUnmount",this).call(this)}},{key:"load",value:function(e){this.player.src=e}},{key:"play",value:function(){this.player.play()}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src")}},{key:"seekTo",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e),this.player.currentTime=this.getDuration()*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.isReady?this.player.duration:null}},{key:"getFractionPlayed",value:function(){return this.isReady?this.player.currentTime/this.getDuration():null}},{key:"getFractionLoaded",value:function(){return this.isReady&&0!==this.player.buffered.length?this.player.buffered.end(0)/this.getDuration():null}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.loop,r=e.controls,o=e.fileConfig,i=d.test(t)?"audio":"video",a={width:"100%",height:"100%",display:t?"block":"none"};return f.default.createElement(i,u({ref:this.ref,style:a,preload:"auto",controls:r,loop:n},o.attributes))}}],[{key:"canPlay",value:function(e){return!0}}]),t}(y.default);h.displayName="FilePlayer",t.default=h,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 i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var 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=n(4),l=5e3,c=function(e){function t(){var e,n,i,a;r(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=i=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),i.isReady=!1,i.startOnPlay=!0,i.durationOnPlay=!1,i.seekOnPlay=null,i.onPlay=function(){var e=i.props,t=e.volume,n=e.onStart,r=e.onPlay,o=e.onDuration,a=e.playbackRate;i.startOnPlay&&(i.setPlaybackRate(a),i.setVolume(t),n(),i.startOnPlay=!1),r(),i.seekOnPlay&&(i.seekTo(i.seekOnPlay),i.seekOnPlay=null),i.durationOnPlay&&(o(i.getDuration()),i.durationOnPlay=!1)},i.onReady=function(){var e=i.props,t=e.onReady,n=e.playing,r=e.onDuration;i.isReady=!0,t(),(n||i.preloading)&&(i.preloading=!1,i.loadOnReady?(i.load(i.loadOnReady),i.loadOnReady=null):i.play());var o=i.getDuration();o?r(o):i.durationOnPlay=!0},a=n,o(i,a)}return i(t,e),a(t,[{key:"componentDidMount",value:function(){var e=this.props.url;this.mounted=!0,e&&this.load(e)}},{key:"componentWillUnmount",value:function(){this.stop(),this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.url,r=t.playing,o=t.volume,i=t.playbackRate;n!==e.url&&e.url?(this.seekOnPlay=null,this.startOnPlay=!0,this.load(e.url)):n&&!e.url?(this.stop(),clearTimeout(this.updateTimeout)):!r&&e.playing?this.play():r&&!e.playing?this.pause():o!==e.volume?this.setVolume(e.volume):i!==e.playbackRate&&this.setPlaybackRate(e.playbackRate)}},{key:"shouldComponentUpdate",value:function(e){return this.props.url!==e.url}},{key:"seekTo",value:function(e){var t=this;this.isReady||0===e||(this.seekOnPlay=e,setTimeout(function(){t.seekOnPlay=null},l))}}]),t}(u.Component);c.propTypes=s.propTypes,c.defaultProps=s.defaultProps,t.default=c,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultProps=t.propTypes=void 0;var r=n(0),o=r.PropTypes.string,i=r.PropTypes.bool,a=r.PropTypes.number,u=r.PropTypes.oneOfType,s=r.PropTypes.shape,l=r.PropTypes.object,c=r.PropTypes.func;t.propTypes={url:o,playing:i,loop:i,controls:i,volume:a,playbackRate:a,width:u([o,a]),height:u([o,a]),hidden:i,className:o,style:l,progressFrequency:a,soundcloudConfig:s({clientId:o,showArtwork:i}),youtubeConfig:s({playerVars:l,preload:i}),vimeoConfig:s({iframeParams:l,preload:i}),fileConfig:s({attributes:l}),onReady:c,onStart:c,onPlay:c,onPause:c,onBuffer:c,onEnded:c,onError:c,onDuration:c,onProgress:c},t.defaultProps={playing:!1,loop:!1,controls:!1,volume:.8,playbackRate:1,width:640,height:360,hidden:!1,progressFrequency:1e3,soundcloudConfig:{clientId:"e8b6f84fbcad14c301ca1355cae1dea2",showArtwork:!0},youtubeConfig:{playerVars:{},preload:!1},vimeoConfig:{iframeParams:{},preload:!1},fileConfig:{attributes:{}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onProgress:function(){}}},function(e,t,n){(function(t){!function(e){"use strict";function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function r(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return m.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function a(e){return e.bodyUsed?t.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function u(e){return new t(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=u(t);return t.readAsArrayBuffer(e),n}function l(e){var t=new FileReader,n=u(t);return t.readAsText(e),n}function c(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(m.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(m.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(m.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(m.arrayBuffer&&m.blob&&w(e))this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!m.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!_(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=f(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):m.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},m.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(c(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},m.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function y(e){var t=e.toUpperCase();return O.indexOf(t)>-1?t:e}function d(e,t){t=t||{};var n=t.body;if("string"==typeof e)this.url=e;else{if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=y(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function h(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function v(e){var t=new i;return e.split("\r\n").forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function b(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var m={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(m.arrayBuffer)var g=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=function(e){return e&&DataView.prototype.isPrototypeOf(e)},_=ArrayBuffer.isView||function(e){return e&&g.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,t){e=n(e),t=r(t);var o=this.map[e];this.map[e]=o?o+","+t:t},i.prototype.delete=function(e){delete this.map[n(e)]},i.prototype.get=function(e){return e=n(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},i.prototype.set=function(e,t){this.map[n(e)]=r(t)},i.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),o(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),o(e)},m.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},p.call(d.prototype),p.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var P=[301,302,303,307,308];b.redirect=function(e,t){if(P.indexOf(t)===-1)throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=d,e.Response=b,e.fetch=function(e,n){return new t(function(t,r){var o=new d(e,n),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:v(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var n="response"in i?i.response:i.responseText;t(new b(n,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&m.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this),e.exports=self.fetch}).call(t,n(1))},function(e,t){function n(e,t){for(var n in t)e.setAttribute(n,t[n])}function r(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 o(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,t,i){var a=document.head||document.getElementsByTagName("head")[0],u=document.createElement("script");"function"==typeof t&&(i=t,t={}),t=t||{},i=i||function(){},u.type=t.type||"text/javascript",u.charset=t.charset||"utf8",u.async=!("async"in t)||!!t.async,u.src=e,t.attrs&&n(u,t.attrs),t.text&&(u.text=""+t.text);var s="onload"in u?r:o;s(u,i),u.onload||r(u,i),a.appendChild(u)}},function(e,t,n){"use strict";(function(r){function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 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}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},c=n(0),f=o(c),p=n(14),y=o(p),d=n(2),h=o(d),v=n(4),b="//api.soundcloud.com/resolve.json",m=/^https?:\/\/(soundcloud.com|snd.sc)\/([a-z0-9-_]+\/[a-z0-9-_]+)$/,g={},w=function(e){function t(){var e,n,r,o;i(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.state={image:null},r.clientId=r.props.soundcloudConfig.clientId||v.defaultProps.soundcloudConfig.clientId,r.ref=function(e){r.player=e},o=n,a(r,o)}return u(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e,n){return l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"shouldComponentUpdate",this).call(this,e,n)||this.state.image!==n.image}},{key:"getSongData",value:function(e){var t=this;return g[e]?r.resolve(g[e]):(0,y.default)(b+"?url="+e+"&client_id="+this.clientId).then(function(n){return n.ok?(g[e]=n.json(),g[e]):void t.props.onError(new Error("SoundCloud track could not be resolved"))})}},{key:"load",value:function(e){var t=this,n=this.props,r=n.soundcloudConfig,o=n.onError;this.stop(),this.getSongData(e).then(function(e){if(t.mounted){if(!e.streamable)return void o(new Error("SoundCloud track is not streamable"));var n=e.artwork_url||e.user.avatar_url;n&&r.showArtwork&&t.setState({image:n.replace("-large","-t500x500")}),t.player.src=e.stream_url+"?client_id="+t.clientId}},o)}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.loop,r=e.controls,o={display:t?"block":"none",height:"100%",backgroundImage:this.state.image?"url("+this.state.image+")":null,backgroundSize:"cover",backgroundPosition:"center"};return f.default.createElement("div",{style:o},f.default.createElement("audio",{ref:this.ref,type:"audio/mpeg",preload:"auto",style:{width:"100%",height:"100%"},controls:r,loop:n}))}}],[{key:"canPlay",value:function(e){return m.test(e)}}]),t}(h.default);w.displayName="SoundCloud",t.default=w,e.exports=t.default}).call(t,n(1))},function(e,t,n){"use strict";(function(r,o){function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var 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(2),f=i(c),p="https://api.streamable.com/videos/",y=/^https?:\/\/streamable.com\/([a-z0-9]+)$/,d={},h=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),l(t,[{key:"getData",value:function(e){var t=this.props.onError,n=e.match(y)[1];return d[n]?r.resolve(d[n]):o(p+n).then(function(e){return 200===e.status?(d[n]=e.json(),d[n]):void t(new Error("Streamable track could not be resolved"))})}},{key:"load",value:function(e){var t=this,n=this.props.onError;this.stop(),this.getData(e).then(function(e){t.mounted&&(t.player.src=e.files.mp4.url)},n)}}],[{key:"canPlay",value:function(e){return y.test(e)}}]),t}(f.default);h.displayName="Streamable",t.default=h,e.exports=t.default}).call(t,n(1),n(5))},function(e,t,n){"use strict";(function(r,o){function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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 s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var 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(2),f=i(c),p="https://api.vid.me/videoByUrl/",y=/^https?:\/\/vid.me\/([a-z0-9]+)$/i,d={},h=function(e){function t(){return a(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),l(t,[{key:"getData",value:function(e){var t=this.props.onError,n=e.match(y)[1];return d[n]?r.resolve(d[n]):o(p+n).then(function(e){return 200===e.status?(d[n]=e.json(),d[n]):void t(new Error("Vidme track could not be resolved"))})}},{key:"load",value:function(e){var t=this,n=this.props.onError;this.stop(),this.getData(e).then(function(e){t.mounted&&(t.player.src=e.video.complete_url)},n)}}],[{key:"canPlay",value:function(e){return y.test(e)}}]),t}(f.default);h.displayName="Vidme",t.default=h,e.exports=t.default}).call(t,n(1),n(5))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var 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}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},c=n(0),f=r(c),p=n(17),y=n(3),d=r(y),h="https://player.vimeo.com/video/",v=/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,b=/^https?:\/\/player.vimeo.com/,m="https://vimeo.com/127250231",g={api:1,autoplay:0,badge:0,byline:0,fullscreen:1,portrait:0,title:0},w=function(e){function t(){var e,n,r,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.onMessage=function(e){if(b.test(e.origin)){r.origin=r.origin||e.origin;var t=JSON.parse(e.data);"ready"===t.event&&(r.postMessage("getDuration"),r.postMessage("addEventListener","playProgress"),r.postMessage("addEventListener","loadProgress"),r.postMessage("addEventListener","play"),r.postMessage("addEventListener","pause"),r.postMessage("addEventListener","finish")),"playProgress"===t.event&&(r.fractionPlayed=t.data.percent),"loadProgress"===t.event&&(r.fractionLoaded=t.data.percent),"play"===t.event&&r.onPlay(),"pause"===t.event&&r.props.onPause(),"finish"===t.event&&r.onEnded(),"getDuration"===t.method&&(r.duration=t.value,r.onReady())}},r.onEnded=function(){var e=r.props,t=e.loop,n=e.onEnded;t&&r.seekTo(0),n()},r.postMessage=function(e,t){if(r.origin){var n=JSON.stringify({method:e,value:t});return r.iframe.contentWindow&&r.iframe.contentWindow.postMessage(n,r.origin)}},r.ref=function(e){r.iframe=e},a=n,i(r,a)}return a(t,e), | ||
s(t,[{key:"componentDidMount",value:function(){var e=this.props,n=e.url,r=e.vimeoConfig;window.addEventListener("message",this.onMessage,!1),!n&&r.preload&&(this.preloading=!0,this.load(m)),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("message",this.onMessage,!1),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillUnmount",this).call(this)}},{key:"getIframeParams",value:function(){return u({},g,this.props.vimeoConfig.iframeParams)}},{key:"load",value:function(e){var t=e.match(v)[3];this.iframe.src=h+t+"?"+(0,p.stringify)(this.getIframeParams())}},{key:"play",value:function(){this.postMessage("play")}},{key:"pause",value:function(){this.postMessage("pause")}},{key:"stop",value:function(){this.iframe.src=""}},{key:"seekTo",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e),this.postMessage("seekTo",this.duration*e)}},{key:"setVolume",value:function(e){this.postMessage("setVolume",e)}},{key:"setPlaybackRate",value:function(e){this.postMessage("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getFractionPlayed",value:function(){return this.fractionPlayed||null}},{key:"getFractionLoaded",value:function(){return this.fractionLoaded||null}},{key:"render",value:function(){var e=this.getIframeParams(),t=e.fullscreen,n={display:this.props.url?"block":"none",width:"100%",height:"100%"};return f.default.createElement("iframe",{ref:this.ref,frameBorder:"0",style:n,allowFullScreen:t})}}],[{key:"canPlay",value:function(e){return v.test(e)}}]),t}(d.default);w.displayName="Vimeo",t.default=w,e.exports=t.default},function(e,t,n){"use strict";(function(r){function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 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}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},c=n(0),f=o(c),p=n(6),y=o(p),d=n(3),h=o(d),v="//fast.wistia.com/assets/external/E-v1.js",b="Wistia",m=/^https?:\/\/(.+)?(wistia.com|wi.st)\/(medias|embed)\/(.*)$/,g=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.onStart,r=t.onPause,o=t.onEnded;this.loadingSDK=!0,this.getSDK().then(function(){window._wq=window._wq||[],window._wq.push({id:e.getID(e.props.url),onReady:function(t){e.loadingSDK=!1,e.player=t,e.player.bind("start",n),e.player.bind("play",e.onPlay),e.player.bind("pause",r),e.player.bind("end",o),e.onReady()}})})}},{key:"getSDK",value:function(){return new r(function(e,t){window[b]?e():(0,y.default)(v,function(n,r){n&&t(n),e(r)})})}},{key:"getID",value:function(e){return e&&e.match(m)[4]}},{key:"load",value:function(e){var t=this.getID(e);this.isReady&&(this.player.replaceWith(t),this.props.onReady(),this.onReady())}},{key:"play",value:function(){this.isReady&&this.player&&this.player.play()}},{key:"pause",value:function(){this.isReady&&this.player&&this.player&&this.player.pause()}},{key:"stop",value:function(){this.isReady&&this.player&&this.player.pause()}},{key:"seekTo",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e),this.isReady&&this.player&&this.player.time(this.getDuration()*e)}},{key:"setVolume",value:function(e){this.isReady&&this.player&&this.player.volume&&this.player.volume(e)}},{key:"setPlaybackRate",value:function(e){this.isReady&&this.player&&this.player.playbackRate&&this.player.playbackRate(e)}},{key:"getDuration",value:function(){if(this.isReady&&this.player&&this.player.duration)return this.player.duration()}},{key:"getFractionPlayed",value:function(){return this.isReady&&this.player&&this.player.percentWatched?this.player.percentWatched():null}},{key:"getFractionLoaded",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%",display:this.props.url?"block":"none"};return f.default.createElement("div",{className:t,style:n})}}],[{key:"canPlay",value:function(e){return m.test(e)}}]),t}(h.default);g.displayName="Wistia",t.default=g,e.exports=t.default}).call(t,n(1))},function(e,t,n){"use strict";(function(r){function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},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}}(),c=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},f=n(0),p=o(f),y=n(6),d=o(y),h=n(3),v=o(h),b=n(13),m="https://www.youtube.com/iframe_api",g="YT",w="onYouTubeIframeAPIReady",_=/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/,O="https://www.youtube.com/watch?v=GlCmAC4MHek",P={autoplay:0,playsinline:1,showinfo:0,rel:0,iv_load_policy:3},k=function(e){function t(){var e,n,r,o;i(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.onStateChange=function(e){var t=e.data,n=r.props,o=n.onPause,i=n.onBuffer,a=window[g].PlayerState,u=a.PLAYING,s=a.PAUSED,l=a.BUFFERING,c=a.ENDED,f=a.CUED;t===u&&r.onPlay(),t===s&&o(),t===l&&i(),t===c&&r.onEnded(),t===f&&r.onReady()},r.onEnded=function(){var e=r.props,t=e.loop,n=e.onEnded;t&&r.seekTo(0),n()},r.ref=function(e){r.container=e},o=n,a(r,o)}return u(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this.props,n=e.url,r=e.youtubeConfig;!n&&r.preload&&(this.preloading=!0,this.load(O)),c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"getSDK",value:function(){return window[g]&&window[g].loaded?r.resolve(window[g]):new r(function(e,t){var n=window[w];window[w]=function(){n&&n(),e(window[g])},(0,d.default)(m,function(e){e&&t(e)})})}},{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.youtubeConfig,i=n.onError,a=e&&e.match(_)[1];return this.isReady?void this.player.cueVideoById({videoId:a,startSeconds:(0,b.parseStartTime)(e)}):this.loadingSDK?void(this.loadOnReady=e):(this.loadingSDK=!0,void this.getSDK().then(function(n){t.player=new n.Player(t.container,{width:"100%",height:"100%",videoId:a,playerVars:s({},P,{controls:r?1:0,start:(0,b.parseStartTime)(e),origin:window.location.origin},o.playerVars),events:{onReady:function(){t.loadingSDK=!1,t.onReady()},onStateChange:t.onStateChange,onError:function(e){return i(e.data)}}})},i))}},{key:"play",value:function(){this.isReady&&this.player.playVideo&&this.player.playVideo()}},{key:"pause",value:function(){this.isReady&&this.player.pauseVideo&&this.player.pauseVideo()}},{key:"stop",value:function(){this.isReady&&this.player.stopVideo&&this.player.stopVideo()}},{key:"seekTo",value:function(e){c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e),this.isReady&&this.player.seekTo&&this.player.seekTo(this.getDuration()*e)}},{key:"setVolume",value:function(e){this.isReady&&this.player.setVolume&&this.player.setVolume(100*e)}},{key:"setPlaybackRate",value:function(e){this.isReady&&this.player.setPlaybackRate&&this.player.setPlaybackRate(e)}},{key:"getDuration",value:function(){return this.isReady&&this.player.getDuration?this.player.getDuration():null}},{key:"getFractionPlayed",value:function(){return this.isReady&&this.getDuration()?this.player.getCurrentTime()/this.getDuration():null}},{key:"getFractionLoaded",value:function(){return this.isReady&&this.player.getVideoLoadedFraction?this.player.getVideoLoadedFraction():null}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.url?"block":"none"};return p.default.createElement("div",{style:e},p.default.createElement("div",{ref:this.ref}))}}],[{key:"canPlay",value:function(e){return _.test(e)}}]),t}(v.default);k.displayName="YouTube",t.default=k,e.exports=t.default}).call(t,n(1))},function(e,t,n){"use strict";function r(e){var t=e.match(a);if(t){var n=t[1];if(n.match(u))return o(n);if(s.test(n))return parseInt(n,10)}return 0}function o(e){for(var t=0,n=u.exec(e);null!==n;){var r=n,o=i(r,3),a=o[1],s=o[2];"h"===s&&(t+=60*parseInt(a,10)*60),"m"===s&&(t+=60*parseInt(a,10)),"s"===s&&(t+=parseInt(a,10)),n=u.exec(e)}return t}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}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=r;var a=/[?&#](?:start|t)=([0-9hms]+)/,u=/(\d+)(h|m|s)/g,s=/^\d+$/},function(e,t,n){(function(n){var r,o,i;!function(n,a){o=[t,e],r=a,i="function"==typeof r?r.apply(t,o):r,!(void 0!==i&&(e.exports=i))}(this,function(e,t){"use strict";function r(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function o(e){try{delete window[e]}catch(t){window[e]=void 0}}function i(e){var t=document.getElementById(e);document.getElementsByTagName("head")[0].removeChild(t)}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=e,s=t.timeout||u.timeout,l=t.jsonpCallback||u.jsonpCallback,c=void 0;return new n(function(u,f){var p=t.jsonpCallbackFunction||r(),y=l+"_"+p;window[p]=function(e){u({ok:!0,json:function(){return n.resolve(e)}}),c&&clearTimeout(c),i(y),o(p)},a+=a.indexOf("?")===-1?"?":"&";var d=document.createElement("script");d.setAttribute("src",""+a+l+"="+p),d.id=y,document.getElementsByTagName("head")[0].appendChild(d),c=setTimeout(function(){f(new Error("JSONP request to "+e+" timed out")),o(p),i(y)},s)})}var u={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};t.exports=a})}).call(t,n(1))},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(e,t){for(var n,o,u=r(e),s=1;s<arguments.length;s++){n=Object(arguments[s]);for(var l in n)i.call(n,l)&&(u[l]=n[l]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(n);for(var c=0;c<o.length;c++)a.call(n,o[c])&&(u[o[c]]=n[o[c]])}}return u}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){h&&y&&(h=!1,y.length?d=y.concat(d):v=-1,d.length&&u())}function u(){if(!h){var e=o(a);h=!0;for(var t=d.length;t;){for(y=d,d=[];++v<t;)y&&y[v].run();v=-1,t=d.length}y=null,h=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function l(){}var c,f,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var y,d=[],h=!1,v=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new s(e,t)),1!==d.length||h||o(u)},s.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,n){"use strict";function r(e,t){return t.encode?t.strict?o(e):encodeURIComponent(e):e}var o=n(18),i=n(15);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){var t=Object.create(null);return"string"!=typeof e?t:(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(function(e){var n=e.replace(/\+/g," ").split("="),r=n.shift(),o=n.length>0?n.join("="):void 0;r=decodeURIComponent(r),o=void 0===o?null:decodeURIComponent(o),void 0===t[r]?t[r]=o:Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]}),t):t},t.stringify=function(e,t){var n={encode:!0,strict:!0};return t=i(n,t),e?Object.keys(e).sort().map(function(n){var o=e[n];if(void 0===o)return"";if(null===o)return r(n,t);if(Array.isArray(o)){var i=[];return o.slice().forEach(function(e){void 0!==e&&(null===e?i.push(r(n,t)):i.push(r(n,t)+"="+r(e,t)))}),i.join("&")}return r(n,t)+"="+r(o,t)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},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}}(),c=n(0),f=r(c),p=n(4),y=n(12),d=r(y),h=n(7),v=r(h),b=n(10),m=r(b),g=n(2),w=r(g),_=n(8),O=r(_),P=n(9),k=r(P),j=n(11),E=r(j),T=function(e){function t(){var e,n,r,u;i(this,t);for(var l=arguments.length,c=Array(l),p=0;p<l;p++)c[p]=arguments[p];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),r.seekTo=function(e){r.player&&r.player.seekTo(e)},r.progress=function(){if(r.props.url&&r.player){var e=r.player.getFractionLoaded()||0,t=r.player.getFractionPlayed()||0,n={};e!==r.prevLoaded&&(n.loaded=e),t!==r.prevPlayed&&(n.played=t),(n.loaded||n.played)&&r.props.onProgress(n),r.prevLoaded=e,r.prevPlayed=t}r.progressTimeout=setTimeout(r.progress,r.props.progressFrequency)},r.ref=function(e){r.player=e},r.renderPlayer=function(e){var t=e.canPlay(r.props.url),n=r.props,i=n.youtubeConfig,a=n.soundcloudConfig,u=n.vimeoConfig,l=n.fileConfig,c=o(n,["youtubeConfig","soundcloudConfig","vimeoConfig","fileConfig"]),p=t?s({},c,{ref:r.ref}):{};return f.default.createElement(e,s({key:e.displayName,youtubeConfig:i,soundcloudConfig:a,vimeoConfig:u,fileConfig:l},p))},u=n,a(r,u)}return u(t,e),l(t,[{key:"componentDidMount",value:function(){this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout)}},{key:"shouldComponentUpdate",value:function(e){return this.props.url!==e.url||this.props.playing!==e.playing||this.props.volume!==e.volume||this.props.playbackRate!==e.playbackRate||this.props.height!==e.height||this.props.width!==e.width||this.props.hidden!==e.hidden}},{key:"renderPlayers",value:function(){var e=this.props,t=e.url,n=e.youtubeConfig,r=e.vimeoConfig,o=[];return d.default.canPlay(t)?o.push(d.default):v.default.canPlay(t)?o.push(v.default):m.default.canPlay(t)?o.push(m.default):O.default.canPlay(t)?o.push(O.default):k.default.canPlay(t)?o.push(k.default):E.default.canPlay(t)?o.push(E.default):t&&o.push(w.default),!d.default.canPlay(t)&&n.preload&&o.push(d.default),!m.default.canPlay(t)&&r.preload&&o.push(m.default),o.map(this.renderPlayer)}},{key:"render",value:function(){var e=this.props,t=e.style,n=e.width,r=e.height,o=e.className,i=e.hidden,a=this.renderPlayers();return f.default.createElement("div",{style:s({},t,{width:n,height:r}),className:o,hidden:i},a)}}]),t}(c.Component);T.displayName="ReactPlayer",T.propTypes=p.propTypes,T.defaultProps=p.defaultProps,t.default=T,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.i=function(e){return e},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=17)}([function(e,t,n){(function(t,r,o){!function(t,n){e.exports=n()}(0,function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function r(e){return"function"==typeof e}function i(e){K=e}function a(e){H=e}function u(){return void 0!==$?function(){$(l)}:s()}function s(){var e=setTimeout;return function(){return e(l,1)}}function l(){for(var e=0;e<W;e+=2){(0,Q[e])(Q[e+1]),Q[e]=void 0,Q[e+1]=void 0}W=0}function c(e,t){var n=arguments,r=this,o=new this.constructor(p);void 0===o[ee]&&x(o);var i=r._state;return i?function(){var e=n[i-1];H(function(){return R(i,o,e,r._result)})}():k(r,o,e,t),o}function f(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(p);return w(n,e),n}function p(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function h(e){try{return e.then}catch(e){return oe.error=e,oe}}function v(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}function b(e,t,n){H(function(e){var r=!1,o=v(n,t,function(n){r||(r=!0,t!==n?w(e,n):O(e,n))},function(t){r||(r=!0,P(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,P(e,o))},e)}function m(e,t){t._state===ne?O(e,t._result):t._state===re?P(e,t._result):k(t,void 0,function(t){return w(e,t)},function(t){return P(e,t)})}function g(e,t,n){t.constructor===e.constructor&&n===c&&t.constructor.resolve===f?m(e,t):n===oe?(P(e,oe.error),oe.error=null):void 0===n?O(e,t):r(n)?b(e,t,n):O(e,t)}function w(t,n){t===n?P(t,y()):e(n)?g(t,n,h(n)):O(t,n)}function _(e){e._onerror&&e._onerror(e._result),j(e)}function O(e,t){e._state===te&&(e._result=t,e._state=ne,0!==e._subscribers.length&&H(j,e))}function P(e,t){e._state===te&&(e._state=re,e._result=t,H(_,e))}function k(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ne]=n,o[i+re]=r,0===i&&e._state&&H(j,e)}function j(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,i=e._result,a=0;a<t.length;a+=3)r=t[a],o=t[a+n],r?R(n,r,o,i):o(i);e._subscribers.length=0}}function E(){this.error=null}function T(e,t){try{return e(t)}catch(e){return ie.error=e,ie}}function R(e,t,n,o){var i=r(n),a=void 0,u=void 0,s=void 0,l=void 0;if(i){if(a=T(n,o),a===ie?(l=!0,u=a.error,a.error=null):s=!0,t===a)return void P(t,d())}else a=o,s=!0;t._state!==te||(i&&s?w(t,a):l?P(t,u):e===ne?O(t,a):e===re&&P(t,a))}function C(e,t){try{t(function(t){w(e,t)},function(t){P(e,t)})}catch(t){P(e,t)}}function S(){return ae++}function x(e){e[ee]=ae++,e._state=void 0,e._result=void 0,e._subscribers=[]}function A(e,t){this._instanceConstructor=e,this.promise=new e(p),this.promise[ee]||x(this.promise),q(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&O(this.promise,this._result))):P(this.promise,D())}function D(){return new Error("Array Methods must be provided an Array")}function M(e){return new A(this,e).promise}function I(e){var t=this;return new t(q(e)?function(n,r){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(n,r)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function F(e){var t=this,n=new t(p);return P(n,e),n}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function L(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(e){this[ee]=S(),this._result=this._state=void 0,this._subscribers=[],p!==e&&("function"!=typeof e&&B(),this instanceof U?C(this,e):L())}function N(){var e=void 0;if(void 0!==o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=U}var V=void 0;V=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var q=V,W=0,$=void 0,K=void 0,H=function(e,t){Q[W]=e,Q[W+1]=t,2===(W+=2)&&(K?K(l):Z())},Y="undefined"!=typeof window?window:void 0,G=Y||{},z=G.MutationObserver||G.WebKitMutationObserver,J="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),X="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Q=new Array(1e3),Z=void 0;Z=J?function(){return function(){return t.nextTick(l)}}():z?function(){var e=0,t=new z(l),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}():X?function(){var e=new MessageChannel;return e.port1.onmessage=l,function(){return e.port2.postMessage(0)}}():void 0===Y?function(){try{var e=n(28);return $=e.runOnLoop||e.runOnContext,u()}catch(e){return s()}}():s();var ee=Math.random().toString(36).substring(16),te=void 0,ne=1,re=2,oe=new E,ie=new E,ae=0;return A.prototype._enumerate=function(){for(var e=this.length,t=this._input,n=0;this._state===te&&n<e;n++)this._eachEntry(t[n],n)},A.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===f){var o=h(e);if(o===c&&e._state!==te)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(n===U){var i=new n(p);g(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(r(e),t)},A.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===te&&(this._remaining--,e===re?P(r,n):this._result[t]=n),0===this._remaining&&O(r,this._result)},A.prototype._willSettleAt=function(e,t){var n=this;k(e,void 0,function(e){return n._settledAt(ne,t,e)},function(e){return n._settledAt(re,t,e)})},U.all=M,U.race=I,U.resolve=f,U.reject=F,U._setScheduler=i,U._setAsap=a,U._asap=H,U.prototype={constructor:U,then:c,catch:function(e){return this.then(null,e)}},U.polyfill=N,U.Promise=U,U}),e.exports=o.Promise}).call(t,n(21),n(0),n(27))},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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var 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}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},c=n(1),f=r(c),p=n(3),y=r(p),d=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,h=function(e){function t(){var e,n,r,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.ref=function(e){r.player=e},a=n,i(r,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this,n=this.props,r=n.playsinline,o=n.onPause,i=n.onEnded,a=n.onError;this.player.addEventListener("canplay",this.onReady),this.player.addEventListener("play",this.onPlay),this.player.addEventListener("pause",function(){e.mounted&&o()}),this.player.addEventListener("ended",i),this.player.addEventListener("error",a),r&&(this.player.setAttribute("playsinline",""),this.player.setAttribute("webkit-playsinline","")),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"componentWillUnmount",value:function(){var e=this.props,n=e.onPause,r=e.onEnded,o=e.onError;this.player.removeEventListener("canplay",this.onReady),this.player.removeEventListener("play",this.onPlay),this.player.removeEventListener("pause",n),this.player.removeEventListener("ended",r),this.player.removeEventListener("error",o),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillUnmount",this).call(this)}},{key:"load",value:function(e){this.player.src=e,this.props.playing&&this.player.load()}},{key:"play",value:function(){this.player.play()}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src")}},{key:"seekTo",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e),this.player.currentTime=this.getDuration()*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.isReady?this.player.duration:null}},{key:"getFractionPlayed",value:function(){return this.isReady?this.player.currentTime/this.getDuration():null}},{key:"getFractionLoaded",value:function(){return this.isReady&&0!==this.player.buffered.length?this.player.buffered.end(0)/this.getDuration():null}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.loop,r=e.controls,o=e.fileConfig,i=d.test(t)?"audio":"video",a={width:"100%",height:"100%",display:t?"block":"none"};return f.default.createElement(i,u({ref:this.ref,style:a,preload:"auto",controls:r,loop:n},o.attributes))}}],[{key:"canPlay",value:function(e){return!0}}]),t}(y.default);h.displayName="FilePlayer",t.default=h,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 i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var 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(1),s=n(4),l=function(e){function t(){var e,n,i,a;r(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=i=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),i.isReady=!1,i.startOnPlay=!0,i.durationOnPlay=!1,i.seekOnPlay=null,i.onPlay=function(){var e=i.props,t=e.volume,n=e.onStart,r=e.onPlay,o=e.onDuration,a=e.playbackRate;i.startOnPlay&&(i.setPlaybackRate(a),i.setVolume(t),n(),i.startOnPlay=!1),r(),i.seekOnPlay&&(i.seekTo(i.seekOnPlay),i.seekOnPlay=null),i.durationOnPlay&&(o(i.getDuration()),i.durationOnPlay=!1)},i.onReady=function(){var e=i.props,t=e.onReady,n=e.playing,r=e.onDuration;i.isReady=!0,t(),(n||i.preloading)&&(i.preloading=!1,i.loadOnReady?(i.load(i.loadOnReady),i.loadOnReady=null):i.play());var o=i.getDuration();o?r(o):i.durationOnPlay=!0},a=n,o(i,a)}return i(t,e),a(t,[{key:"componentDidMount",value:function(){var e=this.props.url;this.mounted=!0,e&&this.load(e)}},{key:"componentWillUnmount",value:function(){this.stop(),this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.url,r=t.playing,o=t.volume,i=t.playbackRate;n!==e.url&&e.url?(this.seekOnPlay=null,this.startOnPlay=!0,this.load(e.url)):n&&!e.url?(this.stop(),clearTimeout(this.updateTimeout)):!r&&e.playing?this.play():r&&!e.playing?this.pause():o!==e.volume?this.setVolume(e.volume):i!==e.playbackRate&&this.setPlaybackRate(e.playbackRate)}},{key:"shouldComponentUpdate",value:function(e){return this.props.url!==e.url}},{key:"seekTo",value:function(e){var t=this;this.isReady||0===e||(this.seekOnPlay=e,setTimeout(function(){t.seekOnPlay=null},5e3))}}]),t}(u.Component);l.propTypes=s.propTypes,l.defaultProps=s.defaultProps,t.default=l,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultProps=t.propTypes=void 0;var r=n(24),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i=o.default.string,a=o.default.bool,u=o.default.number,s=o.default.oneOfType,l=o.default.shape,c=o.default.object,f=o.default.func;t.propTypes={url:i,playing:a,loop:a,controls:a,volume:u,playbackRate:u,width:s([i,u]),height:s([i,u]),hidden:a,className:i,style:c,progressFrequency:u,playsinline:a,soundcloudConfig:l({clientId:i,showArtwork:a}),youtubeConfig:l({playerVars:c,preload:a}),vimeoConfig:l({iframeParams:c,preload:a}),vidmeConfig:l({format:i}),fileConfig:l({attributes:c}),onReady:f,onStart:f,onPlay:f,onPause:f,onBuffer:f,onEnded:f,onError:f,onDuration:f,onProgress:f},t.defaultProps={playing:!1,loop:!1,controls:!1,volume:.8,playbackRate:1,width:640,height:360,hidden:!1,progressFrequency:1e3,playsinline:!1,soundcloudConfig:{clientId:"e8b6f84fbcad14c301ca1355cae1dea2",showArtwork:!0},youtubeConfig:{playerVars:{},preload:!1},vimeoConfig:{iframeParams:{},preload:!1},vidmeConfig:{format:null},fileConfig:{attributes:{}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onProgress:function(){}}},function(e,t,n){(function(t){!function(e){"use strict";function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function r(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return m.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function a(e){if(e.bodyUsed)return t.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new t(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader,n=u(t);return t.readAsArrayBuffer(e),n}function l(e){var t=new FileReader,n=u(t);return t.readAsText(e),n}function c(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(m.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(m.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(m.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(m.arrayBuffer&&m.blob&&w(e))this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!m.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!_(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=f(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):m.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},m.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(c(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},m.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function y(e){var t=e.toUpperCase();return O.indexOf(t)>-1?t:e}function d(e,t){t=t||{};var n=t.body;if(e instanceof d){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=y(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function h(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function v(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function b(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var m={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(m.arrayBuffer)var g=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=function(e){return e&&DataView.prototype.isPrototypeOf(e)},_=ArrayBuffer.isView||function(e){return e&&g.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,t){e=n(e),t=r(t);var o=this.map[e];this.map[e]=o?o+","+t:t},i.prototype.delete=function(e){delete this.map[n(e)]},i.prototype.get=function(e){return e=n(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},i.prototype.set=function(e,t){this.map[n(e)]=r(t)},i.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),o(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),o(e)},m.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var O=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},p.call(d.prototype),p.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var P=[301,302,303,307,308];b.redirect=function(e,t){if(-1===P.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=d,e.Response=b,e.fetch=function(e,n){return new t(function(t,r){var o=new d(e,n),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:v(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var n="response"in i?i.response:i.responseText;t(new b(n,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&m.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this),e.exports=self.fetch}).call(t,n(0))},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,i,a,u,s){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,a,u,s],f=0;l=new Error(t.replace(/%s/g,function(){return c[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(6),o=r;e.exports=o},function(e,t){function n(e,t){for(var n in t)e.setAttribute(n,t[n])}function r(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 o(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,t,i){var a=document.head||document.getElementsByTagName("head")[0],u=document.createElement("script");"function"==typeof t&&(i=t,t={}),t=t||{},i=i||function(){},u.type=t.type||"text/javascript",u.charset=t.charset||"utf8",u.async=!("async"in t)||!!t.async,u.src=e,t.attrs&&n(u,t.attrs),t.text&&(u.text=""+t.text),("onload"in u?r:o)(u,i),u.onload||r(u,i),a.appendChild(u)}},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){function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 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}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},c=n(1),f=o(c),p=n(19),y=o(p),d=n(2),h=o(d),v=n(4),b=/^https?:\/\/(soundcloud.com|snd.sc)\/([a-z0-9-_]+\/[a-z0-9-_]+)$/,m={},g=function(e){function t(){var e,n,r,o;i(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.state={image:null},r.clientId=r.props.soundcloudConfig.clientId||v.defaultProps.soundcloudConfig.clientId,r.ref=function(e){r.player=e},o=n,a(r,o)}return u(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e,n){return l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"shouldComponentUpdate",this).call(this,e,n)||this.state.image!==n.image}},{key:"getSongData",value:function(e){var t=this;return m[e]?r.resolve(m[e]):(0,y.default)("//api.soundcloud.com/resolve.json?url="+e+"&client_id="+this.clientId).then(function(n){if(n.ok)return m[e]=n.json(),m[e];t.props.onError(new Error("SoundCloud track could not be resolved"))})}},{key:"load",value:function(e){var t=this,n=this.props,r=n.soundcloudConfig,o=n.onError;this.stop(),this.getSongData(e).then(function(e){if(t.mounted){if(!e.streamable)return void o(new Error("SoundCloud track is not streamable"));var n=e.artwork_url||e.user.avatar_url;n&&r.showArtwork&&t.setState({image:n.replace("-large","-t500x500")}),t.player.src=e.stream_url+"?client_id="+t.clientId}},o)}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.loop,r=e.controls,o={display:t?"block":"none",height:"100%",backgroundImage:this.state.image?"url("+this.state.image+")":null,backgroundSize:"cover",backgroundPosition:"center"};return f.default.createElement("div",{style:o},f.default.createElement("audio",{ref:this.ref,type:"audio/mpeg",preload:"auto",style:{width:"100%",height:"100%"},controls:r,loop:n}))}}],[{key:"canPlay",value:function(e){return b.test(e)}}]),t}(h.default);g.displayName="SoundCloud",t.default=g,e.exports=t.default}).call(t,n(0))},function(e,t,n){"use strict";(function(r,o){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 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}}(),l=n(2),c=function(e){return e&&e.__esModule?e:{default:e}}(l),f=/^https?:\/\/streamable.com\/([a-z0-9]+)$/,p={},y=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"getData",value:function(e){var t=this.props.onError,n=e.match(f)[1];return p[n]?r.resolve(p[n]):o("https://api.streamable.com/videos/"+n).then(function(e){if(200===e.status)return p[n]=e.json(),p[n];t(new Error("Streamable track could not be resolved"))})}},{key:"load",value:function(e){var t=this,n=this.props.onError;this.stop(),this.getData(e).then(function(e){t.mounted&&(t.player.src=e.files.mp4.url)},n)}}],[{key:"canPlay",value:function(e){return f.test(e)}}]),t}(c.default);y.displayName="Streamable",t.default=y,e.exports=t.default}).call(t,n(0),n(5))},function(e,t,n){"use strict";(function(r,o){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 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}}(),l=n(2),c=function(e){return e&&e.__esModule?e:{default:e}}(l),f=/^https?:\/\/vid.me\/([a-z0-9]+)$/i,p={},y=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"getData",value:function(e){var t=this.props.onError,n=e.match(f)[1];return p[n]?r.resolve(p[n]):o("https://api.vid.me/videoByUrl/"+n).then(function(e){if(200===e.status)return p[n]=e.json(),p[n];t(new Error("Vidme track could not be resolved"))})}},{key:"getURL",value:function(e){var t=e.video,n=this.props.vidmeConfig;if(n.format&&t.formats&&0!==t.formats.length){var r=t.formats.findIndex(function(e){return e.type===n.format});if(-1!==r)return t.formats[r].uri;console.warn('Vidme format "'+n.format+'" was not found for '+t.full_url)}return t.complete_url}},{key:"load",value:function(e){var t=this,n=this.props.onError;this.stop(),this.getData(e).then(function(e){t.mounted&&(t.player.src=t.getURL(e))},n)}}],[{key:"canPlay",value:function(e){return f.test(e)}}]),t}(c.default);y.displayName="Vidme",t.default=y,e.exports=t.default}).call(t,n(0),n(5))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var 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}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},c=n(1),f=r(c),p=n(25),y=n(3),d=r(y),h=/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/,v=/^https?:\/\/player.vimeo.com/,b={api:1,autoplay:0,badge:0,byline:0,fullscreen:1,portrait:0,title:0},m=function(e){function t(){var e,n,r,a;o(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.onMessage=function(e){if(v.test(e.origin)){r.origin=r.origin||e.origin;var t=JSON.parse(e.data);"ready"===t.event&&(r.postMessage("getDuration"),r.postMessage("addEventListener","playProgress"),r.postMessage("addEventListener","loadProgress"),r.postMessage("addEventListener","play"),r.postMessage("addEventListener","pause"),r.postMessage("addEventListener","finish")),"playProgress"===t.event&&(r.fractionPlayed=t.data.percent),"loadProgress"===t.event&&(r.fractionLoaded=t.data.percent),"play"===t.event&&r.onPlay(),"pause"===t.event&&r.props.onPause(),"finish"===t.event&&r.onEnded(),"getDuration"===t.method&&(r.duration=t.value,r.onReady())}},r.onEnded=function(){var e=r.props,t=e.loop,n=e.onEnded;t&&r.seekTo(0),n()},r.postMessage=function(e,t){if(r.origin){var n=JSON.stringify({method:e,value:t});return r.iframe.contentWindow&&r.iframe.contentWindow.postMessage(n,r.origin)}},r.ref=function(e){r.iframe=e},a=n,i(r,a)}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this.props,n=e.url,r=e.vimeoConfig;window.addEventListener("message",this.onMessage,!1),!n&&r.preload&&(this.preloading=!0,this.load("https://vimeo.com/127250231")),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("message",this.onMessage,!1),l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentWillUnmount",this).call(this)}},{key:"getIframeParams",value:function(){return u({},b,this.props.vimeoConfig.iframeParams)}},{key:"load",value:function(e){var t=e.match(h)[3];this.iframe.src="https://player.vimeo.com/video/"+t+"?"+(0,p.stringify)(this.getIframeParams())}},{key:"play",value:function(){this.postMessage("play")}},{key:"pause",value:function(){this.postMessage("pause")}},{key:"stop",value:function(){this.iframe.src=""}},{key:"seekTo",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e),this.postMessage("seekTo",this.duration*e)}},{key:"setVolume",value:function(e){this.postMessage("setVolume",e)}},{key:"setPlaybackRate",value:function(e){this.postMessage("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getFractionPlayed",value:function(){return this.fractionPlayed||null}},{key:"getFractionLoaded",value:function(){return this.fractionLoaded||null}},{key:"render",value:function(){var e=this.getIframeParams(),t=e.fullscreen,n={display:this.props.url?"block":"none",width:"100%",height:"100%"};return f.default.createElement("iframe",{ref:this.ref,frameBorder:"0",style:n,allowFullScreen:t})}}],[{key:"canPlay",value:function(e){return h.test(e)}}]),t}(d.default);m.displayName="Vimeo",t.default=m,e.exports=t.default},function(e,t,n){"use strict";(function(r){function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 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}}(),l=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},c=n(1),f=o(c),p=n(9),y=o(p),d=n(3),h=o(d),v=/^https?:\/\/(.+)?(wistia.com|wi.st)\/(medias|embed)\/(.*)$/,b=function(e){function t(){return i(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.onStart,r=t.onPause,o=t.onEnded;this.loadingSDK=!0,this.getSDK().then(function(){window._wq=window._wq||[],window._wq.push({id:e.getID(e.props.url),onReady:function(t){e.loadingSDK=!1,e.player=t,e.player.bind("start",n),e.player.bind("play",e.onPlay),e.player.bind("pause",r),e.player.bind("end",o),e.onReady()}})})}},{key:"getSDK",value:function(){return new r(function(e,t){window.Wistia?e():(0,y.default)("//fast.wistia.com/assets/external/E-v1.js",function(n,r){n&&t(n),e(r)})})}},{key:"getID",value:function(e){return e&&e.match(v)[4]}},{key:"load",value:function(e){var t=this.getID(e);this.isReady&&(this.player.replaceWith(t),this.props.onReady(),this.onReady())}},{key:"play",value:function(){this.isReady&&this.player&&this.player.play()}},{key:"pause",value:function(){this.isReady&&this.player&&this.player&&this.player.pause()}},{key:"stop",value:function(){this.isReady&&this.player&&this.player.pause()}},{key:"seekTo",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e),this.isReady&&this.player&&this.player.time(this.getDuration()*e)}},{key:"setVolume",value:function(e){this.isReady&&this.player&&this.player.volume&&this.player.volume(e)}},{key:"setPlaybackRate",value:function(e){this.isReady&&this.player&&this.player.playbackRate&&this.player.playbackRate(e)}},{key:"getDuration",value:function(){if(this.isReady&&this.player&&this.player.duration)return this.player.duration()}},{key:"getFractionPlayed",value:function(){return this.isReady&&this.player&&this.player.percentWatched?this.player.percentWatched():null}},{key:"getFractionLoaded",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%",display:this.props.url?"block":"none"};return f.default.createElement("div",{className:t,style:n})}}],[{key:"canPlay",value:function(e){return v.test(e)}}]),t}(h.default);b.displayName="Wistia",t.default=b,e.exports=t.default}).call(t,n(0))},function(e,t,n){"use strict";(function(r){function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},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}}(),c=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},f=n(1),p=o(f),y=n(9),d=o(y),h=n(3),v=o(h),b=n(18),m="YT",g=/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/,w={autoplay:0,playsinline:1,showinfo:0,rel:0,iv_load_policy:3},_=function(e){function t(){var e,n,r,o;i(this,t);for(var u=arguments.length,s=Array(u),l=0;l<u;l++)s[l]=arguments[l];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),r.onStateChange=function(e){var t=e.data,n=r.props,o=n.onPause,i=n.onBuffer,a=window[m].PlayerState,u=a.PLAYING,s=a.PAUSED,l=a.BUFFERING,c=a.ENDED,f=a.CUED;t===u&&r.onPlay(),t===s&&o(),t===l&&i(),t===c&&r.onEnded(),t===f&&r.onReady()},r.onEnded=function(){var e=r.props,t=e.loop,n=e.onEnded;t&&r.seekTo(0),n()},r.ref=function(e){r.container=e},o=n,a(r,o)}return u(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this.props,n=e.url,r=e.youtubeConfig;!n&&r.preload&&(this.preloading=!0,this.load("https://www.youtube.com/watch?v=GlCmAC4MHek")),c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this)}},{key:"getSDK",value:function(){return window[m]&&window[m].loaded?r.resolve(window[m]):new r(function(e,t){var n=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){n&&n(),e(window[m])},(0,d.default)("https://www.youtube.com/iframe_api",function(e){e&&t(e)})})}},{key:"load",value:function(e){var t=this,n=this.props,r=n.playsinline,o=n.controls,i=n.youtubeConfig,a=n.onError,u=e&&e.match(g)[1];return this.isReady?void this.player.cueVideoById({videoId:u,startSeconds:(0,b.parseStartTime)(e)}):this.loadingSDK?void(this.loadOnReady=e):(this.loadingSDK=!0,void this.getSDK().then(function(n){t.player=new n.Player(t.container,{width:"100%",height:"100%",videoId:u,playerVars:s({},w,{controls:o?1:0,start:(0,b.parseStartTime)(e),origin:window.location.origin,playsinline:r},i.playerVars),events:{onReady:function(){t.loadingSDK=!1,t.onReady()},onStateChange:t.onStateChange,onError:function(e){return a(e.data)}}})},a))}},{key:"play",value:function(){this.isReady&&this.player.playVideo&&this.player.playVideo()}},{key:"pause",value:function(){this.isReady&&this.player.pauseVideo&&this.player.pauseVideo()}},{key:"stop",value:function(){this.isReady&&this.player.stopVideo&&this.player.stopVideo()}},{key:"seekTo",value:function(e){c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"seekTo",this).call(this,e),this.isReady&&this.player.seekTo&&this.player.seekTo(this.getDuration()*e)}},{key:"setVolume",value:function(e){this.isReady&&this.player.setVolume&&this.player.setVolume(100*e)}},{key:"setPlaybackRate",value:function(e){this.isReady&&this.player.setPlaybackRate&&this.player.setPlaybackRate(e)}},{key:"getDuration",value:function(){return this.isReady&&this.player.getDuration?this.player.getDuration():null}},{key:"getFractionPlayed",value:function(){return this.isReady&&this.getDuration()?this.player.getCurrentTime()/this.getDuration():null}},{key:"getFractionLoaded",value:function(){return this.isReady&&this.player.getVideoLoadedFraction?this.player.getVideoLoadedFraction():null}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.url?"block":"none"};return p.default.createElement("div",{style:e},p.default.createElement("div",{ref:this.ref}))}}],[{key:"canPlay",value:function(e){return g.test(e)}}]),t}(v.default);_.displayName="YouTube",t.default=_,e.exports=t.default}).call(t,n(0))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},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}}(),c=n(1),f=r(c),p=n(4),y=n(16),d=r(y),h=n(11),v=r(h),b=n(14),m=r(b),g=n(2),w=r(g),_=n(12),O=r(_),P=n(13),k=r(P),j=n(15),E=r(j),T=function(e){function t(){var e,n,r,u;i(this,t);for(var l=arguments.length,c=Array(l),p=0;p<l;p++)c[p]=arguments[p];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),r.seekTo=function(e){r.player&&r.player.seekTo(e)},r.getDuration=function(){return r.player?r.player.getDuration():null},r.getCurrentTime=function(){if(!r.player)return null;var e=r.player.getDuration(),t=r.player.getFractionPlayed();return null===e||null===t?null:t*e},r.progress=function(){if(r.props.url&&r.player){var e=r.player.getFractionLoaded()||0,t=r.player.getFractionPlayed()||0,n=r.player.getDuration(),o={};e!==r.prevLoaded&&(o.loaded=e,n&&(o.loadedSeconds=o.loaded*n)),t!==r.prevPlayed&&(o.played=t,n&&(o.playedSeconds=o.played*n)),(o.loaded||o.played)&&r.props.onProgress(o),r.prevLoaded=e,r.prevPlayed=t}r.progressTimeout=setTimeout(r.progress,r.props.progressFrequency)},r.ref=function(e){r.player=e},r.renderPlayer=function(e){var t=e.canPlay(r.props.url),n=r.props,i=n.youtubeConfig,a=n.soundcloudConfig,u=n.vimeoConfig,l=n.vidmeConfig,c=n.fileConfig,p=o(n,["youtubeConfig","soundcloudConfig","vimeoConfig","vidmeConfig","fileConfig"]),y=t?s({},p,{ref:r.ref}):{};return f.default.createElement(e,s({key:e.displayName,youtubeConfig:i,soundcloudConfig:a,vimeoConfig:u,vidmeConfig:l,fileConfig:c},y))},u=n,a(r,u)}return u(t,e),l(t,[{key:"componentDidMount",value:function(){this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout)}},{key:"shouldComponentUpdate",value:function(e){return this.props.url!==e.url||this.props.playing!==e.playing||this.props.volume!==e.volume||this.props.playbackRate!==e.playbackRate||this.props.height!==e.height||this.props.width!==e.width||this.props.hidden!==e.hidden}},{key:"renderPlayers",value:function(){var e=this.props,t=e.url,n=e.youtubeConfig,r=e.vimeoConfig,o=[];return d.default.canPlay(t)?o.push(d.default):v.default.canPlay(t)?o.push(v.default):m.default.canPlay(t)?o.push(m.default):O.default.canPlay(t)?o.push(O.default):k.default.canPlay(t)?o.push(k.default):E.default.canPlay(t)?o.push(E.default):t&&o.push(w.default),!d.default.canPlay(t)&&n.preload&&o.push(d.default),!m.default.canPlay(t)&&r.preload&&o.push(m.default),o.map(this.renderPlayer)}},{key:"render",value:function(){var e=this.props,t=e.style,n=e.width,r=e.height,o=e.className,i=e.hidden,a=this.renderPlayers();return f.default.createElement("div",{style:s({},t,{width:n,height:r}),className:o,hidden:i},a)}}]),t}(c.Component);T.displayName="ReactPlayer",T.propTypes=p.propTypes,T.defaultProps=p.defaultProps,t.default=T,e.exports=t.default},function(e,t,n){"use strict";function r(e){var t=e.match(a);if(t){var n=t[1];if(n.match(u))return o(n);if(s.test(n))return parseInt(n,10)}return 0}function o(e){for(var t=0,n=u.exec(e);null!==n;){var r=n,o=i(r,3),a=o[1],s=o[2];"h"===s&&(t+=60*parseInt(a,10)*60),"m"===s&&(t+=60*parseInt(a,10)),"s"===s&&(t+=parseInt(a,10)),n=u.exec(e)}return t}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}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=r;var a=/[?&#](?:start|t)=([0-9hms]+)/,u=/(\d+)(h|m|s)/g,s=/^\d+$/},function(e,t,n){(function(n){var r,o,i;!function(n,a){o=[t,e],r=a,void 0!==(i="function"==typeof r?r.apply(t,o):r)&&(e.exports=i)}(0,function(e,t){"use strict";function r(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function o(e){try{delete window[e]}catch(t){window[e]=void 0}}function i(e){var t=document.getElementById(e);document.getElementsByTagName("head")[0].removeChild(t)}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=e,s=t.timeout||u.timeout,l=t.jsonpCallback||u.jsonpCallback,c=void 0;return new n(function(u,f){var p=t.jsonpCallbackFunction||r(),y=l+"_"+p;window[p]=function(e){u({ok:!0,json:function(){return n.resolve(e)}}),c&&clearTimeout(c),i(y),o(p)},a+=-1===a.indexOf("?")?"?":"&";var d=document.createElement("script");d.setAttribute("src",""+a+l+"="+p),d.id=y,document.getElementsByTagName("head")[0].appendChild(d),c=setTimeout(function(){f(new Error("JSONP request to "+e+" timed out")),o(p),i(y)},s)})}var u={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};t.exports=a})}).call(t,n(0))},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,s=r(e),l=1;l<arguments.length;l++){n=Object(arguments[l]);for(var c in n)i.call(n,c)&&(s[c]=n[c]);if(o){u=o(n);for(var f=0;f<u.length;f++)a.call(n,u[f])&&(s[u[f]]=n[u[f]])}}return s}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){h&&y&&(h=!1,y.length?d=y.concat(d):v=-1,d.length&&u())}function u(){if(!h){var e=o(a);h=!0;for(var t=d.length;t;){for(y=d,d=[];++v<t;)y&&y[v].run();v=-1,t=d.length}y=null,h=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function l(){}var c,f,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var y,d=[],h=!1,v=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new s(e,t)),1!==d.length||h||o(u)},s.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,n){"use strict";function r(e,t,n,r,o){}n(7),n(8),n(10);e.exports=r},function(e,t,n){"use strict";var r=(n(6),n(7)),o=(n(8),n(10),n(22));e.exports=function(e){function t(e){this.message=e,this.stack=""}var n,i=("function"==typeof Symbol&&Symbol.iterator,function(){r(!1,"React.PropTypes type checking code is stripped in production.")});i.isRequired=i;var a=function(){return i};return n={array:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a},t.prototype=Error.prototype,n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){function r(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var o=n(23),i="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=o(r)},function(e,t,n){"use strict";function r(e){switch(e.arrayFormat){case"index":return function(t,n,r){return null===n?[i(t,e),"[",r,"]"].join(""):[i(t,e),"[",i(r,e),"]=",i(n,e)].join("")};case"bracket":return function(t,n){return null===n?i(t,e):[i(t,e),"[]=",i(n,e)].join("")};default:return function(t,n){return null===n?i(t,e):[i(t,e),"=",i(n,e)].join("")}}}function o(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t)return void(r[e]=n);void 0===r[e]&&(r[e]={}),r[e][t[1]]=n};case"bracket":return function(e,n,r){if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t||void 0===r[e])return void(r[e]=n);r[e]=[].concat(r[e],n)};default:return function(e,t,n){if(void 0===n[e])return void(n[e]=t);n[e]=[].concat(n[e],t)}}}function i(e,t){return t.encode?t.strict?u(e):encodeURIComponent(e):e}function a(e){return Array.isArray(e)?e.sort():"object"==typeof e?a(Object.keys(e)).sort(function(e,t){return Number(e)-Number(t)}).map(function(t){return e[t]}):e}var u=n(26),s=n(20);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e,t){t=s({arrayFormat:"none"},t);var n=o(t),r=Object.create(null);return"string"!=typeof e?r:(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(function(e){var t=e.replace(/\+/g," ").split("="),o=t.shift(),i=t.length>0?t.join("="):void 0;i=void 0===i?null:decodeURIComponent(i),n(decodeURIComponent(o),i,r)}),Object.keys(r).sort().reduce(function(e,t){var n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=a(n):e[t]=n,e},Object.create(null))):r},t.stringify=function(e,t){t=s({encode:!0,strict:!0,arrayFormat:"none"},t);var n=r(t);return e?Object.keys(e).sort().map(function(r){var o=e[r];if(void 0===o)return"";if(null===o)return i(r,t);if(Array.isArray(o)){var a=[];return o.slice().forEach(function(e){void 0!==e&&a.push(n(r,e,a.length))}),a.join("&")}return i(r,t)+"="+i(o,t)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){}]); |
@@ -56,2 +56,3 @@ 'use strict'; | ||
var _props = this.props, | ||
playsinline = _props.playsinline, | ||
onPause = _props.onPause, | ||
@@ -70,3 +71,6 @@ onEnded = _props.onEnded, | ||
this.player.addEventListener('error', onError); | ||
this.player.setAttribute('webkit-playsinline', ''); | ||
if (playsinline) { | ||
this.player.setAttribute('playsinline', ''); | ||
this.player.setAttribute('webkit-playsinline', ''); | ||
} | ||
_get(FilePlayer.prototype.__proto__ || Object.getPrototypeOf(FilePlayer.prototype), 'componentDidMount', this).call(this); | ||
@@ -93,2 +97,5 @@ } | ||
this.player.src = url; | ||
if (this.props.playing) { | ||
this.player.load(); | ||
} | ||
} | ||
@@ -95,0 +102,0 @@ }, { |
@@ -54,2 +54,20 @@ 'use strict'; | ||
}, { | ||
key: 'getURL', | ||
value: function getURL(_ref) { | ||
var video = _ref.video; | ||
var vidmeConfig = this.props.vidmeConfig; | ||
if (vidmeConfig.format && video.formats && video.formats.length !== 0) { | ||
var index = video.formats.findIndex(function (f) { | ||
return f.type === vidmeConfig.format; | ||
}); | ||
if (index !== -1) { | ||
return video.formats[index].uri; | ||
} else { | ||
console.warn('Vidme format "' + vidmeConfig.format + '" was not found for ' + video.full_url); | ||
} | ||
} | ||
return video.complete_url; | ||
} | ||
}, { | ||
key: 'load', | ||
@@ -64,3 +82,3 @@ value: function load(url) { | ||
if (!_this2.mounted) return; | ||
_this2.player.src = data.video.complete_url; | ||
_this2.player.src = _this2.getURL(data); | ||
}, onError); | ||
@@ -67,0 +85,0 @@ } |
@@ -129,2 +129,3 @@ 'use strict'; | ||
var _props2 = this.props, | ||
playsinline = _props2.playsinline, | ||
controls = _props2.controls, | ||
@@ -155,3 +156,4 @@ youtubeConfig = _props2.youtubeConfig, | ||
start: (0, _utils.parseStartTime)(url), | ||
origin: window.location.origin | ||
origin: window.location.origin, | ||
playsinline: playsinline | ||
}, youtubeConfig.playerVars), | ||
@@ -158,0 +160,0 @@ events: { |
@@ -8,11 +8,15 @@ 'use strict'; | ||
var _react = require('react'); | ||
var _propTypes = require('prop-types'); | ||
var string = _react.PropTypes.string, | ||
bool = _react.PropTypes.bool, | ||
number = _react.PropTypes.number, | ||
oneOfType = _react.PropTypes.oneOfType, | ||
shape = _react.PropTypes.shape, | ||
object = _react.PropTypes.object, | ||
func = _react.PropTypes.func; | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var string = _propTypes2['default'].string, | ||
bool = _propTypes2['default'].bool, | ||
number = _propTypes2['default'].number, | ||
oneOfType = _propTypes2['default'].oneOfType, | ||
shape = _propTypes2['default'].shape, | ||
object = _propTypes2['default'].object, | ||
func = _propTypes2['default'].func; | ||
var propTypes = exports.propTypes = { | ||
@@ -31,2 +35,3 @@ url: string, | ||
progressFrequency: number, | ||
playsinline: bool, | ||
soundcloudConfig: shape({ | ||
@@ -44,2 +49,5 @@ clientId: string, | ||
}), | ||
vidmeConfig: shape({ | ||
format: string | ||
}), | ||
fileConfig: shape({ | ||
@@ -69,2 +77,3 @@ attributes: object | ||
progressFrequency: 1000, | ||
playsinline: false, | ||
soundcloudConfig: { | ||
@@ -82,2 +91,5 @@ clientId: 'e8b6f84fbcad14c301ca1355cae1dea2', | ||
}, | ||
vidmeConfig: { | ||
format: null | ||
}, | ||
fileConfig: { | ||
@@ -84,0 +96,0 @@ attributes: {} |
@@ -73,2 +73,13 @@ 'use strict'; | ||
} | ||
}, _this.getDuration = function () { | ||
if (!_this.player) return null; | ||
return _this.player.getDuration(); | ||
}, _this.getCurrentTime = function () { | ||
if (!_this.player) return null; | ||
var duration = _this.player.getDuration(); | ||
var fractionPlayed = _this.player.getFractionPlayed(); | ||
if (duration === null || fractionPlayed === null) { | ||
return null; | ||
} | ||
return fractionPlayed * duration; | ||
}, _this.progress = function () { | ||
@@ -78,8 +89,15 @@ if (_this.props.url && _this.player) { | ||
var played = _this.player.getFractionPlayed() || 0; | ||
var duration = _this.player.getDuration(); | ||
var progress = {}; | ||
if (loaded !== _this.prevLoaded) { | ||
progress.loaded = loaded; | ||
if (duration) { | ||
progress.loadedSeconds = progress.loaded * duration; | ||
} | ||
} | ||
if (played !== _this.prevPlayed) { | ||
progress.played = played; | ||
if (duration) { | ||
progress.playedSeconds = progress.played * duration; | ||
} | ||
} | ||
@@ -102,4 +120,5 @@ if (progress.loaded || progress.played) { | ||
vimeoConfig = _this$props.vimeoConfig, | ||
vidmeConfig = _this$props.vidmeConfig, | ||
fileConfig = _this$props.fileConfig, | ||
activeProps = _objectWithoutProperties(_this$props, ['youtubeConfig', 'soundcloudConfig', 'vimeoConfig', 'fileConfig']); | ||
activeProps = _objectWithoutProperties(_this$props, ['youtubeConfig', 'soundcloudConfig', 'vimeoConfig', 'vidmeConfig', 'fileConfig']); | ||
@@ -112,2 +131,3 @@ var props = active ? _extends({}, activeProps, { ref: _this.ref }) : {}; | ||
vimeoConfig: vimeoConfig, | ||
vidmeConfig: vidmeConfig, | ||
fileConfig: fileConfig | ||
@@ -114,0 +134,0 @@ }, props)); |
{ | ||
"name": "react-player", | ||
"version": "0.14.3", | ||
"version": "0.15.0", | ||
"description": "A react component for playing a variety of URLs, including file paths, YouTube, SoundCloud, Streamable, Vidme, Vimeo and Wistia", | ||
@@ -62,4 +62,4 @@ "main": "lib/ReactPlayer.js", | ||
"chai": "^3.5.0", | ||
"cross-env": "^3.1.4", | ||
"css-loader": "^0.26.0", | ||
"cross-env": "^4.0.0", | ||
"css-loader": "^0.28.0", | ||
"es6-promise": "^4.0.3", | ||
@@ -81,3 +81,3 @@ "exports-loader": "^0.6.3", | ||
"node-sass": "^4.1.1", | ||
"normalize.css": "^5.0.0", | ||
"normalize.css": "^6.0.0", | ||
"react": "^15.3.2", | ||
@@ -88,5 +88,5 @@ "react-dom": "^15.3.2", | ||
"screenfull": "^3.0.2", | ||
"snazzy": "^6.0.0", | ||
"standard": "^8.3.0", | ||
"style-loader": "^0.13.1", | ||
"snazzy": "^7.0.0", | ||
"standard": "^10.0.0", | ||
"style-loader": "^0.16.1", | ||
"webpack": "^2.2.1", | ||
@@ -100,2 +100,3 @@ "webpack-dev-middleware": "^1.8.3", | ||
"load-script": "^1.0.0", | ||
"prop-types": "^15.5.6", | ||
"query-string": "^4.2.3" | ||
@@ -102,0 +103,0 @@ }, |
@@ -90,2 +90,3 @@ ReactPlayer | ||
`progressFrequency` | The time between `onProgress` callbacks, in milliseconds | `1000` | ||
`playsinline` | Applies the `playsinline` attribute where supported | `false` | ||
@@ -101,3 +102,3 @@ #### Callback props | ||
`onPlay` | Called when media starts or resumes playing after pausing or buffering | ||
`onProgress` | Callback containing `played` and `loaded` progress as a fraction<br />eg `{ played: 0.12, loaded: 0.34 }` | ||
`onProgress` | Callback containing progress `played`, `loaded` (fraction), `playedSeconds` and `loadedSeconds` (seconds)<br />eg `{ played: 0.12, playedSeconds: 11.3, loaded: 0.34, loadedSeconds: 16.7 }` | ||
`onDuration` | Callback containing duration of the media, in seconds | ||
@@ -118,2 +119,3 @@ `onPause` | Called when media is paused | ||
`youtubeConfig` | Configuration object for the YouTube player.<br />Set `playerVars` to override the [default player vars](https://developers.google.com/youtube/player_parameters?playerVersion=HTML5).<br />Set `preload` for [preloading](#preloading). | ||
`vidmeConfig` | Configuration object for the Vidme player.<br />Set `format` to use a certain quality of video, when available.<br />Possible values: `240p`, `480p`, `720p`, `1080p`, `dash`, `hls` | ||
`fileConfig` | Configuration object for the file player.<br />Set `attributes` to apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes). | ||
@@ -127,4 +129,10 @@ | ||
To seek to a certain part of the media, there is a `seekTo(fraction)` instance method that will seek to the appropriate place in the media. See `App.js` for an example of this using `refs`. | ||
Use [`ref`](https://facebook.github.io/react/docs/refs-and-the-dom.html) to call methods on the player. See [the demo app](src/demo/App.js) for an example of this. | ||
Prop | Description | ||
---- | ----------- | ||
`seekTo(fraction)` | Seek to the specified fraction (from 0 to 1) of the currently playing media | ||
`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. | ||
### Supported media | ||
@@ -131,0 +139,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152
648314
5
27
1502
+ Addedprop-types@^15.5.6
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedreact-is@16.13.1(transitive)