(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2042],{19956:(e,t,r)=>{let a,s,l;var n=Object.create,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,u=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of p(t))d.call(e,s)||s===r||i(e,s,{get:()=>t[s],enumerable:!(a=o(t,s))||a.enumerable});return e},y=(e,t,r)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?i(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r,r},c={},m={default:()=>g};for(var P in m)i(c,P,{get:m[P],enumerable:!0});e.exports=u(i({},"__esModule",{value:!0}),c);var b=(l=null!=(a=r(50245))?n(h(a)):{},u(!s&&a&&a.__esModule?l:i(l,"default",{value:a,enumerable:!0}),a)),v=r(90533),f=r(60595);class g extends b.Component{constructor(){super(...arguments),y(this,"callPlayer",v.callPlayer),y(this,"playerID",this.props.config.playerId||`twitch-player-${(0,v.randomString)()}`),y(this,"mute",()=>{this.callPlayer("setMuted",!0)}),y(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,t){let{playsinline:r,onError:a,config:s,controls:l}=this.props,n=f.MATCH_URL_TWITCH_CHANNEL.test(e),i=n?e.match(f.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(f.MATCH_URL_TWITCH_VIDEO)[1];t?n?this.player.setChannel(i):this.player.setVideo("v"+i):(0,v.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then(t=>{this.player=new t.Player(this.playerID,{video:n?"":i,channel:n?i:"",height:"100%",width:"100%",playsinline:r,autoplay:this.props.playing,muted:this.props.muted,controls:!!n||l,time:(0,v.parseStartTime)(e),...s.options});let{READY:a,PLAYING:o,PAUSE:p,ENDED:h,ONLINE:d,OFFLINE:u,SEEK:y}=t.Player;this.player.addEventListener(a,this.props.onReady),this.player.addEventListener(o,this.props.onPlay),this.player.addEventListener(p,this.props.onPause),this.player.addEventListener(h,this.props.onEnded),this.player.addEventListener(y,this.props.onSeek),this.player.addEventListener(d,this.props.onLoaded),this.player.addEventListener(u,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,t=!0){this.callPlayer("seek",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){return b.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}}y(g,"displayName","Twitch"),y(g,"canPlay",f.canPlay.twitch),y(g,"loopOnEnded",!0)}}]);