(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6328],{93934:(e,t,r)=>{var a=Object.create,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,p=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of n(t))l.call(e,o)||o===r||i(e,o,{get:()=>t[o],enumerable:!(a=s(t,o))||a.enumerable});return e},u=(e,t,r)=>(((e,t,r)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),r),h={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(h,{default:()=>m}),e.exports=p(i({},"__esModule",{value:!0}),h);var y=((e,t,r)=>(r=null!=e?a(o(e)):{},p(!t&&e&&e.__esModule?r:i(r,"default",{value:e,enumerable:!0}),e)))(r(14232)),d=r(24657),c=r(73443);class m extends y.Component{constructor(){super(...arguments),u(this,"callPlayer",d.callPlayer),u(this,"onDurationChange",()=>{let e=this.getDuration();this.props.onDuration(e)}),u(this,"mute",()=>{this.callPlayer("setMuted",!0)}),u(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),u(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){let{controls:t,config:r,onError:a,playing:i}=this.props,[,s]=e.match(c.MATCH_URL_DAILYMOTION);if(this.player)return void this.player.load(s,{start:(0,d.parseStartTime)(e),autoplay:i});(0,d.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",e=>e.player).then(i=>{if(!this.container)return;let n=i.player;this.player=new n(this.container,{width:"100%",height:"100%",video:s,params:{controls:t,autoplay:this.props.playing,mute:this.props.muted,start:(0,d.parseStartTime)(e),origin:window.location.origin,...r.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:e=>a(e)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("seek",e),t||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 y.default.createElement("div",{style:{width:"100%",height:"100%",display:e}},y.default.createElement("div",{ref:this.ref}))}}u(m,"displayName","DailyMotion"),u(m,"canPlay",c.canPlay.dailymotion),u(m,"loopOnEnded",!0)}}]);