From 921b0e01148925f048716435333fcdc9ce2df24a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:48:26 +0000 Subject: [PATCH] docs(CHANGELOG): 2.14.1 --- CHANGELOG.md | 17 +++++++++++++++++ dist/ReactPlayer.js | 2 +- dist/ReactPlayer.js.map | 6 +++--- dist/ReactPlayer.standalone.js | 6 +++--- dist/ReactPlayer.standalone.js.map | 6 +++--- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf4a802c..656e5641 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,27 @@ +## [2.14.1](https://github.com/cookpete/react-player/compare/v2.14.0...v2.14.1) (2023-12-19) + + +### Bug Fixes + +* cjs interop require default pita ([#1722](https://github.com/cookpete/react-player/issues/1722)) ([a35f3c5](https://github.com/cookpete/react-player/commit/a35f3c5650b6482589b29a86ad75f0d94f920fde)) + + + ### Changelog All notable changes to this project will be documented in this file. Dates are displayed in UTC. Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.14.1](https://github.com/cookpete/react-player/compare/v2.14.0...v2.14.1) + +- fix: cjs interop require default pita [`#1722`](https://github.com/cookpete/react-player/pull/1722) +- chore: npm ignore unneeded folders [`678f466`](https://github.com/cookpete/react-player/commit/678f466553d36dc02dfe2b926a31e8694b746842) + #### [v2.14.0](https://github.com/cookpete/react-player/compare/v2.13.0...v2.14.0) +> 14 December 2023 + - fix: repo url [`#1709`](https://github.com/cookpete/react-player/pull/1709) - fix: pkg repository.url [`#1708`](https://github.com/cookpete/react-player/pull/1708) - chore: add CD workflow [`#1706`](https://github.com/cookpete/react-player/pull/1706) @@ -13,6 +29,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - docs: update demo App.js link [`#1689`](https://github.com/cookpete/react-player/pull/1689) - fix: modernize build using esbuild [`#1684`](https://github.com/cookpete/react-player/pull/1684) - docs(CHANGELOG): 2.14.0 [`e018c42`](https://github.com/cookpete/react-player/commit/e018c4255dee89a1684f2fff8b1cb4db81ad2cce) +- chore(release): 2.14.0 [`1496f67`](https://github.com/cookpete/react-player/commit/1496f679fcefae26ecb5b1ea77c75b36f401dd90) #### [v2.13.0](https://github.com/cookpete/react-player/compare/v2.12.0...v2.13.0) diff --git a/dist/ReactPlayer.js b/dist/ReactPlayer.js index 04a250a6..4294126b 100644 --- a/dist/ReactPlayer.js +++ b/dist/ReactPlayer.js @@ -1,3 +1,3 @@ -var ReactPlayer=(()=>{var ar=Object.create;var ie=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames;var ur=Object.getPrototypeOf,hr=Object.prototype.hasOwnProperty;var cr=(t,n,e)=>n in t?ie(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var S=(t,n)=>()=>(t&&(n=t(t=0)),n);var V=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),T=(t,n)=>{for(var e in n)ie(t,e,{get:n[e],enumerable:!0})},Je=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of pr(n))!hr.call(t,o)&&o!==e&&ie(t,o,{get:()=>n[o],enumerable:!(r=lr(n,o))||r.enumerable});return t};var y=(t,n,e)=>(e=t!=null?ar(ur(t)):{},Je(n||!t||!t.__esModule?ie(e,"default",{value:t,enumerable:!0}):e,t)),dr=t=>Je(ie({},"__esModule",{value:!0}),t);var s=(t,n,e)=>(cr(t,typeof n!="symbol"?n+"":n,e),e);var g=V((Ks,et)=>{et.exports=globalThis.React});var st=V(($s,rt)=>{rt.exports=function(n,e,r){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof e=="function"&&(r=e,e={}),e=e||{},r=r||function(){},i.type=e.type||"text/javascript",i.charset=e.charset||"utf8",i.async="async"in e?!!e.async:!0,i.src=n,e.attrs&&yr(i,e.attrs),e.text&&(i.text=""+e.text);var a="onload"in i?tt:fr;a(i,r),i.onload||tt(i,r),o.appendChild(i)};function yr(t,n){for(var e in n)t.setAttribute(e,n[e])}function tt(t,n){t.onload=function(){this.onerror=this.onload=null,n(null,t)},t.onerror=function(){this.onerror=this.onload=null,n(new Error("Failed to load "+this.src),t)}}function fr(t,n){t.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,n(null,t))}}});var ke=V((zs,ot)=>{"use strict";var mr=function(n){return Pr(n)&&!gr(n)};function Pr(t){return!!t&&typeof t=="object"}function gr(t){var n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||Sr(t)}var br=typeof Symbol=="function"&&Symbol.for,Er=br?Symbol.for("react.element"):60103;function Sr(t){return t.$$typeof===Er}function wr(t){return Array.isArray(t)?[]:{}}function oe(t,n){return n.clone!==!1&&n.isMergeableObject(t)?G(wr(t),t,n):t}function vr(t,n,e){return t.concat(n).map(function(r){return oe(r,e)})}function Lr(t,n){if(!n.customMerge)return G;var e=n.customMerge(t);return typeof e=="function"?e:G}function Tr(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}function nt(t){return Object.keys(t).concat(Tr(t))}function it(t,n){try{return n in t}catch{return!1}}function _r(t,n){return it(t,n)&&!(Object.hasOwnProperty.call(t,n)&&Object.propertyIsEnumerable.call(t,n))}function Rr(t,n,e){var r={};return e.isMergeableObject(t)&&nt(t).forEach(function(o){r[o]=oe(t[o],e)}),nt(n).forEach(function(o){_r(t,o)||(it(t,o)&&e.isMergeableObject(n[o])?r[o]=Lr(o,e)(t[o],n[o],e):r[o]=oe(n[o],e))}),r}function G(t,n,e){e=e||{},e.arrayMerge=e.arrayMerge||vr,e.isMergeableObject=e.isMergeableObject||mr,e.cloneUnlessOtherwiseSpecified=oe;var r=Array.isArray(n),o=Array.isArray(t),i=r===o;return i?r?e.arrayMerge(t,n,e):Rr(t,n,e):oe(n,e)}G.all=function(n,e){if(!Array.isArray(n))throw new Error("first argument should be an array");return n.reduce(function(r,o){return G(r,o,e)},{})};var Ar=G;ot.exports=Ar});function lt(t,n){if(t instanceof Array)return;let e=t.match(n);if(e){let r=e[1];if(r.match(Me))return Cr(r);if(kr.test(r))return parseInt(r)}}function Cr(t){let n=0,e=Me.exec(t);for(;e!==null;){let[,r,o]=e;o==="h"&&(n+=parseInt(r,10)*60*60),o==="m"&&(n+=parseInt(r,10)*60),o==="s"&&(n+=parseInt(r,10)),e=Me.exec(t)}return n}function C(t){return lt(t,Ir)}function xe(t){return lt(t,Or)}function q(){return Math.random().toString(36).substr(2,5)}function pt(t){return Object.keys(t).map(n=>`${n}=${t[n]}`).join("&")}function Ce(t){return window[t]?window[t]:window.exports&&window.exports[t]?window.exports[t]:window.module&&window.module.exports&&window.module.exports[t]?window.module.exports[t]:null}function ut(t,...n){let e=[].concat(...n),r={},o=Object.keys(t);for(let i of o)e.indexOf(i)===-1&&(r[i]=t[i]);return r}function f(t,...n){if(!this.player||!this.player[t]){let e=`ReactPlayer: ${this.constructor.displayName} player could not call %c${t}%c \u2013 `;return this.player?this.player[t]||(e+="The method was not available"):e+="The player was not available",console.warn(e,"font-weight: bold",""),null}return this.player[t](...n)}function M(t){return typeof window!="undefined"&&typeof window.MediaStream!="undefined"&&t instanceof window.MediaStream}function ht(t){return/^blob:/.test(t)}function X(t=document.createElement("video")){let n=/iPhone|iPod/.test(navigator.userAgent)===!1;return t.webkitSupportsPresentationMode&&typeof t.webkitSetPresentationMode=="function"&&n}var at,Dr,Ir,Or,Me,kr,W,d,b=S(()=>{at=y(st()),Dr=y(ke()),Ir=/[?&#](?:start|t)=([0-9hms]+)/,Or=/[?&#]end=([0-9hms]+)/,Me=/(\d+)(h|m|s)/g,kr=/^\d+$/;W={},d=function(n,e,r=null,o=()=>!0,i=at.default){let a=Ce(e);return a&&o(a)?Promise.resolve(a):new Promise((l,p)=>{if(W[n]){W[n].push({resolve:l,reject:p});return}W[n]=[{resolve:l,reject:p}];let u=h=>{W[n].forEach(P=>P.resolve(h))};if(r){let h=window[r];window[r]=function(){h&&h(),u(Ce(e))}}i(n,h=>{h?(W[n].forEach(P=>P.reject(h)),W[n]=null):r||u(Ce(e))})})}});var de,Mr,xr,Ur,Nr,Ne,Ve,Be,ye,He,je,Ke,Vr,Z,ct,fe,$e,ze,Ue,c,_=S(()=>{b();de=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,Mr=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,xr=/vimeo\.com\/(?!progressive_redirect).+/,Ur=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,Nr=/^https?:\/\/fb\.watch\/.+$/,Ne=/streamable\.com\/([a-z0-9]+)$/,Ve=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,Be=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,ye=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,He=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,je=/mixcloud\.com\/([^/]+\/[^/]+)/,Ke=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,Vr=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,Z=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,ct=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,fe=/\.(m3u8)($|\?)/i,$e=/\.(mpd)($|\?)/i,ze=/\.(flv)($|\?)/i,Ue=t=>{if(t instanceof Array){for(let n of t)if(typeof n=="string"&&Ue(n)||Ue(n.src))return!0;return!1}return M(t)||ht(t)?!0:Z.test(t)||ct.test(t)||fe.test(t)||$e.test(t)||ze.test(t)},c={youtube:t=>t instanceof Array?t.every(n=>de.test(n)):de.test(t),soundcloud:t=>Mr.test(t)&&!Z.test(t),vimeo:t=>xr.test(t)&&!ct.test(t)&&!fe.test(t),facebook:t=>Ur.test(t)||Nr.test(t),streamable:t=>Ne.test(t),wistia:t=>Ve.test(t),twitch:t=>Be.test(t)||ye.test(t),dailymotion:t=>He.test(t),mixcloud:t=>je.test(t),vidyard:t=>Ke.test(t),kaltura:t=>Vr.test(t),file:Ue}});var yt={};T(yt,{default:()=>Q});var ae,Br,dt,Hr,me,Fe,jr,Kr,Q,ft=S(()=>{ae=y(g());b();_();Br="https://www.youtube.com/iframe_api",dt="YT",Hr="onYouTubeIframeAPIReady",me=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,Fe=/user\/([a-zA-Z0-9_-]+)\/?/,jr=/youtube-nocookie\.com/,Kr="https://www.youtube-nocookie.com",Q=class extends ae.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(me.test(e)){let[,r]=e.match(me);return{listType:"playlist",list:r.replace(/^UC/,"UU")}}if(Fe.test(e)){let[,r]=e.match(Fe);return{listType:"user_uploads",list:r}}return{}});s(this,"onStateChange",e=>{let{data:r}=e,{onPlay:o,onPause:i,onBuffer:a,onBufferEnd:l,onEnded:p,onReady:u,loop:h,config:{playerVars:P,onUnstarted:I}}=this.props,{UNSTARTED:k,PLAYING:N,PAUSED:O,BUFFERING:Ie,ENDED:Oe,CUED:ir}=window[dt].PlayerState;if(r===k&&I(),r===N&&(o(),l()),r===O&&i(),r===Ie&&a(),r===Oe){let or=!!this.callPlayer("getPlaylist");h&&!or&&(P.start?this.seekTo(P.start):this.play()),p()}r===ir&&u()});s(this,"mute",()=>{this.callPlayer("mute")});s(this,"unmute",()=>{this.callPlayer("unMute")});s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||me.test(e)?null:e.match(de)[1]}load(e,r){let{playing:o,muted:i,playsinline:a,controls:l,loop:p,config:u,onError:h}=this.props,{playerVars:P,embedOptions:I}=u,k=this.getID(e);if(r){if(me.test(e)||Fe.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:k,startSeconds:C(e)||P.start,endSeconds:xe(e)||P.end});return}d(Br,dt,Hr,N=>N.loaded).then(N=>{this.container&&(this.player=new N.Player(this.container,{width:"100%",height:"100%",videoId:k,playerVars:{autoplay:o?1:0,mute:i?1:0,controls:l?1:0,start:C(e),end:xe(e),origin:window.location.origin,playsinline:a?1:0,...this.parsePlaylist(e),...P},events:{onReady:()=>{p&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:O=>this.props.onPlaybackRateChange(O.data),onPlaybackQualityChange:O=>this.props.onPlaybackQualityChange(O),onStateChange:this.onStateChange,onError:O=>h(O.data)},host:jr.test(e)?Kr:void 0,...I}))},h),I.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer\u2019s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,r=!1){this.callPlayer("seekTo",e),!r&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){let{display:e}=this.props;return ae.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},ae.default.createElement("div",{ref:this.ref}))}};s(Q,"displayName","YouTube"),s(Q,"canPlay",c.youtube)});var mt={};T(mt,{default:()=>B});var Pe,$r,zr,B,Pt=S(()=>{Pe=y(g());b();_();$r="https://w.soundcloud.com/player/api.js",zr="SC",B=class extends Pe.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"duration",null);s(this,"currentTime",null);s(this,"fractionLoaded",null);s(this,"mute",()=>{this.setVolume(0)});s(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)});s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){d($r,zr).then(o=>{if(!this.iframe)return;let{PLAY:i,PLAY_PROGRESS:a,PAUSE:l,FINISH:p,ERROR:u}=o.Widget.Events;r||(this.player=o.Widget(this.iframe),this.player.bind(i,this.props.onPlay),this.player.bind(l,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(a,h=>{this.currentTime=h.currentPosition/1e3,this.fractionLoaded=h.loadedProgress}),this.player.bind(p,()=>this.props.onEnded()),this.player.bind(u,h=>this.props.onError(h))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(h=>{this.duration=h/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){let{display:e}=this.props,r={width:"100%",height:"100%",display:e};return Pe.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}};s(B,"displayName","SoundCloud"),s(B,"canPlay",c.soundcloud),s(B,"loopOnEnded",!0)});var gt={};T(gt,{default:()=>H});var ge,Fr,Yr,Gr,H,bt=S(()=>{ge=y(g());b();_();Fr="https://player.vimeo.com/api/player.js",Yr="Vimeo",Gr=t=>t.replace("/manage/videos",""),H=class extends ge.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"duration",null);s(this,"currentTime",null);s(this,"secondsLoaded",null);s(this,"mute",()=>{this.setMuted(!0)});s(this,"unmute",()=>{this.setMuted(!1)});s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,d(Fr,Yr).then(r=>{if(!this.container)return;let{playerOptions:o,title:i}=this.props.config;this.player=new r.Player(this.container,{url:Gr(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...o}),this.player.ready().then(()=>{let a=this.container.querySelector("iframe");a.style.width="100%",a.style.height="100%",i&&(a.title=i)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",a=>this.props.onSeek(a.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:a})=>{this.currentTime=a}),this.player.on("progress",({seconds:a})=>{this.secondsLoaded=a}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",a=>this.props.onPlaybackRateChange(a.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){let e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){let{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return ge.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}};s(H,"displayName","Vimeo"),s(H,"canPlay",c.vimeo),s(H,"forceLoad",!0)});var vt={};T(vt,{default:()=>j});var be,Et,St,wt,Wr,j,Lt=S(()=>{be=y(g());b();_();Et="https://connect.facebook.net/en_US/sdk.js",St="FB",wt="fbAsyncInit",Wr="facebook-player-",j=class extends be.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"playerID",this.props.config.playerId||`${Wr}${q()}`);s(this,"mute",()=>{this.callPlayer("mute")});s(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){d(Et,St,wt).then(o=>o.XFBML.parse());return}d(Et,St,wt).then(o=>{o.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),o.Event.subscribe("xfbml.render",i=>{this.props.onLoaded()}),o.Event.subscribe("xfbml.ready",i=>{i.type==="video"&&i.id===this.playerID&&(this.player=i.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){let{attributes:e}=this.props.config;return be.default.createElement("div",{style:{width:"100%",height:"100%"},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",...e})}};s(j,"displayName","Facebook"),s(j,"canPlay",c.facebook),s(j,"loopOnEnded",!0)});var Tt={};T(Tt,{default:()=>J});var Ee,qr,Xr,J,_t=S(()=>{Ee=y(g());b();_();qr="https://cdn.embed.ly/player-0.1.0.min.js",Xr="playerjs",J=class extends Ee.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"duration",null);s(this,"currentTime",null);s(this,"secondsLoaded",null);s(this,"mute",()=>{this.callPlayer("mute")});s(this,"unmute",()=>{this.callPlayer("unmute")});s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){d(qr,Xr).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:o,seconds:i})=>{this.duration=o,this.currentTime=i}),this.player.on("buffered",({percent:o})=>{this.duration&&(this.secondsLoaded=this.duration*o)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){let e=this.props.url.match(Ne)[1],r={width:"100%",height:"100%"};return Ee.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}};s(J,"displayName","Streamable"),s(J,"canPlay",c.streamable)});var Rt={};T(Rt,{default:()=>K});var Se,Zr,Qr,Jr,K,At=S(()=>{Se=y(g());b();_();Zr="https://fast.wistia.com/assets/external/E-v1.js",Qr="Wistia",Jr="wistia-player-",K=class extends Se.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"playerID",this.props.config.playerId||`${Jr}${q()}`);s(this,"onPlay",(...e)=>this.props.onPlay(...e));s(this,"onPause",(...e)=>this.props.onPause(...e));s(this,"onSeek",(...e)=>this.props.onSeek(...e));s(this,"onEnded",(...e)=>this.props.onEnded(...e));s(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e));s(this,"mute",()=>{this.callPlayer("mute")});s(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){let{playing:r,muted:o,controls:i,onReady:a,config:l,onError:p}=this.props;d(Zr,Qr).then(u=>{l.customControls&&l.customControls.forEach(h=>u.defineControl(h)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:r,silentAutoPlay:"allow",muted:o,controlsVisibleOnLoad:i,fullscreenButton:i,playbar:i,playbackRateControl:i,qualityControl:i,volumeControl:i,settingsControl:i,smallPlayButton:i,...l.options},onReady:h=>{this.player=h,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),a()}})},p)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,r=!0){this.callPlayer("time",e),r||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){let{url:e}=this.props,r=e&&e.match(Ve)[1],o=`wistia_embed wistia_async_${r}`,i={width:"100%",height:"100%"};return Se.default.createElement("div",{id:this.playerID,key:r,className:o,style:i})}};s(K,"displayName","Wistia"),s(K,"canPlay",c.wistia),s(K,"loopOnEnded",!0)});var Dt={};T(Dt,{default:()=>$});var we,es,ts,rs,$,It=S(()=>{we=y(g());b();_();es="https://player.twitch.tv/js/embed/v1.js",ts="Twitch",rs="twitch-player-",$=class extends we.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"playerID",this.props.config.playerId||`${rs}${q()}`);s(this,"mute",()=>{this.callPlayer("setMuted",!0)});s(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){let{playsinline:o,onError:i,config:a,controls:l}=this.props,p=ye.test(e),u=p?e.match(ye)[1]:e.match(Be)[1];if(r){p?this.player.setChannel(u):this.player.setVideo("v"+u);return}d(es,ts).then(h=>{this.player=new h.Player(this.playerID,{video:p?"":u,channel:p?u:"",height:"100%",width:"100%",playsinline:o,autoplay:this.props.playing,muted:this.props.muted,controls:p?!0:l,time:C(e),...a.options});let{READY:P,PLAYING:I,PAUSE:k,ENDED:N,ONLINE:O,OFFLINE:Ie,SEEK:Oe}=h.Player;this.player.addEventListener(P,this.props.onReady),this.player.addEventListener(I,this.props.onPlay),this.player.addEventListener(k,this.props.onPause),this.player.addEventListener(N,this.props.onEnded),this.player.addEventListener(Oe,this.props.onSeek),this.player.addEventListener(O,this.props.onLoaded),this.player.addEventListener(Ie,this.props.onLoaded)},i)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){return we.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}};s($,"displayName","Twitch"),s($,"canPlay",c.twitch),s($,"loopOnEnded",!0)});var Ot={};T(Ot,{default:()=>z});var le,ss,ns,is,z,kt=S(()=>{le=y(g());b();_();ss="https://api.dmcdn.net/all.js",ns="DM",is="dmAsyncInit",z=class extends le.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"onDurationChange",()=>{let e=this.getDuration();this.props.onDuration(e)});s(this,"mute",()=>{this.callPlayer("setMuted",!0)});s(this,"unmute",()=>{this.callPlayer("setMuted",!1)});s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){let{controls:r,config:o,onError:i,playing:a}=this.props,[,l]=e.match(He);if(this.player){this.player.load(l,{start:C(e),autoplay:a});return}d(ss,ns,is,p=>p.player).then(p=>{if(!this.container)return;let u=p.player;this.player=new u(this.container,{width:"100%",height:"100%",video:l,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:C(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:h=>i(h)}})},i)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){let{display:e}=this.props;return le.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},le.default.createElement("div",{ref:this.ref}))}};s(z,"displayName","DailyMotion"),s(z,"canPlay",c.dailymotion),s(z,"loopOnEnded",!0)});var Ct={};T(Ct,{default:()=>F});var ve,os,as,F,Mt=S(()=>{ve=y(g());b();_();os="https://widget.mixcloud.com/media/js/widgetApi.js",as="Mixcloud",F=class extends ve.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"duration",null);s(this,"currentTime",null);s(this,"secondsLoaded",null);s(this,"mute",()=>{});s(this,"unmute",()=>{});s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){d(os,as).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((o,i)=>{this.currentTime=o,this.duration=i}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){let{url:e,config:r}=this.props,o=e.match(je)[1],i={width:"100%",height:"100%"},a=pt({...r.options,feed:`/${o}/`});return ve.default.createElement("iframe",{key:o,ref:this.ref,style:i,src:`https://www.mixcloud.com/widget/iframe/?${a}`,frameBorder:"0",allow:"autoplay"})}};s(F,"displayName","Mixcloud"),s(F,"canPlay",c.mixcloud),s(F,"loopOnEnded",!0)});var xt={};T(xt,{default:()=>ee});var pe,ls,ps,us,ee,Ut=S(()=>{pe=y(g());b();_();ls="https://play.vidyard.com/embed/v4.js",ps="VidyardV4",us="onVidyardAPI",ee=class extends pe.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"mute",()=>{this.setVolume(0)});s(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)});s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){let{playing:r,config:o,onError:i,onDuration:a}=this.props,l=e&&e.match(Ke)[1];this.player&&this.stop(),d(ls,ps,us).then(p=>{this.container&&(p.api.addReadyListener((u,h)=>{this.player||(this.player=h,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...o.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,a(u.length_in_seconds)}))},i)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){let{display:e}=this.props;return pe.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},pe.default.createElement("div",{ref:this.ref}))}};s(ee,"displayName","Vidyard"),s(ee,"canPlay",c.vidyard)});var Nt={};T(Nt,{default:()=>te});var Le,hs,cs,te,Vt=S(()=>{Le=y(g());b();_();hs="https://cdn.embed.ly/player-0.1.0.min.js",cs="playerjs",te=class extends Le.Component{constructor(){super(...arguments);s(this,"callPlayer",f);s(this,"duration",null);s(this,"currentTime",null);s(this,"secondsLoaded",null);s(this,"mute",()=>{this.callPlayer("mute")});s(this,"unmute",()=>{this.callPlayer("unmute")});s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){d(hs,cs).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,r){e.on("play",r.onPlay),e.on("pause",r.onPause),e.on("ended",r.onEnded),e.on("error",r.onError),e.on("timeupdate",({duration:o,seconds:i})=>{this.duration=o,this.currentTime=i})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){let e={width:"100%",height:"100%"};return Le.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}};s(te,"displayName","Kaltura"),s(te,"canPlay",c.kaltura)});var Ht={};T(Ht,{default:()=>re});var Y,Ge,ds,Bt,ys,fs,ms,Ps,gs,bs,Es,Ss,Ye,ws,re,jt=S(()=>{Y=y(g());b();_();Ge=typeof navigator!="undefined",ds=Ge&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Bt=Ge&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||ds)&&!window.MSStream,ys=Ge&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,fs="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",ms="Hls",Ps="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",gs="dashjs",bs="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",Es="flvjs",Ss=/www\.dropbox\.com\/.+/,Ye=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,ws="https://videodelivery.net/{id}/manifest/video.m3u8",re=class extends Y.Component{constructor(){super(...arguments);s(this,"onReady",(...e)=>this.props.onReady(...e));s(this,"onPlay",(...e)=>this.props.onPlay(...e));s(this,"onBuffer",(...e)=>this.props.onBuffer(...e));s(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e));s(this,"onPause",(...e)=>this.props.onPause(...e));s(this,"onEnded",(...e)=>this.props.onEnded(...e));s(this,"onError",(...e)=>this.props.onError(...e));s(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate));s(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e));s(this,"onDisablePIP",e=>{let{onDisablePIP:r,playing:o}=this.props;r(e),o&&this.play()});s(this,"onPresentationModeChange",e=>{if(this.player&&X(this.player)){let{webkitPresentationMode:r}=this.player;r==="picture-in-picture"?this.onEnablePIP(e):r==="inline"&&this.onDisablePIP(e)}});s(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)});s(this,"mute",()=>{this.player.muted=!0});s(this,"unmute",()=>{this.player.muted=!1});s(this,"renderSourceElement",(e,r)=>typeof e=="string"?Y.default.createElement("source",{key:r,src:e}):Y.default.createElement("source",{key:r,...e}));s(this,"renderTrack",(e,r)=>Y.default.createElement("track",{key:r,...e}));s(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);let e=this.getSource(this.props.url);e&&(this.player.src=e),(Bt||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!M(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){let{url:r,playsinline:o}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(r)||e.addEventListener("canplay",this.onReady),o&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,r){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(r)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:Z.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return ys&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:Bt||this.props.config.forceDisableHls?!1:fe.test(e)||Ye.test(e)}shouldUseDASH(e){return $e.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return ze.test(e)||this.props.config.forceFLV}load(e){let{hlsVersion:r,hlsOptions:o,dashVersion:i,flvVersion:a}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&d(fs.replace("VERSION",r),ms).then(l=>{if(this.hls=new l(o),this.hls.on(l.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(l.Events.ERROR,(p,u)=>{this.props.onError(p,u,this.hls,l)}),Ye.test(e)){let p=e.match(Ye)[1];this.hls.loadSource(ws.replace("{id}",p))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&d(Ps.replace("VERSION",i),gs).then(l=>{this.dash=l.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(i)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:l.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&d(bs.replace("VERSION",a),Es).then(l=>{this.flv=l.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(l.Events.ERROR,(p,u)=>{this.props.onError(p,u,this.flv,l)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if(M(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){let e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,r=!0){this.player.currentTime=e,r||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():X(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():X(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(r){this.props.onError(r)}}getDuration(){if(!this.player)return null;let{duration:e,seekable:r}=this.player;return e===1/0&&r.length>0?r.end(r.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;let{buffered:e}=this.player;if(e.length===0)return 0;let r=e.end(e.length-1),o=this.getDuration();return r>o?o:r}getSource(e){let r=this.shouldUseHLS(e),o=this.shouldUseDASH(e),i=this.shouldUseFLV(e);if(!(e instanceof Array||M(e)||r||o||i))return Ss.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){let{url:e,playing:r,loop:o,controls:i,muted:a,config:l,width:p,height:u}=this.props,P=this.shouldUseAudio(this.props)?"audio":"video",I={width:p==="auto"?p:"100%",height:u==="auto"?u:"100%"};return Y.default.createElement(P,{ref:this.ref,src:this.getSource(e),style:I,preload:"auto",autoPlay:r||void 0,controls:i,muted:a,loop:o,...l.attributes},e instanceof Array&&e.map(this.renderSourceElement),l.tracks.map(this.renderTrack))}};s(re,"displayName","FilePlayer"),s(re,"canPlay",c.file)});var We=V((xn,$t)=>{var _s=typeof Element!="undefined",Rs=typeof Map=="function",As=typeof Set=="function",Ds=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Re(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var e,r,o;if(Array.isArray(t)){if(e=t.length,e!=n.length)return!1;for(r=e;r--!==0;)if(!Re(t[r],n[r]))return!1;return!0}var i;if(Rs&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!n.has(r.value[0]))return!1;for(i=t.entries();!(r=i.next()).done;)if(!Re(r.value[1],n.get(r.value[0])))return!1;return!0}if(As&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!n.has(r.value[0]))return!1;return!0}if(Ds&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(e=t.length,e!=n.length)return!1;for(r=e;r--!==0;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof n.valueOf=="function")return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof n.toString=="function")return t.toString()===n.toString();if(o=Object.keys(t),e=o.length,e!==Object.keys(n).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;if(_s&&t instanceof Element)return!1;for(r=e;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&t.$$typeof)&&!Re(t[o[r]],n[o[r]]))return!1;return!0}return t!==t&&n!==n}$t.exports=function(n,e){try{return Re(n,e)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}}});var Ft=V((Un,zt)=>{"use strict";var Is="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";zt.exports=Is});var qt=V((Nn,Wt)=>{"use strict";var Os=Ft();function Yt(){}function Gt(){}Gt.resetWarningCache=Yt;Wt.exports=function(){function t(r,o,i,a,l,p){if(p!==Os){var u=new Error("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");throw u.name="Invariant Violation",u}}t.isRequired=t;function n(){return t}var e={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,elementType:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:Gt,resetWarningCache:Yt};return e.PropTypes=e,e}});var Zt=V((Hn,Xt)=>{Xt.exports=qt()();var Vn,Bn});var tr={};T(tr,{default:()=>De});var U,Xe,Ze,De,rr=S(()=>{U=y(g()),Xe="64px",Ze={},De=class extends U.Component{constructor(){super(...arguments);s(this,"mounted",!1);s(this,"state",{image:null});s(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){let{url:r,light:o}=this.props;(e.url!==r||e.light!==o)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:r,oEmbedUrl:o}){if(!U.default.isValidElement(r)){if(typeof r=="string"){this.setState({image:r});return}if(Ze[e]){this.setState({image:Ze[e]});return}return this.setState({image:null}),window.fetch(o.replace("{url}",e)).then(i=>i.json()).then(i=>{if(i.thumbnail_url&&this.mounted){let a=i.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:a}),Ze[e]=a}})}}render(){let{light:e,onClick:r,playIcon:o,previewTabIndex:i}=this.props,{image:a}=this.state,l=U.default.isValidElement(e),p={display:"flex",alignItems:"center",justifyContent:"center"},u={preview:{width:"100%",height:"100%",backgroundImage:a&&!l?`url(${a})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...p},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:Xe,width:Xe,height:Xe,position:l?"absolute":void 0,...p},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},h=U.default.createElement("div",{style:u.shadow,className:"react-player__shadow"},U.default.createElement("div",{style:u.playIcon,className:"react-player__play-icon"}));return U.default.createElement("div",{style:u.preview,className:"react-player__preview",onClick:r,tabIndex:i,onKeyPress:this.handleKeyPress},l?e:null,o||h)}}});var Hs={};T(Hs,{default:()=>Bs});var R=y(g());b();_();var Te=[{key:"youtube",name:"YouTube",canPlay:c.youtube,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(ft(),yt)))},{key:"soundcloud",name:"SoundCloud",canPlay:c.soundcloud,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(Pt(),mt)))},{key:"vimeo",name:"Vimeo",canPlay:c.vimeo,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(bt(),gt)))},{key:"facebook",name:"Facebook",canPlay:c.facebook,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(Lt(),vt)))},{key:"streamable",name:"Streamable",canPlay:c.streamable,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(_t(),Tt)))},{key:"wistia",name:"Wistia",canPlay:c.wistia,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(At(),Rt)))},{key:"twitch",name:"Twitch",canPlay:c.twitch,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(It(),Dt)))},{key:"dailymotion",name:"DailyMotion",canPlay:c.dailymotion,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(kt(),Ot)))},{key:"mixcloud",name:"Mixcloud",canPlay:c.mixcloud,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(Mt(),Ct)))},{key:"vidyard",name:"Vidyard",canPlay:c.vidyard,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(Ut(),xt)))},{key:"kaltura",name:"Kaltura",canPlay:c.kaltura,lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(Vt(),Nt)))},{key:"file",name:"FilePlayer",canPlay:c.file,canEnablePIP:t=>c.file(t)&&(document.pictureInPictureEnabled||X())&&!Z.test(t),lazyPlayer:(0,R.lazy)(()=>Promise.resolve().then(()=>(jt(),Ht)))}];var D=y(g()),sr=y(ke());var Kt=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function vs(t,n){return!!(t===n||Kt(t)&&Kt(n))}function Ls(t,n){if(t.length!==n.length)return!1;for(var e=0;e{},ne={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",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:{},onUnstarted:E},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:E,onStart:E,onPlay:E,onPause:E,onBuffer:E,onBufferEnd:E,onEnded:E,onError:E,onDuration:E,onSeek:E,onPlaybackRateChange:E,onPlaybackQualityChange:E,onProgress:E,onClickPreview:E,onEnablePIP:E,onDisablePIP:E};b();var Ae=y(g()),er=y(We());b();var ks=5e3,x=class extends Ae.Component{constructor(){super(...arguments);s(this,"mounted",!1);s(this,"isReady",!1);s(this,"isPlaying",!1);s(this,"isLoading",!0);s(this,"loadOnReady",null);s(this,"startOnPlay",!0);s(this,"seekOnPlay",null);s(this,"onDurationCalled",!1);s(this,"handlePlayerMount",e=>{if(this.player){this.progress();return}this.player=e,this.player.load(this.props.url),this.progress()});s(this,"getInternalPlayer",e=>this.player?this.player[e]:null);s(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){let e=this.getCurrentTime()||0,r=this.getSecondsLoaded(),o=this.getDuration();if(o){let i={playedSeconds:e,played:e/o};r!==null&&(i.loadedSeconds=r,i.loaded=r/o),(i.playedSeconds!==this.prevPlayed||i.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(i),this.prevPlayed=i.playedSeconds,this.prevLoaded=i.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)});s(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;let{onReady:e,playing:r,volume:o,muted:i}=this.props;e(),!i&&o!==null&&this.player.setVolume(o),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):r&&this.player.play(),this.handleDurationCheck()});s(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;let{onStart:e,onPlay:r,playbackRate:o}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&o!==1&&this.player.setPlaybackRate(o),e(),this.startOnPlay=!1),r(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()});s(this,"handlePause",e=>{this.isPlaying=!1,this.isLoading||this.props.onPause(e)});s(this,"handleEnded",()=>{let{activePlayer:e,loop:r,onEnded:o}=this.props;e.loopOnEnded&&r&&this.seekTo(0),r||(this.isPlaying=!1,o())});s(this,"handleError",(...e)=>{this.isLoading=!1,this.props.onError(...e)});s(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);let e=this.getDuration();e?this.onDurationCalled||(this.props.onDuration(e),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)});s(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(e){if(!this.player)return;let{url:r,playing:o,volume:i,muted:a,playbackRate:l,pip:p,loop:u,activePlayer:h,disableDeferredLoading:P}=this.props;if(!(0,er.default)(e.url,r)){if(this.isLoading&&!h.forceLoad&&!P&&!M(r)){console.warn(`ReactPlayer: the attempt to load ${r} is being deferred until the player has loaded`),this.loadOnReady=r;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(r,this.isReady)}!e.playing&&o&&!this.isPlaying&&this.player.play(),e.playing&&!o&&this.isPlaying&&this.player.pause(),!e.pip&&p&&this.player.enablePIP&&this.player.enablePIP(),e.pip&&!p&&this.player.disablePIP&&this.player.disablePIP(),e.volume!==i&&i!==null&&this.player.setVolume(i),e.muted!==a&&(a?this.player.mute():(this.player.unmute(),i!==null&&setTimeout(()=>this.player.setVolume(i)))),e.playbackRate!==l&&this.player.setPlaybackRate&&this.player.setPlaybackRate(l),e.loop!==u&&this.player.setLoop&&this.player.setLoop(u)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(e,r,o){if(!this.isReady){e!==0&&(this.seekOnPlay=e,setTimeout(()=>{this.seekOnPlay=null},ks));return}if(r?r==="fraction":e>0&&e<1){let a=this.player.getDuration();if(!a){console.warn("ReactPlayer: could not seek using fraction \u2013\xA0duration not yet available");return}this.player.seekTo(a*e,o);return}this.player.seekTo(e,o)}render(){let e=this.props.activePlayer;return e?Ae.default.createElement(e,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}};s(x,"displayName","Player"),s(x,"propTypes",he),s(x,"defaultProps",ne);var Cs=(0,D.lazy)(()=>Promise.resolve().then(()=>(rr(),tr))),Ms=typeof window!="undefined"&&window.document,xs=typeof global!="undefined"&&global.window&&global.window.document,Us=Object.keys(he),Ns=Ms||xs?D.Suspense:()=>null,ce=[],nr=(t,n)=>{var e;return e=class extends D.Component{constructor(){super(...arguments);s(this,"state",{showPreview:!!this.props.light});s(this,"references",{wrapper:i=>{this.wrapper=i},player:i=>{this.player=i}});s(this,"handleClickPreview",i=>{this.setState({showPreview:!1}),this.props.onClickPreview(i)});s(this,"showPreview",()=>{this.setState({showPreview:!0})});s(this,"getDuration",()=>this.player?this.player.getDuration():null);s(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null);s(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null);s(this,"getInternalPlayer",(i="player")=>this.player?this.player.getInternalPlayer(i):null);s(this,"seekTo",(i,a,l)=>{if(!this.player)return null;this.player.seekTo(i,a,l)});s(this,"handleReady",()=>{this.props.onReady(this)});s(this,"getActivePlayer",_e(i=>{for(let a of[...ce,...t])if(a.canPlay(i))return a;return n||null}));s(this,"getConfig",_e((i,a)=>{let{config:l}=this.props;return sr.default.all([ne.config,ne.config[a]||{},l,l[a]||{}])}));s(this,"getAttributes",_e(i=>ut(this.props,Us)));s(this,"renderActivePlayer",i=>{if(!i)return null;let a=this.getActivePlayer(i);if(!a)return null;let l=this.getConfig(i,a.key);return D.default.createElement(x,{...this.props,key:a.key,ref:this.references.player,config:l,activePlayer:a.lazyPlayer||a,onReady:this.handleReady})})}shouldComponentUpdate(i,a){return!(0,Qe.default)(this.props,i)||!(0,Qe.default)(this.state,a)}componentDidUpdate(i){let{light:a}=this.props;!i.light&&a&&this.setState({showPreview:!0}),i.light&&!a&&this.setState({showPreview:!1})}renderPreview(i){if(!i)return null;let{light:a,playIcon:l,previewTabIndex:p,oEmbedUrl:u}=this.props;return D.default.createElement(Cs,{url:i,light:a,playIcon:l,previewTabIndex:p,oEmbedUrl:u,onClick:this.handleClickPreview})}render(){let{url:i,style:a,width:l,height:p,fallback:u,wrapper:h}=this.props,{showPreview:P}=this.state,I=this.getAttributes(i),k=typeof h=="string"?this.references.wrapper:void 0;return D.default.createElement(h,{ref:k,style:{...a,width:l,height:p},...I},D.default.createElement(Ns,{fallback:u},P?this.renderPreview(i):this.renderActivePlayer(i)))}},s(e,"displayName","ReactPlayer"),s(e,"propTypes",he),s(e,"defaultProps",ne),s(e,"addCustomPlayer",i=>{ce.push(i)}),s(e,"removeCustomPlayers",()=>{ce.length=0}),s(e,"canPlay",i=>{for(let a of[...ce,...t])if(a.canPlay(i))return!0;return!1}),s(e,"canEnablePIP",i=>{for(let a of[...ce,...t])if(a.canEnablePIP&&a.canEnablePIP(i))return!0;return!1}),e};var Vs=Te[Te.length-1],Bs=nr(Te,Vs);return dr(Hs);})(); +var ReactPlayer=(()=>{var lr=Object.create;var ie=Object.defineProperty;var pr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var hr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty;var dr=(t,s,e)=>s in t?ie(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var S=(t,s)=>()=>(t&&(s=t(t=0)),s);var V=(t,s)=>()=>(s||t((s={exports:{}}).exports,s),s.exports),_=(t,s)=>{for(var e in s)ie(t,e,{get:s[e],enumerable:!0})},Je=(t,s,e,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of ur(s))!cr.call(t,o)&&o!==e&&ie(t,o,{get:()=>s[o],enumerable:!(r=pr(s,o))||r.enumerable});return t};var y=(t,s,e)=>(e=t!=null?lr(hr(t)):{},Je(s||!t||!t.__esModule?ie(e,"default",{value:t,enumerable:!0}):e,t)),yr=t=>Je(ie({},"__esModule",{value:!0}),t);var n=(t,s,e)=>(dr(t,typeof s!="symbol"?s+"":s,e),e);var g=V((zs,et)=>{et.exports=globalThis.React});var st=V(($s,rt)=>{rt.exports=function(s,e,r){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof e=="function"&&(r=e,e={}),e=e||{},r=r||function(){},i.type=e.type||"text/javascript",i.charset=e.charset||"utf8",i.async="async"in e?!!e.async:!0,i.src=s,e.attrs&&fr(i,e.attrs),e.text&&(i.text=""+e.text);var a="onload"in i?tt:mr;a(i,r),i.onload||tt(i,r),o.appendChild(i)};function fr(t,s){for(var e in s)t.setAttribute(e,s[e])}function tt(t,s){t.onload=function(){this.onerror=this.onload=null,s(null,t)},t.onerror=function(){this.onerror=this.onload=null,s(new Error("Failed to load "+this.src),t)}}function mr(t,s){t.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,s(null,t))}}});var ke=V((Fs,ot)=>{"use strict";var Pr=function(s){return gr(s)&&!br(s)};function gr(t){return!!t&&typeof t=="object"}function br(t){var s=Object.prototype.toString.call(t);return s==="[object RegExp]"||s==="[object Date]"||wr(t)}var Er=typeof Symbol=="function"&&Symbol.for,Sr=Er?Symbol.for("react.element"):60103;function wr(t){return t.$$typeof===Sr}function vr(t){return Array.isArray(t)?[]:{}}function oe(t,s){return s.clone!==!1&&s.isMergeableObject(t)?G(vr(t),t,s):t}function Lr(t,s,e){return t.concat(s).map(function(r){return oe(r,e)})}function Tr(t,s){if(!s.customMerge)return G;var e=s.customMerge(t);return typeof e=="function"?e:G}function _r(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(s){return Object.propertyIsEnumerable.call(t,s)}):[]}function nt(t){return Object.keys(t).concat(_r(t))}function it(t,s){try{return s in t}catch{return!1}}function Rr(t,s){return it(t,s)&&!(Object.hasOwnProperty.call(t,s)&&Object.propertyIsEnumerable.call(t,s))}function Ar(t,s,e){var r={};return e.isMergeableObject(t)&&nt(t).forEach(function(o){r[o]=oe(t[o],e)}),nt(s).forEach(function(o){Rr(t,o)||(it(t,o)&&e.isMergeableObject(s[o])?r[o]=Tr(o,e)(t[o],s[o],e):r[o]=oe(s[o],e))}),r}function G(t,s,e){e=e||{},e.arrayMerge=e.arrayMerge||Lr,e.isMergeableObject=e.isMergeableObject||Pr,e.cloneUnlessOtherwiseSpecified=oe;var r=Array.isArray(s),o=Array.isArray(t),i=r===o;return i?r?e.arrayMerge(t,s,e):Ar(t,s,e):oe(s,e)}G.all=function(s,e){if(!Array.isArray(s))throw new Error("first argument should be an array");return s.reduce(function(r,o){return G(r,o,e)},{})};var Dr=G;ot.exports=Dr});function pt(t,s){if(t instanceof Array)return;let e=t.match(s);if(e){let r=e[1];if(r.match(Me))return Mr(r);if(Cr.test(r))return parseInt(r)}}function Mr(t){let s=0,e=Me.exec(t);for(;e!==null;){let[,r,o]=e;o==="h"&&(s+=parseInt(r,10)*60*60),o==="m"&&(s+=parseInt(r,10)*60),o==="s"&&(s+=parseInt(r,10)),e=Me.exec(t)}return s}function C(t){return pt(t,Or)}function xe(t){return pt(t,kr)}function q(){return Math.random().toString(36).substr(2,5)}function ut(t){return Object.keys(t).map(s=>`${s}=${t[s]}`).join("&")}function Ce(t){return window[t]?window[t]:window.exports&&window.exports[t]?window.exports[t]:window.module&&window.module.exports&&window.module.exports[t]?window.module.exports[t]:null}function ht(t,...s){let e=[].concat(...s),r={},o=Object.keys(t);for(let i of o)e.indexOf(i)===-1&&(r[i]=t[i]);return r}function f(t,...s){if(!this.player||!this.player[t]){let e=`ReactPlayer: ${this.constructor.displayName} player could not call %c${t}%c \u2013 `;return this.player?this.player[t]||(e+="The method was not available"):e+="The player was not available",console.warn(e,"font-weight: bold",""),null}return this.player[t](...s)}function M(t){return typeof window!="undefined"&&typeof window.MediaStream!="undefined"&&t instanceof window.MediaStream}function ct(t){return/^blob:/.test(t)}function X(t=document.createElement("video")){let s=/iPhone|iPod/.test(navigator.userAgent)===!1;return t.webkitSupportsPresentationMode&&typeof t.webkitSetPresentationMode=="function"&&s}var at,lt,Ir,w,Or,kr,Me,Cr,W,d,b=S(()=>{at=y(g()),lt=y(st()),Ir=y(ke()),w=t=>at.default.lazy(async()=>{let s=await t();return typeof s.default=="function"?s:s.default}),Or=/[?&#](?:start|t)=([0-9hms]+)/,kr=/[?&#]end=([0-9hms]+)/,Me=/(\d+)(h|m|s)/g,Cr=/^\d+$/;W={},d=function(s,e,r=null,o=()=>!0,i=lt.default){let a=Ce(e);return a&&o(a)?Promise.resolve(a):new Promise((l,p)=>{if(W[s]){W[s].push({resolve:l,reject:p});return}W[s]=[{resolve:l,reject:p}];let u=h=>{W[s].forEach(P=>P.resolve(h))};if(r){let h=window[r];window[r]=function(){h&&h(),u(Ce(e))}}i(s,h=>{h?(W[s].forEach(P=>P.reject(h)),W[s]=null):r||u(Ce(e))})})}});var de,xr,Ur,Nr,Vr,Ne,Ve,Be,ye,He,je,Ke,Br,Z,dt,fe,ze,$e,Ue,c,R=S(()=>{b();de=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,xr=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,Ur=/vimeo\.com\/(?!progressive_redirect).+/,Nr=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,Vr=/^https?:\/\/fb\.watch\/.+$/,Ne=/streamable\.com\/([a-z0-9]+)$/,Ve=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,Be=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,ye=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,He=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,je=/mixcloud\.com\/([^/]+\/[^/]+)/,Ke=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,Br=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,Z=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,dt=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,fe=/\.(m3u8)($|\?)/i,ze=/\.(mpd)($|\?)/i,$e=/\.(flv)($|\?)/i,Ue=t=>{if(t instanceof Array){for(let s of t)if(typeof s=="string"&&Ue(s)||Ue(s.src))return!0;return!1}return M(t)||ct(t)?!0:Z.test(t)||dt.test(t)||fe.test(t)||ze.test(t)||$e.test(t)},c={youtube:t=>t instanceof Array?t.every(s=>de.test(s)):de.test(t),soundcloud:t=>xr.test(t)&&!Z.test(t),vimeo:t=>Ur.test(t)&&!dt.test(t)&&!fe.test(t),facebook:t=>Nr.test(t)||Vr.test(t),streamable:t=>Ne.test(t),wistia:t=>Ve.test(t),twitch:t=>Be.test(t)||ye.test(t),dailymotion:t=>He.test(t),mixcloud:t=>je.test(t),vidyard:t=>Ke.test(t),kaltura:t=>Br.test(t),file:Ue}});var ft={};_(ft,{default:()=>Q});var ae,Hr,yt,jr,me,Fe,Kr,zr,Q,mt=S(()=>{ae=y(g());b();R();Hr="https://www.youtube.com/iframe_api",yt="YT",jr="onYouTubeIframeAPIReady",me=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,Fe=/user\/([a-zA-Z0-9_-]+)\/?/,Kr=/youtube-nocookie\.com/,zr="https://www.youtube-nocookie.com",Q=class extends ae.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(me.test(e)){let[,r]=e.match(me);return{listType:"playlist",list:r.replace(/^UC/,"UU")}}if(Fe.test(e)){let[,r]=e.match(Fe);return{listType:"user_uploads",list:r}}return{}});n(this,"onStateChange",e=>{let{data:r}=e,{onPlay:o,onPause:i,onBuffer:a,onBufferEnd:l,onEnded:p,onReady:u,loop:h,config:{playerVars:P,onUnstarted:D}}=this.props,{UNSTARTED:k,PLAYING:N,PAUSED:I,BUFFERING:Ie,ENDED:Oe,CUED:or}=window[yt].PlayerState;if(r===k&&D(),r===N&&(o(),l()),r===I&&i(),r===Ie&&a(),r===Oe){let ar=!!this.callPlayer("getPlaylist");h&&!ar&&(P.start?this.seekTo(P.start):this.play()),p()}r===or&&u()});n(this,"mute",()=>{this.callPlayer("mute")});n(this,"unmute",()=>{this.callPlayer("unMute")});n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||me.test(e)?null:e.match(de)[1]}load(e,r){let{playing:o,muted:i,playsinline:a,controls:l,loop:p,config:u,onError:h}=this.props,{playerVars:P,embedOptions:D}=u,k=this.getID(e);if(r){if(me.test(e)||Fe.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:k,startSeconds:C(e)||P.start,endSeconds:xe(e)||P.end});return}d(Hr,yt,jr,N=>N.loaded).then(N=>{this.container&&(this.player=new N.Player(this.container,{width:"100%",height:"100%",videoId:k,playerVars:{autoplay:o?1:0,mute:i?1:0,controls:l?1:0,start:C(e),end:xe(e),origin:window.location.origin,playsinline:a?1:0,...this.parsePlaylist(e),...P},events:{onReady:()=>{p&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:I=>this.props.onPlaybackRateChange(I.data),onPlaybackQualityChange:I=>this.props.onPlaybackQualityChange(I),onStateChange:this.onStateChange,onError:I=>h(I.data)},host:Kr.test(e)?zr:void 0,...D}))},h),D.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer\u2019s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,r=!1){this.callPlayer("seekTo",e),!r&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){let{display:e}=this.props;return ae.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},ae.default.createElement("div",{ref:this.ref}))}};n(Q,"displayName","YouTube"),n(Q,"canPlay",c.youtube)});var Pt={};_(Pt,{default:()=>B});var Pe,$r,Fr,B,gt=S(()=>{Pe=y(g());b();R();$r="https://w.soundcloud.com/player/api.js",Fr="SC",B=class extends Pe.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"duration",null);n(this,"currentTime",null);n(this,"fractionLoaded",null);n(this,"mute",()=>{this.setVolume(0)});n(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)});n(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){d($r,Fr).then(o=>{if(!this.iframe)return;let{PLAY:i,PLAY_PROGRESS:a,PAUSE:l,FINISH:p,ERROR:u}=o.Widget.Events;r||(this.player=o.Widget(this.iframe),this.player.bind(i,this.props.onPlay),this.player.bind(l,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(a,h=>{this.currentTime=h.currentPosition/1e3,this.fractionLoaded=h.loadedProgress}),this.player.bind(p,()=>this.props.onEnded()),this.player.bind(u,h=>this.props.onError(h))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(h=>{this.duration=h/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){let{display:e}=this.props,r={width:"100%",height:"100%",display:e};return Pe.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}};n(B,"displayName","SoundCloud"),n(B,"canPlay",c.soundcloud),n(B,"loopOnEnded",!0)});var bt={};_(bt,{default:()=>H});var ge,Yr,Gr,Wr,H,Et=S(()=>{ge=y(g());b();R();Yr="https://player.vimeo.com/api/player.js",Gr="Vimeo",Wr=t=>t.replace("/manage/videos",""),H=class extends ge.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"duration",null);n(this,"currentTime",null);n(this,"secondsLoaded",null);n(this,"mute",()=>{this.setMuted(!0)});n(this,"unmute",()=>{this.setMuted(!1)});n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,d(Yr,Gr).then(r=>{if(!this.container)return;let{playerOptions:o,title:i}=this.props.config;this.player=new r.Player(this.container,{url:Wr(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...o}),this.player.ready().then(()=>{let a=this.container.querySelector("iframe");a.style.width="100%",a.style.height="100%",i&&(a.title=i)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",a=>this.props.onSeek(a.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:a})=>{this.currentTime=a}),this.player.on("progress",({seconds:a})=>{this.secondsLoaded=a}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",a=>this.props.onPlaybackRateChange(a.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){let e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){let{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return ge.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}};n(H,"displayName","Vimeo"),n(H,"canPlay",c.vimeo),n(H,"forceLoad",!0)});var Lt={};_(Lt,{default:()=>j});var be,St,wt,vt,qr,j,Tt=S(()=>{be=y(g());b();R();St="https://connect.facebook.net/en_US/sdk.js",wt="FB",vt="fbAsyncInit",qr="facebook-player-",j=class extends be.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"playerID",this.props.config.playerId||`${qr}${q()}`);n(this,"mute",()=>{this.callPlayer("mute")});n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){d(St,wt,vt).then(o=>o.XFBML.parse());return}d(St,wt,vt).then(o=>{o.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),o.Event.subscribe("xfbml.render",i=>{this.props.onLoaded()}),o.Event.subscribe("xfbml.ready",i=>{i.type==="video"&&i.id===this.playerID&&(this.player=i.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){let{attributes:e}=this.props.config;return be.default.createElement("div",{style:{width:"100%",height:"100%"},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",...e})}};n(j,"displayName","Facebook"),n(j,"canPlay",c.facebook),n(j,"loopOnEnded",!0)});var _t={};_(_t,{default:()=>J});var Ee,Xr,Zr,J,Rt=S(()=>{Ee=y(g());b();R();Xr="https://cdn.embed.ly/player-0.1.0.min.js",Zr="playerjs",J=class extends Ee.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"duration",null);n(this,"currentTime",null);n(this,"secondsLoaded",null);n(this,"mute",()=>{this.callPlayer("mute")});n(this,"unmute",()=>{this.callPlayer("unmute")});n(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){d(Xr,Zr).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:o,seconds:i})=>{this.duration=o,this.currentTime=i}),this.player.on("buffered",({percent:o})=>{this.duration&&(this.secondsLoaded=this.duration*o)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){let e=this.props.url.match(Ne)[1],r={width:"100%",height:"100%"};return Ee.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}};n(J,"displayName","Streamable"),n(J,"canPlay",c.streamable)});var At={};_(At,{default:()=>K});var Se,Qr,Jr,es,K,Dt=S(()=>{Se=y(g());b();R();Qr="https://fast.wistia.com/assets/external/E-v1.js",Jr="Wistia",es="wistia-player-",K=class extends Se.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"playerID",this.props.config.playerId||`${es}${q()}`);n(this,"onPlay",(...e)=>this.props.onPlay(...e));n(this,"onPause",(...e)=>this.props.onPause(...e));n(this,"onSeek",(...e)=>this.props.onSeek(...e));n(this,"onEnded",(...e)=>this.props.onEnded(...e));n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e));n(this,"mute",()=>{this.callPlayer("mute")});n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){let{playing:r,muted:o,controls:i,onReady:a,config:l,onError:p}=this.props;d(Qr,Jr).then(u=>{l.customControls&&l.customControls.forEach(h=>u.defineControl(h)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:r,silentAutoPlay:"allow",muted:o,controlsVisibleOnLoad:i,fullscreenButton:i,playbar:i,playbackRateControl:i,qualityControl:i,volumeControl:i,settingsControl:i,smallPlayButton:i,...l.options},onReady:h=>{this.player=h,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),a()}})},p)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,r=!0){this.callPlayer("time",e),r||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){let{url:e}=this.props,r=e&&e.match(Ve)[1],o=`wistia_embed wistia_async_${r}`,i={width:"100%",height:"100%"};return Se.default.createElement("div",{id:this.playerID,key:r,className:o,style:i})}};n(K,"displayName","Wistia"),n(K,"canPlay",c.wistia),n(K,"loopOnEnded",!0)});var It={};_(It,{default:()=>z});var we,ts,rs,ss,z,Ot=S(()=>{we=y(g());b();R();ts="https://player.twitch.tv/js/embed/v1.js",rs="Twitch",ss="twitch-player-",z=class extends we.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"playerID",this.props.config.playerId||`${ss}${q()}`);n(this,"mute",()=>{this.callPlayer("setMuted",!0)});n(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){let{playsinline:o,onError:i,config:a,controls:l}=this.props,p=ye.test(e),u=p?e.match(ye)[1]:e.match(Be)[1];if(r){p?this.player.setChannel(u):this.player.setVideo("v"+u);return}d(ts,rs).then(h=>{this.player=new h.Player(this.playerID,{video:p?"":u,channel:p?u:"",height:"100%",width:"100%",playsinline:o,autoplay:this.props.playing,muted:this.props.muted,controls:p?!0:l,time:C(e),...a.options});let{READY:P,PLAYING:D,PAUSE:k,ENDED:N,ONLINE:I,OFFLINE:Ie,SEEK:Oe}=h.Player;this.player.addEventListener(P,this.props.onReady),this.player.addEventListener(D,this.props.onPlay),this.player.addEventListener(k,this.props.onPause),this.player.addEventListener(N,this.props.onEnded),this.player.addEventListener(Oe,this.props.onSeek),this.player.addEventListener(I,this.props.onLoaded),this.player.addEventListener(Ie,this.props.onLoaded)},i)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){return we.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}};n(z,"displayName","Twitch"),n(z,"canPlay",c.twitch),n(z,"loopOnEnded",!0)});var kt={};_(kt,{default:()=>$});var le,ns,is,os,$,Ct=S(()=>{le=y(g());b();R();ns="https://api.dmcdn.net/all.js",is="DM",os="dmAsyncInit",$=class extends le.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"onDurationChange",()=>{let e=this.getDuration();this.props.onDuration(e)});n(this,"mute",()=>{this.callPlayer("setMuted",!0)});n(this,"unmute",()=>{this.callPlayer("setMuted",!1)});n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){let{controls:r,config:o,onError:i,playing:a}=this.props,[,l]=e.match(He);if(this.player){this.player.load(l,{start:C(e),autoplay:a});return}d(ns,is,os,p=>p.player).then(p=>{if(!this.container)return;let u=p.player;this.player=new u(this.container,{width:"100%",height:"100%",video:l,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:C(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:h=>i(h)}})},i)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){let{display:e}=this.props;return le.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},le.default.createElement("div",{ref:this.ref}))}};n($,"displayName","DailyMotion"),n($,"canPlay",c.dailymotion),n($,"loopOnEnded",!0)});var Mt={};_(Mt,{default:()=>F});var ve,as,ls,F,xt=S(()=>{ve=y(g());b();R();as="https://widget.mixcloud.com/media/js/widgetApi.js",ls="Mixcloud",F=class extends ve.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"duration",null);n(this,"currentTime",null);n(this,"secondsLoaded",null);n(this,"mute",()=>{});n(this,"unmute",()=>{});n(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){d(as,ls).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((o,i)=>{this.currentTime=o,this.duration=i}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){let{url:e,config:r}=this.props,o=e.match(je)[1],i={width:"100%",height:"100%"},a=ut({...r.options,feed:`/${o}/`});return ve.default.createElement("iframe",{key:o,ref:this.ref,style:i,src:`https://www.mixcloud.com/widget/iframe/?${a}`,frameBorder:"0",allow:"autoplay"})}};n(F,"displayName","Mixcloud"),n(F,"canPlay",c.mixcloud),n(F,"loopOnEnded",!0)});var Ut={};_(Ut,{default:()=>ee});var pe,ps,us,hs,ee,Nt=S(()=>{pe=y(g());b();R();ps="https://play.vidyard.com/embed/v4.js",us="VidyardV4",hs="onVidyardAPI",ee=class extends pe.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"mute",()=>{this.setVolume(0)});n(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)});n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){let{playing:r,config:o,onError:i,onDuration:a}=this.props,l=e&&e.match(Ke)[1];this.player&&this.stop(),d(ps,us,hs).then(p=>{this.container&&(p.api.addReadyListener((u,h)=>{this.player||(this.player=h,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...o.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,a(u.length_in_seconds)}))},i)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){let{display:e}=this.props;return pe.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},pe.default.createElement("div",{ref:this.ref}))}};n(ee,"displayName","Vidyard"),n(ee,"canPlay",c.vidyard)});var Vt={};_(Vt,{default:()=>te});var Le,cs,ds,te,Bt=S(()=>{Le=y(g());b();R();cs="https://cdn.embed.ly/player-0.1.0.min.js",ds="playerjs",te=class extends Le.Component{constructor(){super(...arguments);n(this,"callPlayer",f);n(this,"duration",null);n(this,"currentTime",null);n(this,"secondsLoaded",null);n(this,"mute",()=>{this.callPlayer("mute")});n(this,"unmute",()=>{this.callPlayer("unmute")});n(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){d(cs,ds).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,r){e.on("play",r.onPlay),e.on("pause",r.onPause),e.on("ended",r.onEnded),e.on("error",r.onError),e.on("timeupdate",({duration:o,seconds:i})=>{this.duration=o,this.currentTime=i})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){let e={width:"100%",height:"100%"};return Le.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}};n(te,"displayName","Kaltura"),n(te,"canPlay",c.kaltura)});var jt={};_(jt,{default:()=>re});var Y,Ge,ys,Ht,fs,ms,Ps,gs,bs,Es,Ss,ws,Ye,vs,re,Kt=S(()=>{Y=y(g());b();R();Ge=typeof navigator!="undefined",ys=Ge&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Ht=Ge&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||ys)&&!window.MSStream,fs=Ge&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,ms="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",Ps="Hls",gs="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",bs="dashjs",Es="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",Ss="flvjs",ws=/www\.dropbox\.com\/.+/,Ye=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,vs="https://videodelivery.net/{id}/manifest/video.m3u8",re=class extends Y.Component{constructor(){super(...arguments);n(this,"onReady",(...e)=>this.props.onReady(...e));n(this,"onPlay",(...e)=>this.props.onPlay(...e));n(this,"onBuffer",(...e)=>this.props.onBuffer(...e));n(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e));n(this,"onPause",(...e)=>this.props.onPause(...e));n(this,"onEnded",(...e)=>this.props.onEnded(...e));n(this,"onError",(...e)=>this.props.onError(...e));n(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate));n(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e));n(this,"onDisablePIP",e=>{let{onDisablePIP:r,playing:o}=this.props;r(e),o&&this.play()});n(this,"onPresentationModeChange",e=>{if(this.player&&X(this.player)){let{webkitPresentationMode:r}=this.player;r==="picture-in-picture"?this.onEnablePIP(e):r==="inline"&&this.onDisablePIP(e)}});n(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)});n(this,"mute",()=>{this.player.muted=!0});n(this,"unmute",()=>{this.player.muted=!1});n(this,"renderSourceElement",(e,r)=>typeof e=="string"?Y.default.createElement("source",{key:r,src:e}):Y.default.createElement("source",{key:r,...e}));n(this,"renderTrack",(e,r)=>Y.default.createElement("track",{key:r,...e}));n(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);let e=this.getSource(this.props.url);e&&(this.player.src=e),(Ht||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!M(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){let{url:r,playsinline:o}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(r)||e.addEventListener("canplay",this.onReady),o&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,r){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(r)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:Z.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return fs&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:Ht||this.props.config.forceDisableHls?!1:fe.test(e)||Ye.test(e)}shouldUseDASH(e){return ze.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return $e.test(e)||this.props.config.forceFLV}load(e){let{hlsVersion:r,hlsOptions:o,dashVersion:i,flvVersion:a}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&d(ms.replace("VERSION",r),Ps).then(l=>{if(this.hls=new l(o),this.hls.on(l.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(l.Events.ERROR,(p,u)=>{this.props.onError(p,u,this.hls,l)}),Ye.test(e)){let p=e.match(Ye)[1];this.hls.loadSource(vs.replace("{id}",p))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&d(gs.replace("VERSION",i),bs).then(l=>{this.dash=l.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(i)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:l.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&d(Es.replace("VERSION",a),Ss).then(l=>{this.flv=l.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(l.Events.ERROR,(p,u)=>{this.props.onError(p,u,this.flv,l)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if(M(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){let e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,r=!0){this.player.currentTime=e,r||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():X(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():X(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(r){this.props.onError(r)}}getDuration(){if(!this.player)return null;let{duration:e,seekable:r}=this.player;return e===1/0&&r.length>0?r.end(r.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;let{buffered:e}=this.player;if(e.length===0)return 0;let r=e.end(e.length-1),o=this.getDuration();return r>o?o:r}getSource(e){let r=this.shouldUseHLS(e),o=this.shouldUseDASH(e),i=this.shouldUseFLV(e);if(!(e instanceof Array||M(e)||r||o||i))return ws.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){let{url:e,playing:r,loop:o,controls:i,muted:a,config:l,width:p,height:u}=this.props,P=this.shouldUseAudio(this.props)?"audio":"video",D={width:p==="auto"?p:"100%",height:u==="auto"?u:"100%"};return Y.default.createElement(P,{ref:this.ref,src:this.getSource(e),style:D,preload:"auto",autoPlay:r||void 0,controls:i,muted:a,loop:o,...l.attributes},e instanceof Array&&e.map(this.renderSourceElement),l.tracks.map(this.renderTrack))}};n(re,"displayName","FilePlayer"),n(re,"canPlay",c.file)});var We=V((Un,$t)=>{var Rs=typeof Element!="undefined",As=typeof Map=="function",Ds=typeof Set=="function",Is=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Re(t,s){if(t===s)return!0;if(t&&s&&typeof t=="object"&&typeof s=="object"){if(t.constructor!==s.constructor)return!1;var e,r,o;if(Array.isArray(t)){if(e=t.length,e!=s.length)return!1;for(r=e;r--!==0;)if(!Re(t[r],s[r]))return!1;return!0}var i;if(As&&t instanceof Map&&s instanceof Map){if(t.size!==s.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!s.has(r.value[0]))return!1;for(i=t.entries();!(r=i.next()).done;)if(!Re(r.value[1],s.get(r.value[0])))return!1;return!0}if(Ds&&t instanceof Set&&s instanceof Set){if(t.size!==s.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!s.has(r.value[0]))return!1;return!0}if(Is&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(s)){if(e=t.length,e!=s.length)return!1;for(r=e;r--!==0;)if(t[r]!==s[r])return!1;return!0}if(t.constructor===RegExp)return t.source===s.source&&t.flags===s.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof s.valueOf=="function")return t.valueOf()===s.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof s.toString=="function")return t.toString()===s.toString();if(o=Object.keys(t),e=o.length,e!==Object.keys(s).length)return!1;for(r=e;r--!==0;)if(!Object.prototype.hasOwnProperty.call(s,o[r]))return!1;if(Rs&&t instanceof Element)return!1;for(r=e;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&t.$$typeof)&&!Re(t[o[r]],s[o[r]]))return!1;return!0}return t!==t&&s!==s}$t.exports=function(s,e){try{return Re(s,e)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}}});var Yt=V((Nn,Ft)=>{"use strict";var Os="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ft.exports=Os});var Xt=V((Vn,qt)=>{"use strict";var ks=Yt();function Gt(){}function Wt(){}Wt.resetWarningCache=Gt;qt.exports=function(){function t(r,o,i,a,l,p){if(p!==ks){var u=new Error("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");throw u.name="Invariant Violation",u}}t.isRequired=t;function s(){return t}var e={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:s,element:t,elementType:t,instanceOf:s,node:t,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:Wt,resetWarningCache:Gt};return e.PropTypes=e,e}});var Qt=V((jn,Zt)=>{Zt.exports=Xt()();var Bn,Hn});var rr={};_(rr,{default:()=>De});var U,Xe,Ze,De,sr=S(()=>{U=y(g()),Xe="64px",Ze={},De=class extends U.Component{constructor(){super(...arguments);n(this,"mounted",!1);n(this,"state",{image:null});n(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){let{url:r,light:o}=this.props;(e.url!==r||e.light!==o)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:r,oEmbedUrl:o}){if(!U.default.isValidElement(r)){if(typeof r=="string"){this.setState({image:r});return}if(Ze[e]){this.setState({image:Ze[e]});return}return this.setState({image:null}),window.fetch(o.replace("{url}",e)).then(i=>i.json()).then(i=>{if(i.thumbnail_url&&this.mounted){let a=i.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:a}),Ze[e]=a}})}}render(){let{light:e,onClick:r,playIcon:o,previewTabIndex:i}=this.props,{image:a}=this.state,l=U.default.isValidElement(e),p={display:"flex",alignItems:"center",justifyContent:"center"},u={preview:{width:"100%",height:"100%",backgroundImage:a&&!l?`url(${a})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...p},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:Xe,width:Xe,height:Xe,position:l?"absolute":void 0,...p},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},h=U.default.createElement("div",{style:u.shadow,className:"react-player__shadow"},U.default.createElement("div",{style:u.playIcon,className:"react-player__play-icon"}));return U.default.createElement("div",{style:u.preview,className:"react-player__preview",onClick:r,tabIndex:i,onKeyPress:this.handleKeyPress},l?e:null,o||h)}}});var js={};_(js,{default:()=>Hs});b();R();var Te=[{key:"youtube",name:"YouTube",canPlay:c.youtube,lazyPlayer:w(()=>Promise.resolve().then(()=>(mt(),ft)))},{key:"soundcloud",name:"SoundCloud",canPlay:c.soundcloud,lazyPlayer:w(()=>Promise.resolve().then(()=>(gt(),Pt)))},{key:"vimeo",name:"Vimeo",canPlay:c.vimeo,lazyPlayer:w(()=>Promise.resolve().then(()=>(Et(),bt)))},{key:"facebook",name:"Facebook",canPlay:c.facebook,lazyPlayer:w(()=>Promise.resolve().then(()=>(Tt(),Lt)))},{key:"streamable",name:"Streamable",canPlay:c.streamable,lazyPlayer:w(()=>Promise.resolve().then(()=>(Rt(),_t)))},{key:"wistia",name:"Wistia",canPlay:c.wistia,lazyPlayer:w(()=>Promise.resolve().then(()=>(Dt(),At)))},{key:"twitch",name:"Twitch",canPlay:c.twitch,lazyPlayer:w(()=>Promise.resolve().then(()=>(Ot(),It)))},{key:"dailymotion",name:"DailyMotion",canPlay:c.dailymotion,lazyPlayer:w(()=>Promise.resolve().then(()=>(Ct(),kt)))},{key:"mixcloud",name:"Mixcloud",canPlay:c.mixcloud,lazyPlayer:w(()=>Promise.resolve().then(()=>(xt(),Mt)))},{key:"vidyard",name:"Vidyard",canPlay:c.vidyard,lazyPlayer:w(()=>Promise.resolve().then(()=>(Nt(),Ut)))},{key:"kaltura",name:"Kaltura",canPlay:c.kaltura,lazyPlayer:w(()=>Promise.resolve().then(()=>(Bt(),Vt)))},{key:"file",name:"FilePlayer",canPlay:c.file,canEnablePIP:t=>c.file(t)&&(document.pictureInPictureEnabled||X())&&!Z.test(t),lazyPlayer:w(()=>Promise.resolve().then(()=>(Kt(),jt)))}];var O=y(g()),nr=y(ke());var zt=Number.isNaN||function(s){return typeof s=="number"&&s!==s};function Ls(t,s){return!!(t===s||zt(t)&&zt(s))}function Ts(t,s){if(t.length!==s.length)return!1;for(var e=0;e{},ne={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",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:{},onUnstarted:E},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:E,onStart:E,onPlay:E,onPause:E,onBuffer:E,onBufferEnd:E,onEnded:E,onError:E,onDuration:E,onSeek:E,onPlaybackRateChange:E,onPlaybackQualityChange:E,onProgress:E,onClickPreview:E,onEnablePIP:E,onDisablePIP:E};b();var Ae=y(g()),tr=y(We());b();var Cs=5e3,x=class extends Ae.Component{constructor(){super(...arguments);n(this,"mounted",!1);n(this,"isReady",!1);n(this,"isPlaying",!1);n(this,"isLoading",!0);n(this,"loadOnReady",null);n(this,"startOnPlay",!0);n(this,"seekOnPlay",null);n(this,"onDurationCalled",!1);n(this,"handlePlayerMount",e=>{if(this.player){this.progress();return}this.player=e,this.player.load(this.props.url),this.progress()});n(this,"getInternalPlayer",e=>this.player?this.player[e]:null);n(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){let e=this.getCurrentTime()||0,r=this.getSecondsLoaded(),o=this.getDuration();if(o){let i={playedSeconds:e,played:e/o};r!==null&&(i.loadedSeconds=r,i.loaded=r/o),(i.playedSeconds!==this.prevPlayed||i.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(i),this.prevPlayed=i.playedSeconds,this.prevLoaded=i.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)});n(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;let{onReady:e,playing:r,volume:o,muted:i}=this.props;e(),!i&&o!==null&&this.player.setVolume(o),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):r&&this.player.play(),this.handleDurationCheck()});n(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;let{onStart:e,onPlay:r,playbackRate:o}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&o!==1&&this.player.setPlaybackRate(o),e(),this.startOnPlay=!1),r(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()});n(this,"handlePause",e=>{this.isPlaying=!1,this.isLoading||this.props.onPause(e)});n(this,"handleEnded",()=>{let{activePlayer:e,loop:r,onEnded:o}=this.props;e.loopOnEnded&&r&&this.seekTo(0),r||(this.isPlaying=!1,o())});n(this,"handleError",(...e)=>{this.isLoading=!1,this.props.onError(...e)});n(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);let e=this.getDuration();e?this.onDurationCalled||(this.props.onDuration(e),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)});n(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(e){if(!this.player)return;let{url:r,playing:o,volume:i,muted:a,playbackRate:l,pip:p,loop:u,activePlayer:h,disableDeferredLoading:P}=this.props;if(!(0,tr.default)(e.url,r)){if(this.isLoading&&!h.forceLoad&&!P&&!M(r)){console.warn(`ReactPlayer: the attempt to load ${r} is being deferred until the player has loaded`),this.loadOnReady=r;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(r,this.isReady)}!e.playing&&o&&!this.isPlaying&&this.player.play(),e.playing&&!o&&this.isPlaying&&this.player.pause(),!e.pip&&p&&this.player.enablePIP&&this.player.enablePIP(),e.pip&&!p&&this.player.disablePIP&&this.player.disablePIP(),e.volume!==i&&i!==null&&this.player.setVolume(i),e.muted!==a&&(a?this.player.mute():(this.player.unmute(),i!==null&&setTimeout(()=>this.player.setVolume(i)))),e.playbackRate!==l&&this.player.setPlaybackRate&&this.player.setPlaybackRate(l),e.loop!==u&&this.player.setLoop&&this.player.setLoop(u)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(e,r,o){if(!this.isReady){e!==0&&(this.seekOnPlay=e,setTimeout(()=>{this.seekOnPlay=null},Cs));return}if(r?r==="fraction":e>0&&e<1){let a=this.player.getDuration();if(!a){console.warn("ReactPlayer: could not seek using fraction \u2013\xA0duration not yet available");return}this.player.seekTo(a*e,o);return}this.player.seekTo(e,o)}render(){let e=this.props.activePlayer;return e?Ae.default.createElement(e,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}};n(x,"displayName","Player"),n(x,"propTypes",he),n(x,"defaultProps",ne);var Ms=w(()=>Promise.resolve().then(()=>(sr(),rr))),xs=typeof window!="undefined"&&window.document,Us=typeof global!="undefined"&&global.window&&global.window.document,Ns=Object.keys(he),Vs=xs||Us?O.Suspense:()=>null,ce=[],ir=(t,s)=>{var e;return e=class extends O.Component{constructor(){super(...arguments);n(this,"state",{showPreview:!!this.props.light});n(this,"references",{wrapper:i=>{this.wrapper=i},player:i=>{this.player=i}});n(this,"handleClickPreview",i=>{this.setState({showPreview:!1}),this.props.onClickPreview(i)});n(this,"showPreview",()=>{this.setState({showPreview:!0})});n(this,"getDuration",()=>this.player?this.player.getDuration():null);n(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null);n(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null);n(this,"getInternalPlayer",(i="player")=>this.player?this.player.getInternalPlayer(i):null);n(this,"seekTo",(i,a,l)=>{if(!this.player)return null;this.player.seekTo(i,a,l)});n(this,"handleReady",()=>{this.props.onReady(this)});n(this,"getActivePlayer",_e(i=>{for(let a of[...ce,...t])if(a.canPlay(i))return a;return s||null}));n(this,"getConfig",_e((i,a)=>{let{config:l}=this.props;return nr.default.all([ne.config,ne.config[a]||{},l,l[a]||{}])}));n(this,"getAttributes",_e(i=>ht(this.props,Ns)));n(this,"renderActivePlayer",i=>{if(!i)return null;let a=this.getActivePlayer(i);if(!a)return null;let l=this.getConfig(i,a.key);return O.default.createElement(x,{...this.props,key:a.key,ref:this.references.player,config:l,activePlayer:a.lazyPlayer||a,onReady:this.handleReady})})}shouldComponentUpdate(i,a){return!(0,Qe.default)(this.props,i)||!(0,Qe.default)(this.state,a)}componentDidUpdate(i){let{light:a}=this.props;!i.light&&a&&this.setState({showPreview:!0}),i.light&&!a&&this.setState({showPreview:!1})}renderPreview(i){if(!i)return null;let{light:a,playIcon:l,previewTabIndex:p,oEmbedUrl:u}=this.props;return O.default.createElement(Ms,{url:i,light:a,playIcon:l,previewTabIndex:p,oEmbedUrl:u,onClick:this.handleClickPreview})}render(){let{url:i,style:a,width:l,height:p,fallback:u,wrapper:h}=this.props,{showPreview:P}=this.state,D=this.getAttributes(i),k=typeof h=="string"?this.references.wrapper:void 0;return O.default.createElement(h,{ref:k,style:{...a,width:l,height:p},...D},O.default.createElement(Vs,{fallback:u},P?this.renderPreview(i):this.renderActivePlayer(i)))}},n(e,"displayName","ReactPlayer"),n(e,"propTypes",he),n(e,"defaultProps",ne),n(e,"addCustomPlayer",i=>{ce.push(i)}),n(e,"removeCustomPlayers",()=>{ce.length=0}),n(e,"canPlay",i=>{for(let a of[...ce,...t])if(a.canPlay(i))return!0;return!1}),n(e,"canEnablePIP",i=>{for(let a of[...ce,...t])if(a.canEnablePIP&&a.canEnablePIP(i))return!0;return!1}),e};var Bs=Te[Te.length-1],Hs=ir(Te,Bs);return yr(js);})(); ReactPlayer = ReactPlayer.default; //# sourceMappingURL=ReactPlayer.js.map diff --git a/dist/ReactPlayer.js.map b/dist/ReactPlayer.js.map index 8d23ec0a..d5c953b5 100644 --- a/dist/ReactPlayer.js.map +++ b/dist/ReactPlayer.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["global-externals-plugin:react", "../node_modules/load-script/index.js", "../node_modules/deepmerge/dist/cjs.js", "../src/utils.js", "../src/patterns.js", "../src/players/YouTube.js", "../src/players/SoundCloud.js", "../src/players/Vimeo.js", "../src/players/Facebook.js", "../src/players/Streamable.js", "../src/players/Wistia.js", "../src/players/Twitch.js", "../src/players/DailyMotion.js", "../src/players/Mixcloud.js", "../src/players/Vidyard.js", "../src/players/Kaltura.js", "../src/players/FilePlayer.js", "../node_modules/react-fast-compare/index.js", "../node_modules/prop-types/lib/ReactPropTypesSecret.js", "../node_modules/prop-types/factoryWithThrowingShims.js", "../node_modules/prop-types/index.js", "../src/Preview.js", "../src/index.js", "../src/players/index.js", "../src/ReactPlayer.js", "../node_modules/memoize-one/dist/memoize-one.esm.js", "../src/props.js", "../src/Player.js"], - "sourcesContent": ["module.exports = globalThis.React", "\nmodule.exports = function load (src, opts, cb) {\n var head = document.head || document.getElementsByTagName('head')[0]\n var script = document.createElement('script')\n\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n\n opts = opts || {}\n cb = cb || function() {}\n\n script.type = opts.type || 'text/javascript'\n script.charset = opts.charset || 'utf8';\n script.async = 'async' in opts ? !!opts.async : true\n script.src = src\n\n if (opts.attrs) {\n setAttributes(script, opts.attrs)\n }\n\n if (opts.text) {\n script.text = '' + opts.text\n }\n\n var onend = 'onload' in script ? stdOnEnd : ieOnEnd\n onend(script, cb)\n\n // some good legacy browsers (firefox) fail the 'in' detection above\n // so as a fallback we always set onload\n // old IE will ignore this and new IE will set onload\n if (!script.onload) {\n stdOnEnd(script, cb);\n }\n\n head.appendChild(script)\n}\n\nfunction setAttributes(script, attrs) {\n for (var attr in attrs) {\n script.setAttribute(attr, attrs[attr]);\n }\n}\n\nfunction stdOnEnd (script, cb) {\n script.onload = function () {\n this.onerror = this.onload = null\n cb(null, script)\n }\n script.onerror = function () {\n // this.onload = null here is necessary\n // because even IE9 works not like others\n this.onerror = this.onload = null\n cb(new Error('Failed to load ' + this.src), script)\n }\n}\n\nfunction ieOnEnd (script, cb) {\n script.onreadystatechange = function () {\n if (this.readyState != 'complete' && this.readyState != 'loaded') return\n this.onreadystatechange = null\n cb(null, script) // there is no way to catch loading errors in IE8\n }\n}\n", "'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n", "import loadScript from 'load-script'\nimport merge from 'deepmerge'\n\nconst MATCH_START_QUERY = /[?&#](?:start|t)=([0-9hms]+)/\nconst MATCH_END_QUERY = /[?&#]end=([0-9hms]+)/\nconst MATCH_START_STAMP = /(\\d+)(h|m|s)/g\nconst MATCH_NUMERIC = /^\\d+$/\n\n// Parse YouTube URL for a start time param, ie ?t=1h14m30s\n// and return the start time in seconds\nfunction parseTimeParam (url, pattern) {\n if (url instanceof Array) {\n return undefined\n }\n const match = url.match(pattern)\n if (match) {\n const stamp = match[1]\n if (stamp.match(MATCH_START_STAMP)) {\n return parseTimeString(stamp)\n }\n if (MATCH_NUMERIC.test(stamp)) {\n return parseInt(stamp)\n }\n }\n return undefined\n}\n\nfunction parseTimeString (stamp) {\n let seconds = 0\n let array = MATCH_START_STAMP.exec(stamp)\n while (array !== null) {\n const [, count, period] = array\n if (period === 'h') seconds += parseInt(count, 10) * 60 * 60\n if (period === 'm') seconds += parseInt(count, 10) * 60\n if (period === 's') seconds += parseInt(count, 10)\n array = MATCH_START_STAMP.exec(stamp)\n }\n return seconds\n}\n\nexport function parseStartTime (url) {\n return parseTimeParam(url, MATCH_START_QUERY)\n}\n\nexport function parseEndTime (url) {\n return parseTimeParam(url, MATCH_END_QUERY)\n}\n\n// http://stackoverflow.com/a/38622545\nexport function randomString () {\n return Math.random().toString(36).substr(2, 5)\n}\n\nexport function queryString (object) {\n return Object\n .keys(object)\n .map(key => `${key}=${object[key]}`)\n .join('&')\n}\n\nfunction getGlobal (key) {\n if (window[key]) {\n return window[key]\n }\n if (window.exports && window.exports[key]) {\n return window.exports[key]\n }\n if (window.module && window.module.exports && window.module.exports[key]) {\n return window.module.exports[key]\n }\n return null\n}\n\n// Util function to load an external SDK\n// or return the SDK if it is already loaded\nconst requests = {}\nexport const getSDK = enableStubOn(function getSDK (url, sdkGlobal, sdkReady = null, isLoaded = () => true, fetchScript = loadScript) {\n const existingGlobal = getGlobal(sdkGlobal)\n if (existingGlobal && isLoaded(existingGlobal)) {\n return Promise.resolve(existingGlobal)\n }\n return new Promise((resolve, reject) => {\n // If we are already loading the SDK, add the resolve and reject\n // functions to the existing array of requests\n if (requests[url]) {\n requests[url].push({ resolve, reject })\n return\n }\n requests[url] = [{ resolve, reject }]\n const onLoaded = sdk => {\n // When loaded, resolve all pending request promises\n requests[url].forEach(request => request.resolve(sdk))\n }\n if (sdkReady) {\n const previousOnReady = window[sdkReady]\n window[sdkReady] = function () {\n if (previousOnReady) previousOnReady()\n onLoaded(getGlobal(sdkGlobal))\n }\n }\n fetchScript(url, err => {\n if (err) {\n // Loading the SDK failed \u2013 reject all requests and\n // reset the array of requests for this SDK\n requests[url].forEach(request => request.reject(err))\n requests[url] = null\n } else if (!sdkReady) {\n onLoaded(getGlobal(sdkGlobal))\n }\n })\n })\n})\n\nexport function getConfig (props, defaultProps) {\n return merge(defaultProps.config, props.config)\n}\n\nexport function omit (object, ...arrays) {\n const omitKeys = [].concat(...arrays)\n const output = {}\n const keys = Object.keys(object)\n for (const key of keys) {\n if (omitKeys.indexOf(key) === -1) {\n output[key] = object[key]\n }\n }\n return output\n}\n\nexport function callPlayer (method, ...args) {\n // Util method for calling a method on this.player\n // but guard against errors and console.warn instead\n if (!this.player || !this.player[method]) {\n let message = `ReactPlayer: ${this.constructor.displayName} player could not call %c${method}%c \u2013 `\n if (!this.player) {\n message += 'The player was not available'\n } else if (!this.player[method]) {\n message += 'The method was not available'\n }\n console.warn(message, 'font-weight: bold', '')\n return null\n }\n return this.player[method](...args)\n}\n\nexport function isMediaStream (url) {\n return (\n typeof window !== 'undefined' &&\n typeof window.MediaStream !== 'undefined' &&\n url instanceof window.MediaStream\n )\n}\n\nexport function isBlobUrl (url) {\n return /^blob:/.test(url)\n}\n\nexport function supportsWebKitPresentationMode (video = document.createElement('video')) {\n // Check if Safari supports PiP, and is not on mobile (other than iPad)\n // iPhone safari appears to \"support\" PiP through the check, however PiP does not function\n const notMobile = /iPhone|iPod/.test(navigator.userAgent) === false\n return video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function' && notMobile\n}\n\n// Workaround for being able to stub out functions in ESM exports.\n// https://github.com/evanw/esbuild/issues/412#issuecomment-723047255\nfunction enableStubOn (fn) {\n if (globalThis.__TEST__) {\n const wrap = (...args) => wrap.stub(...args)\n wrap.stub = fn\n return wrap\n }\n return fn\n}\n", "import { isMediaStream, isBlobUrl } from './utils'\n\nexport const MATCH_URL_YOUTUBE = /(?:youtu\\.be\\/|youtube(?:-nocookie|education)?\\.com\\/(?:embed\\/|v\\/|watch\\/|watch\\?v=|watch\\?.+&v=|shorts\\/|live\\/))((\\w|-){11})|youtube\\.com\\/playlist\\?list=|youtube\\.com\\/user\\//\nexport const MATCH_URL_SOUNDCLOUD = /(?:soundcloud\\.com|snd\\.sc)\\/[^.]+$/\nexport const MATCH_URL_VIMEO = /vimeo\\.com\\/(?!progressive_redirect).+/\nexport const MATCH_URL_FACEBOOK = /^https?:\\/\\/(www\\.)?facebook\\.com.*\\/(video(s)?|watch|story)(\\.php?|\\/).+$/\nexport const MATCH_URL_FACEBOOK_WATCH = /^https?:\\/\\/fb\\.watch\\/.+$/\nexport const MATCH_URL_STREAMABLE = /streamable\\.com\\/([a-z0-9]+)$/\nexport const MATCH_URL_WISTIA = /(?:wistia\\.(?:com|net)|wi\\.st)\\/(?:medias|embed)\\/(?:iframe\\/)?([^?]+)/\nexport const MATCH_URL_TWITCH_VIDEO = /(?:www\\.|go\\.)?twitch\\.tv\\/videos\\/(\\d+)($|\\?)/\nexport const MATCH_URL_TWITCH_CHANNEL = /(?:www\\.|go\\.)?twitch\\.tv\\/([a-zA-Z0-9_]+)($|\\?)/\nexport const MATCH_URL_DAILYMOTION = /^(?:(?:https?):)?(?:\\/\\/)?(?:www\\.)?(?:(?:dailymotion\\.com(?:\\/embed)?\\/video)|dai\\.ly)\\/([a-zA-Z0-9]+)(?:_[\\w_-]+)?(?:[\\w.#_-]+)?/\nexport const MATCH_URL_MIXCLOUD = /mixcloud\\.com\\/([^/]+\\/[^/]+)/\nexport const MATCH_URL_VIDYARD = /vidyard.com\\/(?:watch\\/)?([a-zA-Z0-9-_]+)/\nexport const MATCH_URL_KALTURA = /^https?:\\/\\/[a-zA-Z]+\\.kaltura.(com|org)\\/p\\/([0-9]+)\\/sp\\/([0-9]+)00\\/embedIframeJs\\/uiconf_id\\/([0-9]+)\\/partner_id\\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/\nexport const AUDIO_EXTENSIONS = /\\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\\?)/i\nexport const VIDEO_EXTENSIONS = /\\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\\d+]+)?($|\\?)/i\nexport const HLS_EXTENSIONS = /\\.(m3u8)($|\\?)/i\nexport const DASH_EXTENSIONS = /\\.(mpd)($|\\?)/i\nexport const FLV_EXTENSIONS = /\\.(flv)($|\\?)/i\n\nconst canPlayFile = url => {\n if (url instanceof Array) {\n for (const item of url) {\n if (typeof item === 'string' && canPlayFile(item)) {\n return true\n }\n if (canPlayFile(item.src)) {\n return true\n }\n }\n return false\n }\n if (isMediaStream(url) || isBlobUrl(url)) {\n return true\n }\n return (\n AUDIO_EXTENSIONS.test(url) ||\n VIDEO_EXTENSIONS.test(url) ||\n HLS_EXTENSIONS.test(url) ||\n DASH_EXTENSIONS.test(url) ||\n FLV_EXTENSIONS.test(url)\n )\n}\n\nexport const canPlay = {\n youtube: url => {\n if (url instanceof Array) {\n return url.every(item => MATCH_URL_YOUTUBE.test(item))\n }\n return MATCH_URL_YOUTUBE.test(url)\n },\n soundcloud: url => MATCH_URL_SOUNDCLOUD.test(url) && !AUDIO_EXTENSIONS.test(url),\n vimeo: url => MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url),\n facebook: url => MATCH_URL_FACEBOOK.test(url) || MATCH_URL_FACEBOOK_WATCH.test(url),\n streamable: url => MATCH_URL_STREAMABLE.test(url),\n wistia: url => MATCH_URL_WISTIA.test(url),\n twitch: url => MATCH_URL_TWITCH_VIDEO.test(url) || MATCH_URL_TWITCH_CHANNEL.test(url),\n dailymotion: url => MATCH_URL_DAILYMOTION.test(url),\n mixcloud: url => MATCH_URL_MIXCLOUD.test(url),\n vidyard: url => MATCH_URL_VIDYARD.test(url),\n kaltura: url => MATCH_URL_KALTURA.test(url),\n file: canPlayFile\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK, parseStartTime, parseEndTime } from '../utils'\nimport { canPlay, MATCH_URL_YOUTUBE } from '../patterns'\n\nconst SDK_URL = 'https://www.youtube.com/iframe_api'\nconst SDK_GLOBAL = 'YT'\nconst SDK_GLOBAL_READY = 'onYouTubeIframeAPIReady'\nconst MATCH_PLAYLIST = /[?&](?:list|channel)=([a-zA-Z0-9_-]+)/\nconst MATCH_USER_UPLOADS = /user\\/([a-zA-Z0-9_-]+)\\/?/\nconst MATCH_NOCOOKIE = /youtube-nocookie\\.com/\nconst NOCOOKIE_HOST = 'https://www.youtube-nocookie.com'\n\nexport default class YouTube extends Component {\n static displayName = 'YouTube'\n static canPlay = canPlay.youtube\n callPlayer = callPlayer\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n getID (url) {\n if (!url || url instanceof Array || MATCH_PLAYLIST.test(url)) {\n return null\n }\n return url.match(MATCH_URL_YOUTUBE)[1]\n }\n\n load (url, isReady) {\n const { playing, muted, playsinline, controls, loop, config, onError } = this.props\n const { playerVars, embedOptions } = config\n const id = this.getID(url)\n if (isReady) {\n if (MATCH_PLAYLIST.test(url) || MATCH_USER_UPLOADS.test(url) || url instanceof Array) {\n this.player.loadPlaylist(this.parsePlaylist(url))\n return\n }\n this.player.cueVideoById({\n videoId: id,\n startSeconds: parseStartTime(url) || playerVars.start,\n endSeconds: parseEndTime(url) || playerVars.end\n })\n return\n }\n getSDK(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, YT => YT.loaded).then(YT => {\n if (!this.container) return\n this.player = new YT.Player(this.container, {\n width: '100%',\n height: '100%',\n videoId: id,\n playerVars: {\n autoplay: playing ? 1 : 0,\n mute: muted ? 1 : 0,\n controls: controls ? 1 : 0,\n start: parseStartTime(url),\n end: parseEndTime(url),\n origin: window.location.origin,\n playsinline: playsinline ? 1 : 0,\n ...this.parsePlaylist(url),\n ...playerVars\n },\n events: {\n onReady: () => {\n if (loop) {\n this.player.setLoop(true) // Enable playlist looping\n }\n this.props.onReady()\n },\n onPlaybackRateChange: event => this.props.onPlaybackRateChange(event.data),\n onPlaybackQualityChange: event => this.props.onPlaybackQualityChange(event),\n onStateChange: this.onStateChange,\n onError: event => onError(event.data)\n },\n host: MATCH_NOCOOKIE.test(url) ? NOCOOKIE_HOST : undefined,\n ...embedOptions\n })\n }, onError)\n if (embedOptions.events) {\n console.warn('Using `embedOptions.events` will likely break things. Use ReactPlayer\u2019s callback props instead, eg onReady, onPlay, onPause')\n }\n }\n\n parsePlaylist = (url) => {\n if (url instanceof Array) {\n return {\n listType: 'playlist',\n playlist: url.map(this.getID).join(',')\n }\n }\n if (MATCH_PLAYLIST.test(url)) {\n const [, playlistId] = url.match(MATCH_PLAYLIST)\n return {\n listType: 'playlist',\n list: playlistId.replace(/^UC/, 'UU')\n }\n }\n if (MATCH_USER_UPLOADS.test(url)) {\n const [, username] = url.match(MATCH_USER_UPLOADS)\n return {\n listType: 'user_uploads',\n list: username\n }\n }\n return {}\n }\n\n onStateChange = (event) => {\n const { data } = event\n const { onPlay, onPause, onBuffer, onBufferEnd, onEnded, onReady, loop, config: { playerVars, onUnstarted } } = this.props\n const { UNSTARTED, PLAYING, PAUSED, BUFFERING, ENDED, CUED } = window[SDK_GLOBAL].PlayerState\n if (data === UNSTARTED) onUnstarted()\n if (data === PLAYING) {\n onPlay()\n onBufferEnd()\n }\n if (data === PAUSED) onPause()\n if (data === BUFFERING) onBuffer()\n if (data === ENDED) {\n const isPlaylist = !!this.callPlayer('getPlaylist')\n // Only loop manually if not playing a playlist\n if (loop && !isPlaylist) {\n if (playerVars.start) {\n this.seekTo(playerVars.start)\n } else {\n this.play()\n }\n }\n onEnded()\n }\n if (data === CUED) onReady()\n }\n\n play () {\n this.callPlayer('playVideo')\n }\n\n pause () {\n this.callPlayer('pauseVideo')\n }\n\n stop () {\n if (!document.body.contains(this.callPlayer('getIframe'))) return\n this.callPlayer('stopVideo')\n }\n\n seekTo (amount, keepPlaying = false) {\n this.callPlayer('seekTo', amount)\n if (!keepPlaying && !this.props.playing) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction * 100)\n }\n\n mute = () => {\n this.callPlayer('mute')\n }\n\n unmute = () => {\n this.callPlayer('unMute')\n }\n\n setPlaybackRate (rate) {\n this.callPlayer('setPlaybackRate', rate)\n }\n\n setLoop (loop) {\n this.callPlayer('setLoop', loop)\n }\n\n getDuration () {\n return this.callPlayer('getDuration')\n }\n\n getCurrentTime () {\n return this.callPlayer('getCurrentTime')\n }\n\n getSecondsLoaded () {\n return this.callPlayer('getVideoLoadedFraction') * this.getDuration()\n }\n\n ref = container => {\n this.container = container\n }\n\n render () {\n const { display } = this.props\n const style = {\n width: '100%',\n height: '100%',\n display\n }\n return (\n
\n
\n
\n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK } from '../utils'\nimport { canPlay } from '../patterns'\n\nconst SDK_URL = 'https://w.soundcloud.com/player/api.js'\nconst SDK_GLOBAL = 'SC'\n\nexport default class SoundCloud extends Component {\n static displayName = 'SoundCloud'\n static canPlay = canPlay.soundcloud\n static loopOnEnded = true\n callPlayer = callPlayer\n duration = null\n currentTime = null\n fractionLoaded = null\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url, isReady) {\n getSDK(SDK_URL, SDK_GLOBAL).then(SC => {\n if (!this.iframe) return\n const { PLAY, PLAY_PROGRESS, PAUSE, FINISH, ERROR } = SC.Widget.Events\n if (!isReady) {\n this.player = SC.Widget(this.iframe)\n this.player.bind(PLAY, this.props.onPlay)\n this.player.bind(PAUSE, () => {\n const remaining = this.duration - this.currentTime\n if (remaining < 0.05) {\n // Prevent onPause firing right before onEnded\n return\n }\n this.props.onPause()\n })\n this.player.bind(PLAY_PROGRESS, e => {\n this.currentTime = e.currentPosition / 1000\n this.fractionLoaded = e.loadedProgress\n })\n this.player.bind(FINISH, () => this.props.onEnded())\n this.player.bind(ERROR, e => this.props.onError(e))\n }\n this.player.load(url, {\n ...this.props.config.options,\n callback: () => {\n this.player.getDuration(duration => {\n this.duration = duration / 1000\n this.props.onReady()\n })\n }\n })\n })\n }\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n // Nothing to do\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('seekTo', seconds * 1000)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction * 100)\n }\n\n mute = () => {\n this.setVolume(0)\n }\n\n unmute = () => {\n if (this.props.volume !== null) {\n this.setVolume(this.props.volume)\n }\n }\n\n getDuration () {\n return this.duration\n }\n\n getCurrentTime () {\n return this.currentTime\n }\n\n getSecondsLoaded () {\n return this.fractionLoaded * this.duration\n }\n\n ref = iframe => {\n this.iframe = iframe\n }\n\n render () {\n const { display } = this.props\n const style = {\n width: '100%',\n height: '100%',\n display\n }\n return (\n \n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK } from '../utils'\nimport { canPlay } from '../patterns'\n\nconst SDK_URL = 'https://player.vimeo.com/api/player.js'\nconst SDK_GLOBAL = 'Vimeo'\n\nconst cleanUrl = url => {\n return url.replace('/manage/videos', '')\n}\n\nexport default class Vimeo extends Component {\n static displayName = 'Vimeo'\n static canPlay = canPlay.vimeo\n static forceLoad = true // Prevent checking isLoading when URL changes\n callPlayer = callPlayer\n duration = null\n currentTime = null\n secondsLoaded = null\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url) {\n this.duration = null\n getSDK(SDK_URL, SDK_GLOBAL).then(Vimeo => {\n if (!this.container) return\n const { playerOptions, title } = this.props.config\n this.player = new Vimeo.Player(this.container, {\n url: cleanUrl(url),\n autoplay: this.props.playing,\n muted: this.props.muted,\n loop: this.props.loop,\n playsinline: this.props.playsinline,\n controls: this.props.controls,\n ...playerOptions\n })\n this.player.ready().then(() => {\n const iframe = this.container.querySelector('iframe')\n iframe.style.width = '100%'\n iframe.style.height = '100%'\n if (title) {\n iframe.title = title\n }\n }).catch(this.props.onError)\n this.player.on('loaded', () => {\n this.props.onReady()\n this.refreshDuration()\n })\n this.player.on('play', () => {\n this.props.onPlay()\n this.refreshDuration()\n })\n this.player.on('pause', this.props.onPause)\n this.player.on('seeked', e => this.props.onSeek(e.seconds))\n this.player.on('ended', this.props.onEnded)\n this.player.on('error', this.props.onError)\n this.player.on('timeupdate', ({ seconds }) => {\n this.currentTime = seconds\n })\n this.player.on('progress', ({ seconds }) => {\n this.secondsLoaded = seconds\n })\n this.player.on('bufferstart', this.props.onBuffer)\n this.player.on('bufferend', this.props.onBufferEnd)\n this.player.on('playbackratechange', e => this.props.onPlaybackRateChange(e.playbackRate))\n }, this.props.onError)\n }\n\n refreshDuration () {\n this.player.getDuration().then(duration => {\n this.duration = duration\n })\n }\n\n play () {\n const promise = this.callPlayer('play')\n if (promise) {\n promise.catch(this.props.onError)\n }\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n this.callPlayer('unload')\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('setCurrentTime', seconds)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction)\n }\n\n setMuted (muted) {\n this.callPlayer('setMuted', muted)\n }\n\n setLoop (loop) {\n this.callPlayer('setLoop', loop)\n }\n\n setPlaybackRate (rate) {\n this.callPlayer('setPlaybackRate', rate)\n }\n\n mute = () => {\n this.setMuted(true)\n }\n\n unmute = () => {\n this.setMuted(false)\n }\n\n getDuration () {\n return this.duration\n }\n\n getCurrentTime () {\n return this.currentTime\n }\n\n getSecondsLoaded () {\n return this.secondsLoaded\n }\n\n ref = container => {\n this.container = container\n }\n\n render () {\n const { display } = this.props\n const style = {\n width: '100%',\n height: '100%',\n overflow: 'hidden',\n display\n }\n return (\n \n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK, randomString } from '../utils'\nimport { canPlay } from '../patterns'\n\nconst SDK_URL = 'https://connect.facebook.net/en_US/sdk.js'\nconst SDK_GLOBAL = 'FB'\nconst SDK_GLOBAL_READY = 'fbAsyncInit'\nconst PLAYER_ID_PREFIX = 'facebook-player-'\n\nexport default class Facebook extends Component {\n static displayName = 'Facebook'\n static canPlay = canPlay.facebook\n static loopOnEnded = true\n callPlayer = callPlayer\n playerID = this.props.config.playerId || `${PLAYER_ID_PREFIX}${randomString()}`\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url, isReady) {\n if (isReady) {\n getSDK(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(FB => FB.XFBML.parse())\n return\n }\n getSDK(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(FB => {\n FB.init({\n appId: this.props.config.appId,\n xfbml: true,\n version: this.props.config.version\n })\n FB.Event.subscribe('xfbml.render', msg => {\n // Here we know the SDK has loaded, even if onReady/onPlay\n // is not called due to a video that cannot be embedded\n this.props.onLoaded()\n })\n FB.Event.subscribe('xfbml.ready', msg => {\n if (msg.type === 'video' && msg.id === this.playerID) {\n this.player = msg.instance\n this.player.subscribe('startedPlaying', this.props.onPlay)\n this.player.subscribe('paused', this.props.onPause)\n this.player.subscribe('finishedPlaying', this.props.onEnded)\n this.player.subscribe('startedBuffering', this.props.onBuffer)\n this.player.subscribe('finishedBuffering', this.props.onBufferEnd)\n this.player.subscribe('error', this.props.onError)\n if (this.props.muted) {\n this.callPlayer('mute')\n } else {\n this.callPlayer('unmute')\n }\n this.props.onReady()\n\n // For some reason Facebook have added `visibility: hidden`\n // to the iframe when autoplay fails, so here we set it back\n document.getElementById(this.playerID).querySelector('iframe').style.visibility = 'visible'\n }\n })\n })\n }\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n // Nothing to do\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('seek', seconds)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction)\n }\n\n mute = () => {\n this.callPlayer('mute')\n }\n\n unmute = () => {\n this.callPlayer('unmute')\n }\n\n getDuration () {\n return this.callPlayer('getDuration')\n }\n\n getCurrentTime () {\n return this.callPlayer('getCurrentPosition')\n }\n\n getSecondsLoaded () {\n return null\n }\n\n render () {\n const { attributes } = this.props.config\n const style = {\n width: '100%',\n height: '100%'\n }\n return (\n \n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK } from '../utils'\nimport { canPlay, MATCH_URL_STREAMABLE } from '../patterns'\n\nconst SDK_URL = 'https://cdn.embed.ly/player-0.1.0.min.js'\nconst SDK_GLOBAL = 'playerjs'\n\nexport default class Streamable extends Component {\n static displayName = 'Streamable'\n static canPlay = canPlay.streamable\n callPlayer = callPlayer\n duration = null\n currentTime = null\n secondsLoaded = null\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url) {\n getSDK(SDK_URL, SDK_GLOBAL).then(playerjs => {\n if (!this.iframe) return\n this.player = new playerjs.Player(this.iframe)\n this.player.setLoop(this.props.loop)\n this.player.on('ready', this.props.onReady)\n this.player.on('play', this.props.onPlay)\n this.player.on('pause', this.props.onPause)\n this.player.on('seeked', this.props.onSeek)\n this.player.on('ended', this.props.onEnded)\n this.player.on('error', this.props.onError)\n this.player.on('timeupdate', ({ duration, seconds }) => {\n this.duration = duration\n this.currentTime = seconds\n })\n this.player.on('buffered', ({ percent }) => {\n if (this.duration) {\n this.secondsLoaded = this.duration * percent\n }\n })\n if (this.props.muted) {\n this.player.mute()\n }\n }, this.props.onError)\n }\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n // Nothing to do\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('setCurrentTime', seconds)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction * 100)\n }\n\n setLoop (loop) {\n this.callPlayer('setLoop', loop)\n }\n\n mute = () => {\n this.callPlayer('mute')\n }\n\n unmute = () => {\n this.callPlayer('unmute')\n }\n\n getDuration () {\n return this.duration\n }\n\n getCurrentTime () {\n return this.currentTime\n }\n\n getSecondsLoaded () {\n return this.secondsLoaded\n }\n\n ref = iframe => {\n this.iframe = iframe\n }\n\n render () {\n const id = this.props.url.match(MATCH_URL_STREAMABLE)[1]\n const style = {\n width: '100%',\n height: '100%'\n }\n return (\n \n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK, randomString } from '../utils'\nimport { canPlay, MATCH_URL_WISTIA } from '../patterns'\n\nconst SDK_URL = 'https://fast.wistia.com/assets/external/E-v1.js'\nconst SDK_GLOBAL = 'Wistia'\nconst PLAYER_ID_PREFIX = 'wistia-player-'\n\nexport default class Wistia extends Component {\n static displayName = 'Wistia'\n static canPlay = canPlay.wistia\n static loopOnEnded = true\n callPlayer = callPlayer\n playerID = this.props.config.playerId || `${PLAYER_ID_PREFIX}${randomString()}`\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url) {\n const { playing, muted, controls, onReady, config, onError } = this.props\n getSDK(SDK_URL, SDK_GLOBAL).then(Wistia => {\n if (config.customControls) {\n config.customControls.forEach(control => Wistia.defineControl(control))\n }\n window._wq = window._wq || []\n window._wq.push({\n id: this.playerID,\n options: {\n autoPlay: playing,\n silentAutoPlay: 'allow',\n muted,\n controlsVisibleOnLoad: controls,\n fullscreenButton: controls,\n playbar: controls,\n playbackRateControl: controls,\n qualityControl: controls,\n volumeControl: controls,\n settingsControl: controls,\n smallPlayButton: controls,\n ...config.options\n },\n onReady: player => {\n this.player = player\n this.unbind()\n this.player.bind('play', this.onPlay)\n this.player.bind('pause', this.onPause)\n this.player.bind('seek', this.onSeek)\n this.player.bind('end', this.onEnded)\n this.player.bind('playbackratechange', this.onPlaybackRateChange)\n onReady()\n }\n })\n }, onError)\n }\n\n unbind () {\n this.player.unbind('play', this.onPlay)\n this.player.unbind('pause', this.onPause)\n this.player.unbind('seek', this.onSeek)\n this.player.unbind('end', this.onEnded)\n this.player.unbind('playbackratechange', this.onPlaybackRateChange)\n }\n\n // Proxy methods to prevent listener leaks\n onPlay = (...args) => this.props.onPlay(...args)\n onPause = (...args) => this.props.onPause(...args)\n onSeek = (...args) => this.props.onSeek(...args)\n onEnded = (...args) => this.props.onEnded(...args)\n onPlaybackRateChange = (...args) => this.props.onPlaybackRateChange(...args)\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n this.unbind()\n this.callPlayer('remove')\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('time', seconds)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('volume', fraction)\n }\n\n mute = () => {\n this.callPlayer('mute')\n }\n\n unmute = () => {\n this.callPlayer('unmute')\n }\n\n setPlaybackRate (rate) {\n this.callPlayer('playbackRate', rate)\n }\n\n getDuration () {\n return this.callPlayer('duration')\n }\n\n getCurrentTime () {\n return this.callPlayer('time')\n }\n\n getSecondsLoaded () {\n return null\n }\n\n render () {\n const { url } = this.props\n const videoID = url && url.match(MATCH_URL_WISTIA)[1]\n const className = `wistia_embed wistia_async_${videoID}`\n const style = {\n width: '100%',\n height: '100%'\n }\n return (\n
\n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK, parseStartTime, randomString } from '../utils'\nimport { canPlay, MATCH_URL_TWITCH_CHANNEL, MATCH_URL_TWITCH_VIDEO } from '../patterns'\n\nconst SDK_URL = 'https://player.twitch.tv/js/embed/v1.js'\nconst SDK_GLOBAL = 'Twitch'\nconst PLAYER_ID_PREFIX = 'twitch-player-'\n\nexport default class Twitch extends Component {\n static displayName = 'Twitch'\n static canPlay = canPlay.twitch\n static loopOnEnded = true\n callPlayer = callPlayer\n playerID = this.props.config.playerId || `${PLAYER_ID_PREFIX}${randomString()}`\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url, isReady) {\n const { playsinline, onError, config, controls } = this.props\n const isChannel = MATCH_URL_TWITCH_CHANNEL.test(url)\n const id = isChannel ? url.match(MATCH_URL_TWITCH_CHANNEL)[1] : url.match(MATCH_URL_TWITCH_VIDEO)[1]\n if (isReady) {\n if (isChannel) {\n this.player.setChannel(id)\n } else {\n this.player.setVideo('v' + id)\n }\n return\n }\n getSDK(SDK_URL, SDK_GLOBAL).then(Twitch => {\n this.player = new Twitch.Player(this.playerID, {\n video: isChannel ? '' : id,\n channel: isChannel ? id : '',\n height: '100%',\n width: '100%',\n playsinline,\n autoplay: this.props.playing,\n muted: this.props.muted,\n // https://github.com/CookPete/react-player/issues/733#issuecomment-549085859\n controls: isChannel ? true : controls,\n time: parseStartTime(url),\n ...config.options\n })\n const { READY, PLAYING, PAUSE, ENDED, ONLINE, OFFLINE, SEEK } = Twitch.Player\n this.player.addEventListener(READY, this.props.onReady)\n this.player.addEventListener(PLAYING, this.props.onPlay)\n this.player.addEventListener(PAUSE, this.props.onPause)\n this.player.addEventListener(ENDED, this.props.onEnded)\n this.player.addEventListener(SEEK, this.props.onSeek)\n\n // Prevent weird isLoading behaviour when streams are offline\n this.player.addEventListener(ONLINE, this.props.onLoaded)\n this.player.addEventListener(OFFLINE, this.props.onLoaded)\n }, onError)\n }\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n this.callPlayer('pause')\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('seek', seconds)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction)\n }\n\n mute = () => {\n this.callPlayer('setMuted', true)\n }\n\n unmute = () => {\n this.callPlayer('setMuted', false)\n }\n\n getDuration () {\n return this.callPlayer('getDuration')\n }\n\n getCurrentTime () {\n return this.callPlayer('getCurrentTime')\n }\n\n getSecondsLoaded () {\n return null\n }\n\n render () {\n const style = {\n width: '100%',\n height: '100%'\n }\n return (\n
\n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK, parseStartTime } from '../utils'\nimport { canPlay, MATCH_URL_DAILYMOTION } from '../patterns'\n\nconst SDK_URL = 'https://api.dmcdn.net/all.js'\nconst SDK_GLOBAL = 'DM'\nconst SDK_GLOBAL_READY = 'dmAsyncInit'\n\nexport default class DailyMotion extends Component {\n static displayName = 'DailyMotion'\n static canPlay = canPlay.dailymotion\n static loopOnEnded = true\n callPlayer = callPlayer\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url) {\n const { controls, config, onError, playing } = this.props\n const [, id] = url.match(MATCH_URL_DAILYMOTION)\n if (this.player) {\n this.player.load(id, {\n start: parseStartTime(url),\n autoplay: playing\n })\n return\n }\n getSDK(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, DM => DM.player).then(DM => {\n if (!this.container) return\n const Player = DM.player\n this.player = new Player(this.container, {\n width: '100%',\n height: '100%',\n video: id,\n params: {\n controls,\n autoplay: this.props.playing,\n mute: this.props.muted,\n start: parseStartTime(url),\n origin: window.location.origin,\n ...config.params\n },\n events: {\n apiready: this.props.onReady,\n seeked: () => this.props.onSeek(this.player.currentTime),\n video_end: this.props.onEnded,\n durationchange: this.onDurationChange,\n pause: this.props.onPause,\n playing: this.props.onPlay,\n waiting: this.props.onBuffer,\n error: event => onError(event)\n }\n })\n }, onError)\n }\n\n onDurationChange = () => {\n const duration = this.getDuration()\n this.props.onDuration(duration)\n }\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n // Nothing to do\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('seek', seconds)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction)\n }\n\n mute = () => {\n this.callPlayer('setMuted', true)\n }\n\n unmute = () => {\n this.callPlayer('setMuted', false)\n }\n\n getDuration () {\n return this.player.duration || null\n }\n\n getCurrentTime () {\n return this.player.currentTime\n }\n\n getSecondsLoaded () {\n return this.player.bufferedTime\n }\n\n ref = container => {\n this.container = container\n }\n\n render () {\n const { display } = this.props\n const style = {\n width: '100%',\n height: '100%',\n display\n }\n return (\n
\n
\n
\n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK, queryString } from '../utils'\nimport { canPlay, MATCH_URL_MIXCLOUD } from '../patterns'\n\nconst SDK_URL = 'https://widget.mixcloud.com/media/js/widgetApi.js'\nconst SDK_GLOBAL = 'Mixcloud'\n\nexport default class Mixcloud extends Component {\n static displayName = 'Mixcloud'\n static canPlay = canPlay.mixcloud\n static loopOnEnded = true\n callPlayer = callPlayer\n duration = null\n currentTime = null\n secondsLoaded = null\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url) {\n getSDK(SDK_URL, SDK_GLOBAL).then(Mixcloud => {\n this.player = Mixcloud.PlayerWidget(this.iframe)\n this.player.ready.then(() => {\n this.player.events.play.on(this.props.onPlay)\n this.player.events.pause.on(this.props.onPause)\n this.player.events.ended.on(this.props.onEnded)\n this.player.events.error.on(this.props.error)\n this.player.events.progress.on((seconds, duration) => {\n this.currentTime = seconds\n this.duration = duration\n })\n this.props.onReady()\n })\n }, this.props.onError)\n }\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n // Nothing to do\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('seek', seconds)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n // No volume support\n }\n\n mute = () => {\n // No volume support\n }\n\n unmute = () => {\n // No volume support\n }\n\n getDuration () {\n return this.duration\n }\n\n getCurrentTime () {\n return this.currentTime\n }\n\n getSecondsLoaded () {\n return null\n }\n\n ref = iframe => {\n this.iframe = iframe\n }\n\n render () {\n const { url, config } = this.props\n const id = url.match(MATCH_URL_MIXCLOUD)[1]\n const style = {\n width: '100%',\n height: '100%'\n }\n const query = queryString({\n ...config.options,\n feed: `/${id}/`\n })\n // We have to give the iframe a key here to prevent a\n // weird dialog appearing when loading a new track\n return (\n \n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK } from '../utils'\nimport { canPlay, MATCH_URL_VIDYARD } from '../patterns'\n\nconst SDK_URL = 'https://play.vidyard.com/embed/v4.js'\nconst SDK_GLOBAL = 'VidyardV4'\nconst SDK_GLOBAL_READY = 'onVidyardAPI'\n\nexport default class Vidyard extends Component {\n static displayName = 'Vidyard'\n static canPlay = canPlay.vidyard\n callPlayer = callPlayer\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url) {\n const { playing, config, onError, onDuration } = this.props\n const id = url && url.match(MATCH_URL_VIDYARD)[1]\n if (this.player) {\n this.stop()\n }\n getSDK(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(Vidyard => {\n if (!this.container) return\n Vidyard.api.addReadyListener((data, player) => {\n if (this.player) {\n return\n }\n this.player = player\n this.player.on('ready', this.props.onReady)\n this.player.on('play', this.props.onPlay)\n this.player.on('pause', this.props.onPause)\n this.player.on('seek', this.props.onSeek)\n this.player.on('playerComplete', this.props.onEnded)\n }, id)\n Vidyard.api.renderPlayer({\n uuid: id,\n container: this.container,\n autoplay: playing ? 1 : 0,\n ...config.options\n })\n Vidyard.api.getPlayerMetadata(id).then(meta => {\n this.duration = meta.length_in_seconds\n onDuration(meta.length_in_seconds)\n })\n }, onError)\n }\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n window.VidyardV4.api.destroyPlayer(this.player)\n }\n\n seekTo (amount, keepPlaying = true) {\n this.callPlayer('seek', amount)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction)\n }\n\n mute = () => {\n this.setVolume(0)\n }\n\n unmute = () => {\n if (this.props.volume !== null) {\n this.setVolume(this.props.volume)\n }\n }\n\n setPlaybackRate (rate) {\n this.callPlayer('setPlaybackSpeed', rate)\n }\n\n getDuration () {\n return this.duration\n }\n\n getCurrentTime () {\n return this.callPlayer('currentTime')\n }\n\n getSecondsLoaded () {\n return null\n }\n\n ref = container => {\n this.container = container\n }\n\n render () {\n const { display } = this.props\n const style = {\n width: '100%',\n height: '100%',\n display\n }\n return (\n
\n
\n
\n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { callPlayer, getSDK } from '../utils'\nimport { canPlay } from '../patterns'\n\nconst SDK_URL = 'https://cdn.embed.ly/player-0.1.0.min.js'\nconst SDK_GLOBAL = 'playerjs'\n\nexport default class Kaltura extends Component {\n static displayName = 'Kaltura'\n static canPlay = canPlay.kaltura\n callPlayer = callPlayer\n duration = null\n currentTime = null\n secondsLoaded = null\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n }\n\n load (url) {\n getSDK(SDK_URL, SDK_GLOBAL).then(playerjs => {\n if (!this.iframe) return\n this.player = new playerjs.Player(this.iframe)\n this.player.on('ready', () => {\n // An arbitrary timeout is required otherwise\n // the event listeners won\u2019t work\n setTimeout(() => {\n this.player.isReady = true\n this.player.setLoop(this.props.loop)\n if (this.props.muted) {\n this.player.mute()\n }\n this.addListeners(this.player, this.props)\n this.props.onReady()\n }, 500)\n })\n }, this.props.onError)\n }\n\n addListeners (player, props) {\n player.on('play', props.onPlay)\n player.on('pause', props.onPause)\n player.on('ended', props.onEnded)\n player.on('error', props.onError)\n player.on('timeupdate', ({ duration, seconds }) => {\n this.duration = duration\n this.currentTime = seconds\n })\n }\n\n play () {\n this.callPlayer('play')\n }\n\n pause () {\n this.callPlayer('pause')\n }\n\n stop () {\n // Nothing to do\n }\n\n seekTo (seconds, keepPlaying = true) {\n this.callPlayer('setCurrentTime', seconds)\n if (!keepPlaying) {\n this.pause()\n }\n }\n\n setVolume (fraction) {\n this.callPlayer('setVolume', fraction)\n }\n\n setLoop (loop) {\n this.callPlayer('setLoop', loop)\n }\n\n mute = () => {\n this.callPlayer('mute')\n }\n\n unmute = () => {\n this.callPlayer('unmute')\n }\n\n getDuration () {\n return this.duration\n }\n\n getCurrentTime () {\n return this.currentTime\n }\n\n getSecondsLoaded () {\n return this.secondsLoaded\n }\n\n ref = iframe => {\n this.iframe = iframe\n }\n\n render () {\n const style = {\n width: '100%',\n height: '100%'\n }\n return (\n \n )\n }\n}\n", "import React, { Component } from 'react'\n\nimport { getSDK, isMediaStream, supportsWebKitPresentationMode } from '../utils'\nimport { canPlay, AUDIO_EXTENSIONS, HLS_EXTENSIONS, DASH_EXTENSIONS, FLV_EXTENSIONS } from '../patterns'\n\nconst HAS_NAVIGATOR = typeof navigator !== 'undefined'\nconst IS_IPAD_PRO = HAS_NAVIGATOR && navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1\nconst IS_IOS = HAS_NAVIGATOR && (/iPad|iPhone|iPod/.test(navigator.userAgent) || IS_IPAD_PRO) && !window.MSStream\nconst IS_SAFARI = HAS_NAVIGATOR && (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) && !window.MSStream\nconst HLS_SDK_URL = 'https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js'\nconst HLS_GLOBAL = 'Hls'\nconst DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js'\nconst DASH_GLOBAL = 'dashjs'\nconst FLV_SDK_URL = 'https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js'\nconst FLV_GLOBAL = 'flvjs'\nconst MATCH_DROPBOX_URL = /www\\.dropbox\\.com\\/.+/\nconst MATCH_CLOUDFLARE_STREAM = /https:\\/\\/watch\\.cloudflarestream\\.com\\/([a-z0-9]+)/\nconst REPLACE_CLOUDFLARE_STREAM = 'https://videodelivery.net/{id}/manifest/video.m3u8'\n\nexport default class FilePlayer extends Component {\n static displayName = 'FilePlayer'\n static canPlay = canPlay.file\n\n componentDidMount () {\n this.props.onMount && this.props.onMount(this)\n this.addListeners(this.player)\n const src = this.getSource(this.props.url) // Ensure src is set in strict mode\n if (src) {\n this.player.src = src\n }\n if (IS_IOS || this.props.config.forceDisableHls) {\n this.player.load()\n }\n }\n\n componentDidUpdate (prevProps) {\n if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(prevProps)) {\n this.removeListeners(this.prevPlayer, prevProps.url)\n this.addListeners(this.player)\n }\n\n if (\n this.props.url !== prevProps.url &&\n !isMediaStream(this.props.url) &&\n !(this.props.url instanceof Array) // Avoid infinite loop\n ) {\n this.player.srcObject = null\n }\n }\n\n componentWillUnmount () {\n this.player.removeAttribute('src')\n this.removeListeners(this.player)\n if (this.hls) {\n this.hls.destroy()\n }\n }\n\n addListeners (player) {\n const { url, playsinline } = this.props\n player.addEventListener('play', this.onPlay)\n player.addEventListener('waiting', this.onBuffer)\n player.addEventListener('playing', this.onBufferEnd)\n player.addEventListener('pause', this.onPause)\n player.addEventListener('seeked', this.onSeek)\n player.addEventListener('ended', this.onEnded)\n player.addEventListener('error', this.onError)\n player.addEventListener('ratechange', this.onPlayBackRateChange)\n player.addEventListener('enterpictureinpicture', this.onEnablePIP)\n player.addEventListener('leavepictureinpicture', this.onDisablePIP)\n player.addEventListener('webkitpresentationmodechanged', this.onPresentationModeChange)\n if (!this.shouldUseHLS(url)) { // onReady is handled by hls.js\n player.addEventListener('canplay', this.onReady)\n }\n if (playsinline) {\n player.setAttribute('playsinline', '')\n player.setAttribute('webkit-playsinline', '')\n player.setAttribute('x5-playsinline', '')\n }\n }\n\n removeListeners (player, url) {\n player.removeEventListener('canplay', this.onReady)\n player.removeEventListener('play', this.onPlay)\n player.removeEventListener('waiting', this.onBuffer)\n player.removeEventListener('playing', this.onBufferEnd)\n player.removeEventListener('pause', this.onPause)\n player.removeEventListener('seeked', this.onSeek)\n player.removeEventListener('ended', this.onEnded)\n player.removeEventListener('error', this.onError)\n player.removeEventListener('ratechange', this.onPlayBackRateChange)\n player.removeEventListener('enterpictureinpicture', this.onEnablePIP)\n player.removeEventListener('leavepictureinpicture', this.onDisablePIP)\n player.removeEventListener('webkitpresentationmodechanged', this.onPresentationModeChange)\n if (!this.shouldUseHLS(url)) { // onReady is handled by hls.js\n player.removeEventListener('canplay', this.onReady)\n }\n }\n\n // Proxy methods to prevent listener leaks\n onReady = (...args) => this.props.onReady(...args)\n onPlay = (...args) => this.props.onPlay(...args)\n onBuffer = (...args) => this.props.onBuffer(...args)\n onBufferEnd = (...args) => this.props.onBufferEnd(...args)\n onPause = (...args) => this.props.onPause(...args)\n onEnded = (...args) => this.props.onEnded(...args)\n onError = (...args) => this.props.onError(...args)\n onPlayBackRateChange = (event) => this.props.onPlaybackRateChange(event.target.playbackRate)\n onEnablePIP = (...args) => this.props.onEnablePIP(...args)\n\n onDisablePIP = e => {\n const { onDisablePIP, playing } = this.props\n onDisablePIP(e)\n if (playing) {\n this.play()\n }\n }\n\n onPresentationModeChange = e => {\n if (this.player && supportsWebKitPresentationMode(this.player)) {\n const { webkitPresentationMode } = this.player\n if (webkitPresentationMode === 'picture-in-picture') {\n this.onEnablePIP(e)\n } else if (webkitPresentationMode === 'inline') {\n this.onDisablePIP(e)\n }\n }\n }\n\n onSeek = e => {\n this.props.onSeek(e.target.currentTime)\n }\n\n shouldUseAudio (props) {\n if (props.config.forceVideo) {\n return false\n }\n if (props.config.attributes.poster) {\n return false // Use