UNPKG

99.2 kBJavaScriptView Raw
1var ReactPlayer=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=23)}([function(e,t){e.exports=React},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=e.match(t);if(n){var r=n[1];if(r.match(S))return i(r);if(T.test(r))return parseInt(r)}}function i(e){for(var t=0,n=S.exec(e);null!==n;){var r=n,o=g(r,3),a=o[1],i=o[2];"h"===i&&(t+=60*parseInt(a,10)*60),"m"===i&&(t+=60*parseInt(a,10)),"s"===i&&(t+=parseInt(a,10)),n=S.exec(e)}return t}function l(e){return a(e,_)}function u(e){return a(e,j)}function s(){return Math.random().toString(36).substr(2,5)}function c(e){return Object.keys(e).map(function(t){return t+"="+e[t]}).join("&")}function p(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:w.default;return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise(function(r,a){if(D[e])return void D[e].push(r);D[e]=[r];var i=function(t){D[e].forEach(function(e){return e(t)})};if(n){var l=window[n];window[n]=function(){l&&l(),i(window[t])}}o(e,function(e){e&&a(e),n||i(window[t])})})}function f(e,t,n){var r=(0,E.default)(t.config,e.config),a=!0,i=!1,l=void 0;try{for(var u,s=O.DEPRECATED_CONFIG_PROPS[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=u.value;if(e[c]){var p=c.replace(/Config$/,"");if(r=(0,E.default)(r,o({},p,e[c])),n){var f="ReactPlayer: %c"+c+" %cis deprecated, please use the config prop instead – https://github.com/CookPete/react-player#config-prop";console.warn(f,"font-weight: bold","")}}}}catch(e){i=!0,l=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw l}}return r}function y(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a=(t=[]).concat.apply(t,r),i={},l=Object.keys(e),u=!0,s=!1,c=void 0;try{for(var p,f=l[Symbol.iterator]();!(u=(p=f.next()).done);u=!0){var y=p.value;-1===a.indexOf(y)&&(i[y]=e[y])}}catch(e){s=!0,c=e}finally{try{!u&&f.return&&f.return()}finally{if(s)throw c}}return i}function d(e){var t;if(!this.player||!this.player[e]){var n="ReactPlayer: "+this.constructor.displayName+" player could not call %c"+e+"%c – ";return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return(t=this.player)[e].apply(t,o)}function h(e){return null!==e&&"object"===(void 0===e?"undefined":b(e))}function v(e,t){if("function"==typeof e&&"function"==typeof t)return!0;if(e instanceof Array&&t instanceof Array){if(e.length!==t.length)return!1;for(var n=0;n!==e.length;n++)if(!v(e[n],t[n]))return!1;return!0}if(h(e)&&h(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;var r=!0,o=!1,a=void 0;try{for(var i,l=Object.keys(e)[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var u=i.value;if(!v(e[u],t[u]))return!1}}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return!0}return e===t}function m(e){return"undefined"!=typeof window&&void 0!==window.MediaStream&&e instanceof window.MediaStream}Object.defineProperty(t,"__esModule",{value:!0});var b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.parseStartTime=l,t.parseEndTime=u,t.randomString=s,t.queryString=c,t.getSDK=p,t.getConfig=f,t.omit=y,t.callPlayer=d,t.isObject=h,t.isEqual=v,t.isMediaStream=m;var P=n(24),w=r(P),k=n(25),E=r(k),O=n(3),_=/[?&#](?:start|t)=([0-9hms]+)/,j=/[?&#]end=([0-9hms]+)/,S=/(\d+)(h|m|s)/g,T=/^\d+$/,D={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){var t,n;return n=t=function(t){function n(){var e,t,r,i;o(this,n);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return t=r=a(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(u))),r.config=(0,y.getConfig)(r.props,f.defaultProps,!0),r.getDuration=function(){return r.player?r.player.getDuration():null},r.getCurrentTime=function(){return r.player?r.player.getCurrentTime():null},r.getSecondsLoaded=function(){return r.player?r.player.getSecondsLoaded():null},r.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return r.player?r.player.getInternalPlayer(e):null},r.seekTo=function(e,t){if(!r.player)return null;r.player.seekTo(e,t)},r.ref=function(e){r.player=e},i=t,a(r,i)}return i(n,t),s(n,[{key:"shouldComponentUpdate",value:function(e){return!(0,y.isEqual)(this.props,e)}},{key:"componentWillUpdate",value:function(e){this.config=(0,y.getConfig)(e,f.defaultProps)}},{key:"render",value:function(){var t=this.config.file,n=t.forceVideo,r=t.forceAudio,o=t.forceHLS,a=t.forceDASH,i=n||r||o||a;if(!e.canPlay(this.props.url)&&!i)return null;var l=this.props,s=l.style,c=l.width,d=l.height,m=l.wrapper,b=(0,y.omit)(this.props,v,f.DEPRECATED_CONFIG_PROPS);return p.default.createElement(m,u({style:u({},s,{width:c,height:d})},b),p.default.createElement(h.default,u({},this.props,{ref:this.ref,activePlayer:e,config:this.config})))}}]),n}(c.Component),t.displayName=e.displayName+"Player",t.propTypes=f.propTypes,t.defaultProps=f.defaultProps,t.canPlay=e.canPlay,n}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=l;var c=n(0),p=r(c),f=n(3),y=n(1),d=n(5),h=r(d),v=Object.keys(f.propTypes)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEPRECATED_CONFIG_PROPS=t.defaultProps=t.propTypes=void 0;var r=n(26),o=function(e){return e&&e.__esModule?e:{default:e}}(r),a=o.default.string,i=o.default.bool,l=o.default.number,u=o.default.array,s=o.default.oneOfType,c=o.default.shape,p=o.default.object,f=o.default.func;t.propTypes={url:s([a,u,p]),playing:i,loop:i,controls:i,volume:l,muted:i,playbackRate:l,width:s([a,l]),height:s([a,l]),style:p,progressInterval:l,playsinline:i,pip:i,light:s([i,a]),wrapper:s([a,f,c({render:f.isRequired})]),config:c({soundcloud:c({options:p,preload:i}),youtube:c({playerVars:p,embedOptions:p,preload:i}),facebook:c({appId:a}),dailymotion:c({params:p,preload:i}),vimeo:c({playerOptions:p,preload:i}),file:c({attributes:p,tracks:u,forceVideo:i,forceAudio:i,forceHLS:i,forceDASH:i,hlsOptions:p,hlsVersion:a,dashVersion:a}),wistia:c({options:p}),mixcloud:c({options:p}),twitch:c({options:p})}),onReady:f,onStart:f,onPlay:f,onPause:f,onBuffer:f,onBufferEnd:f,onEnded:f,onError:f,onDuration:f,onSeek:f,onProgress:f,onVolumeChange:f,onEnablePIP:f,onDisablePIP:f},t.defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,light:!1,wrapper:"div",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},preload:!1},facebook:{appId:"1309697205772819"},dailymotion:{params:{api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},preload:!1},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,hlsOptions:{},hlsVersion:"0.10.1",dashVersion:"2.9.2"},wistia:{options:{}},mixcloud:{options:{hide_cover:1}},twitch:{options:{}}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onBufferEnd:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onSeek:function(){},onVolumeChange:function(){},onProgress:function(){},onEnablePIP:function(){},onDisablePIP:function(){}},t.DEPRECATED_CONFIG_PROPS=["soundcloudConfig","youtubeConfig","facebookConfig","dailymotionConfig","vimeoConfig","fileConfig","wistiaConfig"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){if(b.test(e)){var t=e.match(b);return{listType:"playlist",list:c(t,2)[1]}}return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.YouTube=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=n(0),f=r(p),y=n(1),d=n(2),h=r(d),v="YT",m=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/,b=/list=([a-zA-Z0-9_-]+)/,g=t.YouTube=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=y.callPlayer,r.onStateChange=function(e){var t=e.data,n=r.props,o=n.onPlay,a=n.onPause,i=n.onBuffer,l=n.onBufferEnd,u=n.onEnded,s=n.onReady,c=n.loop,p=window[v].PlayerState,f=p.PLAYING,y=p.PAUSED,d=p.BUFFERING,h=p.ENDED,m=p.CUED;if(t===f&&(o(),l()),t===y&&a(),t===d&&i(),t===h){var b=!!r.callPlayer("getPlaylist");c&&!b&&r.play(),u()}t===m&&s()},r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unMute")},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),s(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playing,a=r.muted,i=r.playsinline,s=r.controls,c=r.loop,p=r.config,f=r.onError,d=p.youtube,h=d.playerVars,g=d.embedOptions,P=e&&e.match(m)[1];if(t)return b.test(e)?void this.player.loadPlaylist(l(e)):void this.player.cueVideoById({videoId:P,startSeconds:(0,y.parseStartTime)(e)||h.start,endSeconds:(0,y.parseEndTime)(e)||h.end});(0,y.getSDK)("https://www.youtube.com/iframe_api",v,"onYouTubeIframeAPIReady",function(e){return e.loaded}).then(function(t){n.container&&(n.player=new t.Player(n.container,u({width:"100%",height:"100%",videoId:P,playerVars:u({autoplay:o?1:0,mute:a?1:0,controls:s?1:0,start:(0,y.parseStartTime)(e),end:(0,y.parseEndTime)(e),origin:window.location.origin,playsinline:i},l(e),h),events:{onReady:n.props.onReady,onStateChange:n.onStateChange,onError:function(e){return f(e.data)}}},g)),c&&n.player.setLoop(!0))},f)}},{key:"play",value:function(){this.callPlayer("playVideo")}},{key:"pause",value:function(){this.callPlayer("pauseVideo")}},{key:"stop",value:function(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",e),this.props.playing||this.pause()}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var e=u({width:"100%",height:"100%"},this.props.style);return f.default.createElement("div",{style:e},f.default.createElement("div",{ref:this.ref}))}}]),t}(p.Component);g.displayName="YouTube",g.canPlay=function(e){return m.test(e)},t.default=(0,h.default)(g)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=n(3),p=n(1),f=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.mounted=!1,a.isReady=!1,a.isPlaying=!1,a.isLoading=!0,a.loadOnReady=null,a.startOnPlay=!0,a.seekOnPlay=null,a.onDurationCalled=!1,a.getInternalPlayer=function(e){return a.player?a.player[e]:null},a.progress=function(){if(a.props.url&&a.player&&a.isReady){var e=a.getCurrentTime()||0,t=a.getSecondsLoaded(),n=a.getDuration();if(n){var r={playedSeconds:e,played:e/n};null!==t&&(r.loadedSeconds=t,r.loaded=t/n),r.played===a.prevPlayed&&r.loaded===a.prevLoaded||a.props.onProgress(r),a.prevPlayed=r.played,a.prevLoaded=r.loaded}}a.progressTimeout=setTimeout(a.progress,a.props.progressFrequency||a.props.progressInterval)},a.onReady=function(){if(a.mounted){a.isReady=!0,a.isLoading=!1;var e=a.props,t=e.onReady,n=e.playing,r=e.volume,o=e.muted;t(),o||null===r||a.player.setVolume(r),a.loadOnReady?(a.player.load(a.loadOnReady,!0),a.loadOnReady=null):n&&a.player.play(),a.onDurationCheck()}},a.onPlay=function(){a.isPlaying=!0,a.isLoading=!1;var e=a.props,t=e.onStart,n=e.onPlay,r=e.playbackRate;a.startOnPlay&&(a.player.setPlaybackRate&&a.player.setPlaybackRate(r),t(),a.startOnPlay=!1),n(),a.seekOnPlay&&(a.seekTo(a.seekOnPlay),a.seekOnPlay=null),a.onDurationCheck()},a.onPause=function(e){a.isPlaying=!1,a.isLoading||a.props.onPause(e)},a.onEnded=function(){var e=a.props,t=e.activePlayer,n=e.loop,r=e.onEnded;t.loopOnEnded&&n&&a.seekTo(0),n||(a.isPlaying=!1,r())},a.onError=function(e){a.isLoading=!1,a.props.onError(e)},a.onDurationCheck=function(){clearTimeout(a.durationCheckTimeout);var e=a.getDuration();e?a.onDurationCalled||(a.props.onDuration(e),a.onDurationCalled=!0):a.durationCheckTimeout=setTimeout(a.onDurationCheck,100)},a.onLoaded=function(){a.isLoading=!1},a.ref=function(e){e&&(a.player=e)},i=n,o(a,i)}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.mounted=!0,this.player.load(this.props.url),this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.player.stop(),this.player.disablePIP&&this.player.disablePIP(),this.mounted=!1}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=this.props,r=n.url,o=n.playing,a=n.volume,i=n.muted,l=n.playbackRate,u=n.pip,s=n.loop;if(!(0,p.isEqual)(r,e.url)){if(this.isLoading)return console.warn("ReactPlayer: the attempt to load "+e.url+" is being deferred until the player has loaded"),void(this.loadOnReady=e.url);this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(e.url,this.isReady)}o||!e.playing||this.isPlaying||this.player.play(),o&&!e.playing&&this.isPlaying&&this.player.pause(),!u&&e.pip&&this.player.enablePIP?this.player.enablePIP():u&&!e.pip&&this.player.disablePIP&&this.player.disablePIP(),a!==e.volume&&null!==e.volume&&this.player.setVolume(e.volume),i!==e.muted&&(e.muted?this.player.mute():(this.player.unmute(),null!==e.volume&&setTimeout(function(){return t.player.setVolume(e.volume)}))),l!==e.playbackRate&&this.player.setPlaybackRate&&this.player.setPlaybackRate(e.playbackRate),s!==e.loop&&this.player.setLoop&&this.player.setLoop(e.loop)}},{key:"getDuration",value:function(){return this.isReady?this.player.getDuration():null}},{key:"getCurrentTime",value:function(){return this.isReady?this.player.getCurrentTime():null}},{key:"getSecondsLoaded",value:function(){return this.isReady?this.player.getSecondsLoaded():null}},{key:"seekTo",value:function(e,t){var n=this;if(!this.isReady&&0!==e)return this.seekOnPlay=e,void setTimeout(function(){n.seekOnPlay=null},5e3);if(t?"fraction"===t:e>0&&e<1){var r=this.player.getDuration();return r?void this.player.seekTo(r*e):void console.warn("ReactPlayer: could not seek using fraction – duration not yet available")}this.player.seekTo(e)}},{key:"render",value:function(){var e=this.props.activePlayer;return e?s.default.createElement(e,i({},this.props,{ref:this.ref,onReady:this.onReady,onPlay:this.onPlay,onPause:this.onPause,onEnded:this.onEnded,onLoaded:this.onLoaded,onError:this.onError})):null}}]),t}(u.Component);f.displayName="Player",f.propTypes=c.propTypes,f.defaultProps=c.defaultProps,t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.SoundCloud=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),p=n(1),f=n(2),y=r(f),d=/(soundcloud\.com|snd\.sc)\/.+$/,h=t.SoundCloud=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.fractionLoaded=null,r.mute=function(){r.setVolume(0)},r.unmute=function(){null!==r.props.volume&&r.setVolume(r.props.volume)},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e,t){var n=this;(0,p.getSDK)("https://w.soundcloud.com/player/api.js","SC").then(function(r){if(n.iframe){var o=r.Widget.Events,a=o.PLAY,i=o.PLAY_PROGRESS,u=o.PAUSE,s=o.FINISH,c=o.ERROR;t||(n.player=r.Widget(n.iframe),n.player.bind(a,n.props.onPlay),n.player.bind(u,n.props.onPause),n.player.bind(i,function(e){n.currentTime=e.currentPosition/1e3,n.fractionLoaded=e.loadedProgress}),n.player.bind(s,function(){return n.props.onEnded()}),n.player.bind(c,function(e){return n.props.onError(e)})),n.player.load(e,l({},n.props.config.soundcloud.options,{callback:function(){n.player.getDuration(function(e){n.duration=e/1e3,n.props.onReady()})}}))}})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",1e3*e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var e=l({width:"100%",height:"100%"},this.props.style);return c.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url="+encodeURIComponent(this.props.url),style:e,frameBorder:0,allow:"autoplay"})}}]),t}(s.Component);h.displayName="SoundCloud",h.canPlay=function(e){return d.test(e)},h.loopOnEnded=!0,t.default=(0,y.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Vimeo=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),p=n(1),f=n(2),y=r(f),d=/vimeo\.com\/.+/,h=/vimeo\.com\/external\/.+\.mp4/,v=t.Vimeo=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){r.setVolume(0)},r.unmute=function(){null!==r.props.volume&&r.setVolume(r.props.volume)},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e){var t=this;this.duration=null,(0,p.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then(function(n){t.container&&(t.player=new n.Player(t.container,l({},t.props.config.vimeo.playerOptions,{url:e,autoplay:t.props.playing,muted:t.props.muted,loop:t.props.loop,playsinline:t.props.playsinline})),t.player.ready().then(function(){var e=t.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"}).catch(t.props.onError),t.player.on("loaded",function(){t.props.onReady(),t.refreshDuration()}),t.player.on("play",function(){t.props.onPlay(),t.refreshDuration()}),t.player.on("pause",t.props.onPause),t.player.on("seeked",function(e){return t.props.onSeek(e.seconds)}),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",function(e){var n=e.seconds;t.currentTime=n}),t.player.on("progress",function(e){var n=e.seconds;t.secondsLoaded=n}))},this.props.onError)}},{key:"refreshDuration",value:function(){var e=this;this.player.getDuration().then(function(t){e.duration=t})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("unload")}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=l({width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black"},this.props.style);return c.default.createElement("div",{key:this.props.url,ref:this.ref,style:e})}}]),t}(s.Component);v.displayName="Vimeo",v.canPlay=function(e){return!h.test(e)&&d.test(e)},t.default=(0,y.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.DailyMotion=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),p=r(c),f=n(1),y=n(2),d=r(y),h=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/,v=t.DailyMotion=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=f.callPlayer,r.onDurationChange=function(){var e=r.getDuration();r.props.onDuration(e)},r.mute=function(){r.callPlayer("setMuted",!0)},r.unmute=function(){r.callPlayer("setMuted",!1)},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),s(t,[{key:"load",value:function(e){var t=this,n=this.props,r=n.controls,o=n.config,a=n.onError,i=n.playing,s=e.match(h),c=u(s,2),p=c[1];if(this.player)return void this.player.load(p,{start:(0,f.parseStartTime)(e),autoplay:i});(0,f.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",function(e){return e.player}).then(function(n){if(t.container){var i=n.player;t.player=new i(t.container,{width:"100%",height:"100%",video:p,params:l({controls:r,autoplay:t.props.playing,mute:t.props.muted,start:(0,f.parseStartTime)(e),origin:window.location.origin},o.dailymotion.params),events:{apiready:t.props.onReady,seeked:function(){return t.props.onSeek(t.player.currentTime)},video_end:t.props.onEnded,durationchange:t.onDurationChange,pause:t.props.onPause,playing:t.props.onPlay,waiting:t.props.onBuffer,error:function(e){return a(e)}}})}},a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var e=l({width:"100%",height:"100%",backgroundColor:"black"},this.props.style);return p.default.createElement("div",{style:e},p.default.createElement("div",{ref:this.ref}))}}]),t}(c.Component);v.displayName="DailyMotion",v.canPlay=function(e){return h.test(e)},v.loopOnEnded=!0,t.default=(0,d.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Facebook=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(1),p=n(2),f=r(p),y="//connect.facebook.net/en_US/sdk.js",d=/facebook\.com\/([^\/?].+\/)?video(s|\.php)[\/?].*$/,h="facebook-player-",v=t.Facebook=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=c.callPlayer,r.playerID=h+(0,c.randomString)(),r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e,t){var n=this;if(t)return void(0,c.getSDK)(y,"FB","fbAsyncInit").then(function(e){return e.XFBML.parse()});(0,c.getSDK)(y,"FB","fbAsyncInit").then(function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:"v2.5"}),e.Event.subscribe("xfbml.render",function(e){n.props.onLoaded()}),e.Event.subscribe("xfbml.ready",function(e){"video"===e.type&&e.id===n.playerID&&(n.player=e.instance,n.player.subscribe("startedPlaying",n.props.onPlay),n.player.subscribe("paused",n.props.onPause),n.player.subscribe("finishedPlaying",n.props.onEnded),n.player.subscribe("startedBuffering",n.props.onBuffer),n.player.subscribe("finishedBuffering",n.props.onBufferEnd),n.player.subscribe("error",n.props.onError),n.props.muted||n.callPlayer("unmute"),n.props.onReady(),document.getElementById(n.playerID).querySelector("iframe").style.visibility="visible")})})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%",backgroundColor:"black"};return s.default.createElement("div",{style:e,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"})}}]),t}(u.Component);v.displayName="Facebook",v.canPlay=function(e){return d.test(e)},v.loopOnEnded=!0,t.default=(0,f.default)(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Streamable=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(1),p=n(2),f=r(p),y=/streamable\.com\/([a-z0-9]+)$/,d=t.Streamable=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=c.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e){var t=this;(0,c.getSDK)("//cdn.embed.ly/player-0.1.0.min.js","playerjs").then(function(e){t.iframe&&(t.player=new e.Player(t.iframe),t.player.setLoop(t.props.loop),t.player.on("ready",t.props.onReady),t.player.on("play",t.props.onPlay),t.player.on("pause",t.props.onPause),t.player.on("seeked",t.props.onSeek),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",function(e){var n=e.duration,r=e.seconds;t.duration=n,t.currentTime=r}),t.player.on("buffered",function(e){var n=e.percent;t.duration&&(t.secondsLoaded=t.duration*n)}),t.props.muted&&t.player.mute())},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=this.props.url.match(y)[1],t={width:"100%",height:"100%"};return s.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/"+e,frameBorder:"0",scrolling:"no",style:t,allowFullScreen:!0})}}]),t}(u.Component);d.displayName="Streamable",d.canPlay=function(e){return y.test(e)},t.default=(0,f.default)(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.FaceMask=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(1),p=n(2),f=r(p),y=/nflent-vh\.akamaihd\.net\/.+\.m3u8/,d="facemask-player-",h=t.FaceMask=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=c.callPlayer,r.duration=null,r.volume=null,r.currentTime=null,r.secondsLoaded=null,r.playerID=d+(0,c.randomString)(),r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e){var t=this;this.duration=null,(0,c.getSDK)("https://www.nfl.com/libs/playaction/api.js","nfl").then(function(n){if(t.container){t.player=new n.playaction({containerId:t.playerID,initialVideo:{url:e},height:"100%",width:"100%"});var r=n.playaction.EVENTS,o=r.PLAYER_READY,a=r.STATUS,i=r.TIME_UPDATE,l=r.VOLUME,u=n.playaction.STATUS,s=u.COMPLETE,c=u.ERROR,p=u.PAUSED,f=u.PLAYING;t.player.on(o,t.props.onReady),t.player.on(l,t.props.onVolumeChange),t.player.on(a,function(e){switch(e.status){case s:t.props.onEnded();break;case c:t.props.onError(e);break;case p:t.props.onPause();break;case f:t.props.onPlay()}}),t.player.on(i,function(e){var n=e.currentTime,r=e.duration;t.currentTime=n,t.duration=r||1/0})}},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("destroy")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){}},{key:"mute",value:function(){this.callPlayer("mute")}},{key:"unmute",value:function(){this.callPlayer("unmute")}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return s.default.createElement("div",{id:this.playerID,ref:this.ref,style:e})}}]),t}(u.Component);h.displayName="FaceMask",h.canPlay=function(e){return y.test(e)},t.default=(0,f.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Wistia=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),p=n(1),f=n(2),y=r(f),d=/(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/,h=t.Wistia=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.mute=function(){r.callPlayer("mute")},r.unmute=function(){r.callPlayer("unmute")},i=n,a(r,i)}return i(t,e),u(t,[{key:"getID",value:function(e){return e&&e.match(d)[1]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.playing,o=n.muted,a=n.controls,i=n.onReady,u=n.onPlay,s=n.onPause,c=n.onSeek,f=n.onEnded,y=n.config,d=n.onError;(0,p.getSDK)("//fast.wistia.com/assets/external/E-v1.js","Wistia").then(function(){window._wq=window._wq||[],window._wq.push({id:t.getID(e),options:l({autoPlay:r,silentAutoPlay:"allow",muted:o,controlsVisibleOnLoad:a},y.wistia.options),onReady:function(e){t.player=e,t.unbind(),t.player.bind("play",u),t.player.bind("pause",s),t.player.bind("seek",c),t.player.bind("end",f),i()}})},d)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"unbind",value:function(){var e=this.props,t=e.onPlay,n=e.onPause,r=e.onSeek,o=e.onEnded;this.player.unbind("play",t),this.player.unbind("pause",n),this.player.unbind("seek",r),this.player.unbind("end",o)}},{key:"stop",value:function(){this.unbind(),this.callPlayer("remove")}},{key:"seekTo",value:function(e){this.callPlayer("time",e)}},{key:"setVolume",value:function(e){this.callPlayer("volume",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("playbackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.getID(this.props.url),t="wistia_embed wistia_async_"+e,n={width:"100%",height:"100%"};return c.default.createElement("div",{key:e,className:t,style:n})}}]),t}(s.Component);h.displayName="Wistia",h.canPlay=function(e){return d.test(e)},h.loopOnEnded=!0,t.default=(0,y.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Twitch=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),p=n(1),f=n(2),y=r(f),d=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,h=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,v="twitch-player-",m=t.Twitch=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.playerID=v+(0,p.randomString)(),r.mute=function(){r.callPlayer("setMuted",!0)},r.unmute=function(){r.callPlayer("setMuted",!1)},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,i=r.config,u=h.test(e),s=u?e.match(h)[1]:e.match(d)[1];if(t)return void(u?this.player.setChannel(s):this.player.setVideo("v"+s));(0,p.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then(function(e){n.player=new e.Player(n.playerID,l({video:u?"":s,channel:u?s:"",height:"100%",width:"100%",playsinline:o,autoplay:n.props.playing,muted:n.props.muted},i.twitch.options));var t=e.Player,r=t.READY,a=t.PLAYING,c=t.PAUSE,p=t.ENDED;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(a,n.props.onPlay),n.player.addEventListener(c,n.props.onPause),n.player.addEventListener(p,n.props.onEnded)},a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("pause")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"getVolume",value:function(){return this.callPlayer("getVolume")}},{key:"getMuted",value:function(){return this.callPlayer("getMuted")}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return c.default.createElement("div",{style:e,id:this.playerID})}}]),t}(s.Component);m.displayName="Twitch",m.canPlay=function(e){return d.test(e)||h.test(e)},m.loopOnEnded=!0,t.default=(0,y.default)(m)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.UstreamLive=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(1),p=n(2),f=r(p),y=/(ustream.tv\/channel\/)([^#&?\/]*)/,d="UstreamLive-player-",h=t.UstreamLive=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={ustreamSrc:null},r.playerID=d+(0,c.randomString)(),r.callPlayer=c.callPlayer,r.mute=function(){},r.unmute=function(){},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),l(t,[{key:"parseId",value:function(e){return e.match(y)[2]}},{key:"componentDidUpdate",value:function(e){e.url&&e.url!==this.props.url&&this.setState({ustreamSrc:null})}},{key:"load",value:function(){var e=this,t=this.props,n=t.onEnded,r=t.onError,o=t.onPause,a=t.onPlay,i=t.onReady,l=t.playing,u=t.url,s=this.parseId(u);this.setState({ustreamSrc:"https://www.ustream.tv/embed/"+s+"?html5ui=1&autoplay="+l+"&controls=false&showtitle=false"}),(0,c.getSDK)("https://developers.ustream.tv/js/ustream-embedapi.min.js","UstreamEmbed").then(function(t){e.container&&(e.currentTime=0,e.player=t(e.playerID),e.player.addListener("playing",function(t,n){n?(e.playTime=Date.now(),a()):(e.currentTime=e.getCurrentTime(),e.playTime=null,o())}),e.player.addListener("live",i),e.player.addListener("offline",i),e.player.addListener("finished",n),e.player.getProperty("duration",function(t){e.player.duration=t||1/0}))},r)}},{key:"play",value:function(){this.callPlayer("callMethod","play")}},{key:"pause",value:function(){this.callPlayer("callMethod","pause")}},{key:"stop",value:function(){this.callPlayer("callMethod","stop")}},{key:"seekTo",value:function(e){this.callPlayer("callMethod","seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("callMethod","volume",100*e)}},{key:"getDuration",value:function(){return 1/0}},{key:"getCurrentTime",value:function(){var e=0;return this.playTime&&(e=(Date.now()-this.playTime)/1e3),this.currentTime+e}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"},t=this.state.ustreamSrc;return t&&s.default.createElement("iframe",{id:this.playerID,ref:this.ref,src:t,frameBorder:"0",scrolling:"no",style:e,allowFullScreen:!0})}}]),t}(u.Component);h.displayName="UstreamLive",h.canPlay=function(e){return y.test(e)},h.loopOnEnded=!1,t.default=(0,f.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.UstreamVideo=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(1),p=n(2),f=r(p),y=/(ustream.tv\/recorded\/)([^#&?\/]*)/,d="UstreamVideo-player-",h=t.UstreamVideo=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={ustreamSrc:null},r.playerID=d+(0,c.randomString)(),r.callPlayer=c.callPlayer,r.mute=function(){},r.unmute=function(){},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),l(t,[{key:"parseId",value:function(e){return e.match(y)[2]}},{key:"componentDidUpdate",value:function(e){e.url&&e.url!==this.props.url&&this.setState({ustreamSrc:null})}},{key:"componentWillUnmount",value:function(){this.currentTimeInterval&&clearInterval(this.currentTimeInterval)}},{key:"initInterval",value:function(){var e=this;this.currentTimeInterval||(this.currentTimeInterval=setInterval(function(){e.player&&(e.player.getProperty("progress",function(t){e.player.currentTime=t}),e.player.getProperty("duration",function(t){e.player.duration=t}))},500))}},{key:"load",value:function(){var e=this,t=this.props,n=t.onEnded,r=t.onError,o=t.onPause,a=t.onPlay,i=t.onReady,l=t.playing,u=t.url,s=this.parseId(u);this.setState({ustreamSrc:"https://www.ustream.tv/embed/recorded/"+s+"?html5ui=1&autoplay="+l+"&controls=false&showtitle=false"}),(0,c.getSDK)("https://developers.ustream.tv/js/ustream-embedapi.min.js","UstreamEmbed").then(function(t){e.container&&(e.player=t(e.playerID),e.player.addListener("playing",function(e,t){t?a():o()}),e.player.addListener("ready",function(){e.initInterval(),i()}),e.player.addListener("finished",n))},r)}},{key:"play",value:function(){this.callPlayer("callMethod","play")}},{key:"pause",value:function(){this.callPlayer("callMethod","pause")}},{key:"stop",value:function(){this.callPlayer("callMethod","stop")}},{key:"seekTo",value:function(e){this.callPlayer("callMethod","seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("callMethod","volume",100*e)}},{key:"getDuration",value:function(){return this.player.duration}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"},t=this.state.ustreamSrc;return t&&s.default.createElement("iframe",{id:this.playerID,ref:this.ref,src:t,frameBorder:"0",scrolling:"no",style:e,allowFullScreen:!0})}}]),t}(u.Component);h.displayName="UstreamVideo",h.canPlay=function(e){return y.test(e)},h.loopOnEnded=!1,t.default=(0,f.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Iframe=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(1),p=n(2),f=r(p),y="Iframe-player-",d=t.Iframe=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.playerID=y+(0,c.randomString)(),r.player={currentTime:0},r.mute=function(){},r.unmute=function(){},r.ref=function(e){r.container=e},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e){var t=this;this.container?setTimeout(function(){return t.props.onReady()},3e3):this.props.onReady()}},{key:"play",value:function(){this.playTime=Date.now(),this.props.onPlay()}},{key:"pause",value:function(){this.player.currentTime=this.getCurrentTime(),this.playTime=null,this.props.onPause()}},{key:"stop",value:function(){this.player.currentTime=this.getCurrentTime(),this.playTime=null,this.props.onPause()}},{key:"seekTo",value:function(e){}},{key:"setVolume",value:function(e){}},{key:"getDuration",value:function(){return 1/0}},{key:"getCurrentTime",value:function(){var e=0;return this.playTime&&(e=(Date.now()-this.playTime)/1e3),this.player.currentTime+e}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"},t=this.props,n=t.url,r=t.playing;return r?s.default.createElement("iframe",{id:this.playerID,ref:this.ref,src:r&&n,frameBorder:"0",scrolling:"no",style:e,allowFullScreen:!0}):s.default.createElement("div",{style:e},s.default.createElement("div",{style:{alignItems:"center",background:"rgba(255,255,255,0.3)",display:"flex",height:"100%",justifyContent:"center",width:"100%"}},s.default.createElement("div",{className:"pause",style:{borderStyle:"double",borderWidth:"0px 0px 0px 50px",color:"gray",height:"60px"}})))}}]),t}(u.Component);d.displayName="Iframe",d.canPlay=function(e){return!0},t.default=(0,f.default)(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Mixcloud=void 0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),p=n(1),f=n(2),y=r(f),d=/mixcloud\.com\/([^\/]+\/[^\/]+)/,h=t.Mixcloud=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=p.callPlayer,r.duration=null,r.currentTime=null,r.secondsLoaded=null,r.mute=function(){},r.unmute=function(){},r.ref=function(e){r.iframe=e},i=n,a(r,i)}return i(t,e),u(t,[{key:"load",value:function(e){var t=this;(0,p.getSDK)("//widget.mixcloud.com/media/js/widgetApi.js","Mixcloud").then(function(e){t.player=e.PlayerWidget(t.iframe),t.player.ready.then(function(){t.player.events.play.on(t.props.onPlay),t.player.events.pause.on(t.props.onPause),t.player.events.ended.on(t.props.onEnded),t.player.events.error.on(t.props.error),t.player.events.progress.on(function(e,n){t.currentTime=e,t.duration=n}),t.props.onReady()})},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.config,r=t.match(d)[1],o={width:"100%",height:"100%"},a=(0,p.queryString)(l({},n.mixcloud.options,{feed:"/"+r+"/"}));return c.default.createElement("iframe",{key:r,ref:this.ref,style:o,src:"https://www.mixcloud.com/widget/iframe/?"+a,frameBorder:"0"})}}]),t}(s.Component);h.displayName="Mixcloud",h.canPlay=function(e){return d.test(e)},h.loopOnEnded=!0,t.default=(0,y.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e){if(e instanceof Array){var t=!0,n=!1,r=void 0;try{for(var o,a=e[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var i=o.value;if("string"==typeof i&&l(i))return!0;if(l(i.src))return!0}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}return!1}return!!(0,y.isMediaStream)(e)||(m.test(e)||b.test(e)||g.test(e)||w.test(e))}function u(e){return l(e)&&!!document.pictureInPictureEnabled&&!m.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.FilePlayer=void 0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=n(0),f=r(p),y=n(1),d=n(2),h=r(d),v="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,m=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,b=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,g=/\.(m3u8)($|\?)/i,P="https://cdnjs.cloudflare.com/ajax/libs/hls.js/VERSION/hls.min.js",w=/\.(mpd)($|\?)/i,k="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",E=/www\.dropbox\.com\/.+/,O=t.FilePlayer=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.onDisablePIP=function(e){var t=r.props,n=t.onDisablePIP,o=t.playing;n(e),o&&r.play()},r.onSeek=function(e){r.props.onSeek(e.target.currentTime)},r.mute=function(){r.player.muted=!0},r.unmute=function(){r.player.muted=!1},r.renderSourceElement=function(e,t){return"string"==typeof e?f.default.createElement("source",{key:t,src:e}):f.default.createElement("source",s({key:t},e))},r.renderTrack=function(e,t){return f.default.createElement("track",s({key:t},e))},r.ref=function(e){r.player=e},i=n,a(r,i)}return i(t,e),c(t,[{key:"componentDidMount",value:function(){this.addListeners(),v&&this.player.load()}},{key:"componentWillReceiveProps",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.removeListeners()}},{key:"componentDidUpdate",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"addListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onBuffer,o=e.onBufferEnd,a=e.onPause,i=e.onEnded,l=e.onError,u=e.playsinline,s=e.onEnablePIP,c=e.onVolumeChange,p=e.videoElementId;this.player.addEventListener("canplay",t),this.player.addEventListener("play",n),this.player.addEventListener("waiting",r),this.player.addEventListener("playing",o),this.player.addEventListener("pause",a),this.player.addEventListener("seeked",this.onSeek),this.player.addEventListener("ended",i),this.player.addEventListener("error",l),this.player.addEventListener("volumeChange",c),this.player.setAttribute("id",p),this.player.addEventListener("enterpictureinpicture",s),this.player.addEventListener("leavepictureinpicture",this.onDisablePIP),u&&(this.player.setAttribute("playsinline",""),this.player.setAttribute("webkit-playsinline",""),this.player.setAttribute("x5-playsinline",""))}},{key:"removeListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onBuffer,o=e.onBufferEnd,a=e.onPause,i=e.onEnded,l=e.onError,u=e.onEnablePIP,s=e.onVolumeChange;this.player.removeEventListener("canplay",t),this.player.removeEventListener("play",n),this.player.removeEventListener("waiting",r),this.player.removeEventListener("playing",o),this.player.removeEventListener("pause",a),this.player.removeEventListener("seeked",this.onSeek),this.player.removeEventListener("ended",i),this.player.removeEventListener("error",l),this.player.removeEventListener("volumeChange",s),this.player.removeEventListener("enterpictureinpicture",u),this.player.removeEventListener("leavepictureinpicture",this.onDisablePIP)}},{key:"shouldUseAudio",value:function(e){return!e.config.file.forceVideo&&(!e.config.file.attributes.poster&&(m.test(e.url)||e.config.file.forceAudio))}},{key:"shouldUseHLS",value:function(e){return g.test(e)&&!v||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return w.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this,n=this.props.config.file,r=n.hlsVersion,o=n.dashVersion;if(this.shouldUseHLS(e)&&(0,y.getSDK)(P.replace("VERSION",r),"Hls").then(function(n){t.hls=new n(t.props.config.file.hlsOptions),t.hls.on(n.Events.ERROR,function(e,r){t.props.onError(e,r,t.hls,n)}),t.hls.loadSource(e),t.hls.attachMedia(t.player)}),this.shouldUseDASH(e)&&(0,y.getSDK)(k.replace("VERSION",o),"dashjs").then(function(n){t.dash=n.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.getDebug().setLogToBrowserConsole(!1)}),e instanceof Array)this.player.load();else if((0,y.isMediaStream)(e))try{this.player.srcObject=e}catch(t){this.player.src=window.URL.createObjectURL(e)}}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.hls&&this.hls.destroy(),this.dash&&this.dash.reset()}},{key:"seekTo",value:function(e){this.player.currentTime=e}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player&&this.player.requestPictureInPicture()}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player&&document.exitPictureInPicture()}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){if(!this.player)return null;var e=this.player,t=e.duration,n=e.seekable;return t===1/0&&n.length>0?n.end(n.length-1):t}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var e=this.player.buffered;if(0===e.length)return 0;var t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}},{key:"getSource",value:function(e){var t=this.shouldUseHLS(e),n=this.shouldUseDASH(e);if(!(e instanceof Array||(0,y.isMediaStream)(e)||t||n))return E.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.playing,r=e.loop,o=e.controls,a=e.muted,i=e.config,l=e.width,u=e.height,c=this.shouldUseAudio(this.props),p=c?"audio":"video",y={width:"auto"===l?l:"100%",height:"auto"===u?u:"100%"};return f.default.createElement(p,s({ref:this.ref,src:this.getSource(t),style:y,preload:"auto",autoPlay:n||void 0,controls:o,muted:a,loop:r},i.file.attributes),t instanceof Array&&t.map(this.renderSourceElement),i.file.tracks.map(this.renderTrack))}}]),t}(p.Component);O.displayName="FilePlayer",O.canPlay=l,O.canEnablePIP=u,t.default=(0,h.default)(O)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.VAST=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=n(0),f=r(p),y=n(1),d=n(2),h=r(d),v=n(31),m="vast-player-",b="vast-content-",g="vast-play-",P=/^VAST:https:\/\//i,w=t.VAST=function(e){function t(){var e,n,r,o;a(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={adDisplayContainer:null,autoplayChecksResolved:!1,adObject:null,adsInitialized:!1,adsLoader:null,adsManager:null,adsRequest:null,adsUrl:null,autoplayAllowed:null,autoplayRequiresMuted:null,ima:null,preMuteVolume:0,showPlayButton:!1},r.playerID=m+(0,y.randomString)(),r.contentID=b+(0,y.randomString)(),r.playButtonID=g+(0,y.randomString)(),r.callPlayer=y.callPlayer,r.mute=function(){var e=r.state.adsManager;if(!e)return null;r.setState({preMuteVolume:e.getVolume()}),r.setVolume(0)},r.unmute=function(){var e=r.state.preMuteVolume;r.setVolume(e)},r.ref=function(e){r.container=e},o=n,i(r,o)}return l(t,e),c(t,[{key:"onAutoplayWithSoundSuccess",value:function(){document.getElementById(this.playerID).pause(),this.setState({autoplayAllowed:!0,autoplayRequiresMuted:!1,autoplayChecksResolved:!0})}},{key:"onMutedAutoplaySuccess",value:function(){document.getElementById(this.playerID).pause(),this.setState({autoplayAllowed:!0,autoplayRequiresMuted:!0,autoplayChecksResolved:!0})}},{key:"onMutedAutoplayFail",value:function(){var e=document.getElementById(this.playerID);e.volume=1,e.muted=!1,this.setState({autoplayAllowed:!1,autoplayRequiresMuted:!1,autoplayChecksResolved:!0})}},{key:"checkMutedAutoplaySupport",value:function(){var e=this,t=document.getElementById(this.playerID);t.volume=0,t.muted=!0;var n=t.play();void 0!==n&&n.then(function(){e.onMutedAutoplaySuccess()}).catch(function(){e.onMutedAutoplayFail()})}},{key:"checkAutoplaySupport",value:function(){var e=this,t=document.getElementById(this.playerID),n=t.play();void 0!==n&&n.then(function(){e.onAutoplayWithSoundSuccess()}).catch(function(){e.checkMutedAutoplaySupport()})}},{key:"componentDidUpdate",value:function(e,t){if(null===t.adsUrl&&this.state.adsUrl)return this.checkAutoplaySupport();if(!1===t.autoplayChecksResolved&&!0===this.state.autoplayChecksResolved)return this.onAutoplayChecksResolved();if(null===t.adsManager&&this.state.adsManager){this.state.autoplayAllowed?this.playAds():this.setState({showPlayButton:!0})}}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"removeListeners",value:function(){var e=this.state.adsManager;if(window.removeEventListener("resize",this._onWindowResize),e&&this.eventMap){var t=!0,n=!1,r=void 0;try{for(var o,a=Object.entries(this.eventMap)[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var i=o.value,l=s(i,2),u=l[0],c=l[1];e.removeEventListener(u,c)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}}}},{key:"onWindowResize",value:function(){var e=this.state,t=e.adsManager,n=e.ima,r=document.getElementById(this.playerID),o=r.offsetHeight,a=r.offsetWidth;if(!t)return null;t.resize(a,o,n.ViewMode.NORMAL)}},{key:"onLoaded",value:function(e){var t=this.props.onPlay,n=e.getAd();t(),this.setState({adObject:n})}},{key:"onAdsManagerLoaded",value:function(e){var t,n=this.props,r=n.onEnded,a=n.onPause,i=n.onPlay,l=n.onVolumeChange,u=this.state.ima,c=e.getAdsManager(document.getElementById(this.playerID));this._onWindowResize=this.onWindowResize.bind(this),window.addEventListener("resize",this._onWindowResize),this.eventMap=(t={},o(t,u.AdErrorEvent.Type.AD_ERROR,this.onError.bind(this)),o(t,u.AdEvent.Type.COMPLETE,r.bind(this)),o(t,u.AdEvent.Type.LOADED,this.onLoaded.bind(this)),o(t,u.AdEvent.Type.RESUMED,i.bind(this)),o(t,u.AdEvent.Type.PAUSED,a.bind(this)),o(t,u.AdEvent.Type.VOLUME_CHANGED,l.bind(this)),t);var p=!0,f=!1,y=void 0;try{for(var d,h=Object.entries(this.eventMap)[Symbol.iterator]();!(p=(d=h.next()).done);p=!0){var v=d.value,m=s(v,2),b=m[0],g=m[1];c.addEventListener(b,g)}}catch(e){f=!0,y=e}finally{try{!p&&h.return&&h.return()}finally{if(f)throw y}}this.setState({adsManager:c})}},{key:"onAutoplayChecksResolved",value:function(){var e=this.state,t=e.adsUrl,n=e.adsLoader,r=e.autoplayAllowed,o=e.autoplayRequiresMuted,a=e.ima,i=new a.AdsRequest;i.adTagUrl=t,i.setAdWillAutoPlay(r),i.setAdWillPlayMuted(o),n.requestAds(i)}},{key:"playAds",value:function(){var e=this.state,t=e.adDisplayContainer,n=e.adsManager,r=e.adsInitialized,o=e.ima,a=this.props.onReady;try{r||(t.initialize(),this.setState({adsInitialized:!0})),n.init(640,360,o.ViewMode.NORMAL),this.onWindowResize(),n.start(),a()}catch(e){this.props.onEnded()}}},{key:"load",value:function(e){var t=this,n=1e16*Math.random(),r=e.replace(/\[random]/gi,n);(0,v.loadImaSdk)().then(function(e){var n=new e.AdDisplayContainer(document.getElementById(t.contentID),document.getElementById(t.playerID)),o=new e.AdsLoader(n);o.addEventListener(e.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,t.onAdsManagerLoaded.bind(t),!1),o.addEventListener(e.AdErrorEvent.Type.AD_ERROR,t.onError.bind(t),!1),t.setState({ima:e,adDisplayContainer:n,adsLoader:o,adsUrl:r.slice("VAST:".length)})}).catch(function(){t.props.onEnded()})}},{key:"onError",value:function(e){var t=this.props.onError,n=this.state.adsManager;n&&n.destroy(),t(e)}},{key:"play",value:function(){var e=this.state.adsManager;if(!e)return null;e.resume()}},{key:"pause",value:function(){this.state.adsManager.pause()}},{key:"seekTo",value:function(){}},{key:"stop",value:function(){var e=this.state.adsManager;if(!e)return null;e.destroy()}},{key:"setVolume",value:function(e){var t=this.state.adsManager;if(!t)return null;t.setVolume(e)}},{key:"getDuration",value:function(){var e=this.state.adObject;if(!e)return null;var t=e.getDuration();return t>0?t:null}},{key:"getCurrentTime",value:function(){var e=this.state.adsManager;if(!e)return null;var t=this.getDuration(),n=e.getRemainingTime();return Number.isFinite(t)&&Number.isFinite(n)?t-n:null}},{key:"getSecondsLoaded",value:function(){return null}},{key:"onButtonClick",value:function(){var e=this;this.state.adDisplayContainer.initialize();var t=document.getElementById(this.playerID);this.setState({adsInitalized:!0,showPlayButton:!1},function(){t.load(),e.playAds()})}},{key:"render",value:function(){var e=this,t=this.props,n=t.width,r=t.height,o=this.state.showPlayButton,a={width:"auto"===n?n:"100%",height:"auto"===r?r:"100%"},i=u({},a,{top:0,left:0,position:"absolute",zIndex:1}),l={borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",cursor:"pointer",left:"50%",marginLeft:"-8px",marginTop:"-8px",position:"absolute",top:"50%",zIndex:2};return f.default.createElement("div",{style:u({},a,{position:"relative"})},o&&f.default.createElement("div",{style:l,id:this.playButtonID,onClick:function(){return e.onButtonClick()}}),f.default.createElement("video",{ref:this.ref,controls:!1,src:"https://www.maestro.io/pkg/dobi-api/4.0/public/blank.mp4",style:a,preload:"auto",id:this.playerID}),f.default.createElement("div",{id:this.contentID,style:i}))}}]),t}(p.Component);w.displayName="VAST",w.canPlay=function(e){return P.test(e)},t.default=(0,h.default)(w)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return new Promise(function(t,n){var r=document.createElement("script");r.async=!0,r.src=e,r.onload=t,r.onerror=n,document.body.appendChild(r)})};t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.JWPlayer=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(1),p=n(2),f=r(p),y=/jwplayer/,d="jw-player-",h=t.JWPlayer=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.callPlayer=c.callPlayer,r.playerID=d+(0,c.randomString)(),r.mute=function(){r.callPlayer("setMute",!0)},r.unmute=function(){r.callPlayer("setMute",!1)},i=n,a(r,i)}return i(t,e),l(t,[{key:"load",value:function(e,t){var n=this,r=this.props.onError;t?this.player.setup({file:e}):(0,c.getSDK)("//cdn.jwplayer.com/libraries/8DNY8ff0.js","jwplayer").then(function(t){n.player=t(n.playerID).setup({file:e}),n.player.on("ready",n.props.onReady),n.player.on("play",n.props.onPlay),n.player.on("pause",n.props.onPause),n.player.on("error",r)},r)}},{key:"handleUnmount",value:function(){this.callPlayer("remove")}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("stop")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"getVolume",value:function(){return this.callPlayer("getVolume")/100}},{key:"getMuted",value:function(){return this.callPlayer("getMute")}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e={width:"100%",height:"100%"};return s.default.createElement("div",{style:e,id:this.playerID})}}]),t}(u.Component);h.displayName="JWPlayer",h.canPlay=function(e){return y.test(e)},h.loopOnEnded=!0,t.default=(0,f.default)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(){return(0,f.getSDK)(h,v)}function u(e){return m.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.PhenixPlayer=void 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}}(),c=n(0),p=r(c),f=n(1),y=n(2),d=r(y),h="https://unpkg.com/phenix-web-sdk@2019.2.3/dist/phenix-web-sdk.min.js",v="phenix-web-sdk",m=/^phenix:(.+?)\|(.+?)(?:\|(.+?))?$/i,b=t.PhenixPlayer=function(e){function t(){var e,n,r,i;o(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.player=null,r.channelExpress=null,r.playerRef=function(e){e!==r.player&&(r.player&&r.removeListeners(),r.player=e,r.player&&r.addListeners())},r.onSeek=function(e){r.props.onSeek(e.target.currentTime)},r.mute=function(){r.player.muted=!0},r.unmute=function(){r.player.muted=!1},i=n,a(r,i)}return i(t,e),s(t,[{key:"componentWillUnmount",value:function(){this.player&&(this.removeListeners(),this.player=null),this.channelExpress&&(this.channelExpress.dispose(),this.channelExpress=null)}},{key:"addListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onPause,o=e.onEnded,a=e.onVolumeChange,i=e.onError,l=e.playsinline,u=e.videoElementId;this.player.addEventListener("canplay",t),this.player.addEventListener("play",n),this.player.addEventListener("pause",r),this.player.addEventListener("seeked",this.onSeek),this.player.addEventListener("ended",o),this.player.addEventListener("error",i),this.player.addEventListener("volumechange",a),this.player.setAttribute("id",u),l&&(this.player.setAttribute("playsinline",""),this.player.setAttribute("webkit-playsinline",""))}},{key:"removeListeners",value:function(){var e=this.props,t=e.onReady,n=e.onPlay,r=e.onPause,o=e.onEnded,a=e.onVolumeChange,i=e.onError;this.player.removeEventListener("canplay",t),this.player.removeEventListener("play",n),this.player.removeEventListener("pause",r),this.player.removeEventListener("seeked",this.onSeek),this.player.removeEventListener("ended",o),this.player.removeEventListener("error",i),this.player.removeEventListener("volumechange",a)}},{key:"getPhenixBackendUri",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.url;return m.exec(e)[1]}},{key:"getPhenixChannelId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.url;return m.exec(e)[2]}},{key:"getPhenixAuthenticationData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.url,t=m.exec(e)[3];return t?JSON.parse(t):{}}},{key:"load",value:function(e){var t=this,n=this.getPhenixBackendUri(e),r=this.getPhenixChannelId(e),o=this.getPhenixAuthenticationData(e),a=function(e,n){if(e||"ok"!==n.status){var r=e||new Error("Response status: "+n.status);t.props.onError(r)}},i=function(e,n){if(e||!["ok","no-stream-playing"].includes(n.status)){var r=e||new Error("Response status: "+n.status);t.props.onError(r)}};l().then(function(l){e===t.props.url&&(t.channelExpress&&(t.channelExpress.dispose(),t.channelExpress=null),t.channelExpress=new l.express.ChannelExpress({authenticationData:o,backendUri:n}),t.channelExpress.joinChannel({channelId:r,videoElement:t.player},a,i))})}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.channelExpress&&(this.channelExpress.dispose(),this.channelExpress=null)}},{key:"seekTo",value:function(e){e!==1/0&&this.getDuration()!==1/0&&(this.player.currentTime=e)}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){return this.player.duration}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){var e=this.player.buffered;if(0===e.length)return 0;var t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}},{key:"render",value:function(){var e=this.props,t=e.playing,n=e.loop,r=e.controls,o=e.muted,a=e.width,i=e.height,l={width:"auto"===a?a:"100%",height:"auto"===i?i:"100%"};return p.default.createElement("video",{ref:this.playerRef,style:l,preload:"auto",autoPlay:t,controls:r,muted:o,loop:n})}}]),t}(c.Component);b.displayName="PhenixPlayer",b.canPlay=u,t.default=(0,d.default)(b)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.PhenixPlayer=t.JWPlayer=t.VAST=t.FilePlayer=t.Mixcloud=t.Iframe=t.UstreamVideo=t.UstreamLive=t.DailyMotion=t.Twitch=t.Wistia=t.FaceMask=t.Streamable=t.Facebook=t.Vimeo=t.SoundCloud=t.YouTube=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(4);Object.defineProperty(t,"YouTube",{enumerable:!0,get:function(){return r(c).default}});var p=n(6);Object.defineProperty(t,"SoundCloud",{enumerable:!0,get:function(){return r(p).default}});var f=n(7);Object.defineProperty(t,"Vimeo",{enumerable:!0,get:function(){return r(f).default}});var y=n(9);Object.defineProperty(t,"Facebook",{enumerable:!0,get:function(){return r(y).default}});var d=n(10);Object.defineProperty(t,"Streamable",{enumerable:!0,get:function(){return r(d).default}});var h=n(11);Object.defineProperty(t,"FaceMask",{enumerable:!0,get:function(){return r(h).default}});var v=n(12);Object.defineProperty(t,"Wistia",{enumerable:!0,get:function(){return r(v).default}});var m=n(13);Object.defineProperty(t,"Twitch",{enumerable:!0,get:function(){return r(m).default}});var b=n(8);Object.defineProperty(t,"DailyMotion",{enumerable:!0,get:function(){return r(b).default}});var g=n(14);Object.defineProperty(t,"UstreamLive",{enumerable:!0,get:function(){return r(g).default}});var P=n(15);Object.defineProperty(t,"UstreamVideo",{enumerable:!0,get:function(){return r(P).default}});var w=n(16);Object.defineProperty(t,"Iframe",{enumerable:!0,get:function(){return r(w).default}});var k=n(17);Object.defineProperty(t,"Mixcloud",{enumerable:!0,get:function(){return r(k).default}});var E=n(18);Object.defineProperty(t,"FilePlayer",{enumerable:!0,get:function(){return r(E).default}});var O=n(19);Object.defineProperty(t,"VAST",{enumerable:!0,get:function(){return r(O).default}});var _=n(21);Object.defineProperty(t,"JWPlayer",{enumerable:!0,get:function(){return r(_).default}});var j=n(22);Object.defineProperty(t,"PhenixPlayer",{enumerable:!0,get:function(){return r(j).default}});var S=n(0),T=r(S),D=n(3),R=n(1),C=n(33),I=r(C),L=n(5),A=r(L),M=n(34),x=r(M),V=n(35),U=r(V),N=Object.keys(D.propTypes),B=[],ReactPlayer=function(e){function ReactPlayer(){var e,t,n,r;a(this,ReactPlayer);for(var o=arguments.length,l=Array(o),u=0;u<o;u++)l[u]=arguments[u];return t=n=i(this,(e=ReactPlayer.__proto__||Object.getPrototypeOf(ReactPlayer)).call.apply(e,[this].concat(l))),n.config=(0,R.getConfig)(n.props,D.defaultProps,!0),n.state={showPreview:!!n.props.light},n.onClickPreview=function(){n.setState({showPreview:!1})},n.getDuration=function(){return n.player?n.player.getDuration():null},n.getCurrentTime=function(){return n.player?n.player.getCurrentTime():null},n.getSecondsLoaded=function(){return n.player?n.player.getSecondsLoaded():null},n.getInternalPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return n.player?n.player.getInternalPlayer(e):null},n.seekTo=function(e,t){if(!n.player)return null;n.player.seekTo(e,t)},n.onReady=function(){n.props.onReady(n)},n.wrapperRef=function(e){n.wrapper=e},n.activePlayerRef=function(e){n.player=e},r=t,i(n,r)}return l(ReactPlayer,e),s(ReactPlayer,[{key:"componentDidMount",value:function(){if(this.props.progressFrequency){console.warn("ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead","font-weight: bold","","font-weight: bold","")}}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,R.isEqual)(this.props,e)||!(0,R.isEqual)(this.state,t)}},{key:"componentWillUpdate",value:function(e){this.config=(0,R.getConfig)(e,D.defaultProps),!this.props.light&&e.light&&this.setState({showPreview:!0})}},{key:"getActivePlayer",value:function(e){for(var t=[].concat(o(B),o(I.default)),n=0;n<t.length;n++){var r=t[n];if(r.canPlay(e))return r}return w.Iframe}},{key:"renderActivePlayer",value:function(e,t){return e?T.default.createElement(A.default,u({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t,onReady:this.onReady})):null}},{key:"sortPlayers",value:function(e,t){return e&&t?e.key<t.key?-1:1:0}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.controls,r=e.style,a=e.width,i=e.height,l=e.light,s=e.wrapper,c=this.state.showPreview&&t,p=(0,R.omit)(this.props,N,D.DEPRECATED_CONFIG_PROPS),f=this.getActivePlayer(t),y=this.renderActivePlayer(t,f),d=(0,U.default)(t,n,this.config),h=[y].concat(o(d)).sort(this.sortPlayers),v=T.default.createElement(x.default,{url:t,light:l,onClick:this.onClickPreview});return T.default.createElement(s,u({ref:this.wrapperRef,style:u({},r,{width:a,height:i})},p),c?v:h)}}]),ReactPlayer}(S.Component);ReactPlayer.addCustomPlayer=function(e){B.push(e)},ReactPlayer.removeCustomPlayers=function(){B=[]},ReactPlayer.displayName="ReactPlayer",ReactPlayer.propTypes=D.propTypes,ReactPlayer.defaultProps=D.defaultProps,ReactPlayer.canPlay=function(e){for(var t=[].concat(o(B),o(I.default)),n=0;n<t.length;n++){if(t[n].canPlay(e))return!0}return!1},ReactPlayer.canEnablePIP=function(e){for(var t=[].concat(o(B),o(I.default)),n=0;n<t.length;n++){var r=t[n];if(r.canEnablePIP&&r.canEnablePIP(e))return!0}return!1},t.default=ReactPlayer},function(e,t,n){"use strict";function r(e,t){for(var n in t)e.setAttribute(n,t[n])}function o(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function a(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,t,n){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("script");"function"==typeof t&&(n=t,t={}),t=t||{},n=n||function(){},l.type=t.type||"text/javascript",l.charset=t.charset||"utf8",l.async=!("async"in t)||!!t.async,l.src=e,t.attrs&&r(l,t.attrs),t.text&&(l.text=""+t.text),("onload"in l?o:a)(l,n),l.onload||o(l,n),i.appendChild(l)}},function(e,t,n){"use strict";var r,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(i,l){"object"===a(t)&&void 0!==e?e.exports=l():(r=l,void 0!==(o="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=o))}(0,function(){function e(e){return!!e&&"object"===(void 0===e?"undefined":a(e))}function t(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||n(e)}function n(e){return e.$$typeof===p}function r(e){return Array.isArray(e)?[]:{}}function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?u(r(e),e,t):e}function i(e,t,n){return e.concat(t).map(function(e){return o(e,n)})}function l(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(t){r[t]=o(e[t],n)}),Object.keys(t).forEach(function(a){n.isMergeableObject(t[a])&&e[a]?r[a]=u(e[a],t[a],n):r[a]=o(t[a],n)}),r}function u(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||i,n.isMergeableObject=n.isMergeableObject||s;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):l(e,t,n):o(t,n)}var s=function(n){return e(n)&&!t(n)},c="function"==typeof Symbol&&Symbol.for,p=c?Symbol.for("react.element"):60103;return u.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return u(e,n,t)},{})},u})},function(e,t,n){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=n(27)()},function(e,t,n){"use strict";var r=n(28),o=n(29),a=n(30);e.exports=function(){function e(e,t,n,r,i,l){l!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,a,i,l,u){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,i,l,u],p=0;s=new Error(t.replace(/%s/g,function(){return c[p++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(32);Object.defineProperty(t,"loadImaSdk",{enumerable:!0,get:function(){return r(o).default}});var a=n(20);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return r(a).default}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20),o=function(e){return e&&e.__esModule?e:{default:e}}(r),a=null,i=function(){a=null},l=function(){return window.google&&window.google.ima?Promise.resolve(window.google.ima):a||(a=(0,o.default)("//imasdk.googleapis.com/js/sdkloader/ima3.js").then(function(){return window.google.ima}),a.then(i).catch(i),a)};t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(6),a=n(7),i=n(9),l=n(10),u=n(11),s=n(12),c=n(13),p=n(8),f=n(14),y=n(15),d=n(16),h=n(17),v=n(18),m=n(19),b=n(21),g=n(22);t.default=[g.PhenixPlayer,r.YouTube,o.SoundCloud,a.Vimeo,i.Facebook,l.Streamable,u.FaceMask,s.Wistia,c.Twitch,p.DailyMotion,h.Mixcloud,f.UstreamLive,y.UstreamVideo,b.JWPlayer,m.VAST,v.FilePlayer,d.Iframe]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(){var e,n,a,i;r(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.state={image:null},i=n,o(a,i)}return a(t,e),l(t,[{key:"componentDidMount",value:function(){this.fetchImage(this.props)}},{key:"componentWillReceiveProps",value:function(e){this.props.url!==e.url&&this.fetchImage(e)}},{key:"fetchImage",value:function(e){var t=this,n=e.url,r=e.light;return"string"==typeof r?void this.setState({image:r}):(this.setState({image:null}),window.fetch("https://noembed.com/embed?url="+n).then(function(e){return e.json()}).then(function(e){if(e.thumbnail_url){var n=e.thumbnail_url.replace("height=100","height=480");t.setState({image:n})}}))}},{key:"render",value:function(){var e=this.props.onClick,t=this.state.image,n={display:"flex",alignItems:"center",justifyContent:"center"},r={preview:i({width:"100%",height:"100%",backgroundImage:t?"url("+t+")":void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer"},n),shadow:i({background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:"64px",width:"64px",height:"64px"},n),playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}};return s.default.createElement("div",{style:r.preview,className:"react-player__preview",onClick:e},s.default.createElement("div",{style:r.shadow,className:"react-player__shadow"},s.default.createElement("div",{style:r.playIcon,className:"react-player__play-icon"})))}}]),t}(u.Component);t.default=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var r=[],o=!0,a=!1,l=void 0;try{for(var s,c=y[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var p=s.value;!p.Player.canPlay(e)&&n[p.configKey].preload&&r.push(i.default.createElement(u.default,{key:p.Player.displayName,activePlayer:p.Player,url:p.url,controls:t,playing:!0,muted:!0,style:{display:"none"}}))}}catch(e){a=!0,l=e}finally{try{!o&&c.return&&c.return()}finally{if(a)throw l}}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var a=n(0),i=r(a),l=n(5),u=r(l),s=n(4),c=n(6),p=n(7),f=n(8),y=[{Player:s.YouTube,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:c.SoundCloud,configKey:"soundcloud",url:"https://soundcloud.com/seucheu/john-cage-433-8-bit-version"},{Player:p.Vimeo,configKey:"vimeo",url:"https://vimeo.com/300970506"},{Player:f.DailyMotion,configKey:"dailymotion",url:"http://www.dailymotion.com/video/xqdpyk"}]}]).default;
2//# sourceMappingURL=ReactPlayer.js.map
\No newline at end of file