1import{R as r}from"./vendor-react-nj2ukvvY.js";import{c as He,e2 as We,e3 as Fe,X as $e,e4 as ze,e5 as Ke,e6 as we,dG as qe,h as Ye,e7 as Ve,e8 as Xe,e9 as x,ea as B,ct as Ge,eb as Ze,ec as I,T as Je,ed as Qe,dV as be,D as je,L as Le,K as b,J as N,I as C,a9 as et,aa as ke,ee as tt,ef as st}from"./index-CvtoAcCz.js";import{m as Ie,a as De}from"./mux-D6z-_C4j.js";import{m as w}from"./vendor-moment-CqZOA61p.js";import{d as it}from"./index-BQMd8I3b.js";import{i as Me,g as at}from"./vendor-lodash-CuICpPff.js";import{S as ot}from"./Slider-0KrFl9YR.js";import{P as nt}from"./playerOverlay-BKV2PZEC.js";import"./vendor-apollo-AvuNUkOJ.js";import"./objectSpread2-BDG0PPbD.js";let v=0,D=0,L=!1,R=0,K=!1;const M=parseInt(st,10),Y=class Y extends r.Component{constructor(d){super(d),this.errorTranslator=e=>({player_error_code:Ie.translateCode(e.player_error_code),player_error_message:Ie.translateMessage(e.player_error_message)}),this.handleVideoPlayType=()=>{this.setState({isSupportNative:!1},()=>{setTimeout(()=>{this.ref&&this.ref.getInternalPlayer()&&typeof De<"u"&&(this.hls=this.ref.getInternalPlayer("hls"),this.muxMonitor(this.ref.getInternalPlayer()))},500)})},this.getLanguagesFromSessionData=(e,t)=>{var l,c,m;const{defaultPlayBackData:s}=this.state,{isBroadCastLive:i,session:a,selectedPlayBack:o}=this.props;if(!(e!=null&&e.assetList)||e.assetList.length===0)return[];let n=null;return(i||L)&&((l=s==null?void 0:s.sessionSubtitleDTOList)==null?void 0:l.length)>0?n=s:(c=a==null?void 0:a.captions)!=null&&c.generatedSubtitles&&t?n=null:n=o,((m=n==null?void 0:n.sessionSubtitleDTOList)==null?void 0:m.map(p=>{var g;const u=((g=p==null?void 0:p.languageRegionName)==null?void 0:g.split("_"))||[],P=u.length>1?`${u[0]} (${u.slice(1).join(" ")})`:u[0];return{id:p.id,code:p.languageCode,name:P,url:p.subTitleFileUrl}}))||[]},this.checkStreamAvailable=(e,t,s,i)=>{var n;const a=this.ref&&this.ref.getInternalPlayer("hls")||s;this.hls=a;const{src:o}=this.state;if(s){if(t&&t.fatal)switch(t.type){case i.ErrorTypes.NETWORK_ERROR:this.timeout=setTimeout(()=>{a.loadSource(o)},5e3),a.startLoad(),((n=t==null?void 0:t.response)==null?void 0:n.code)===403?this.setState({authorizedDomain:"Not Authorized"}):this.setState({authorizedDomain:null});break;case i.ErrorTypes.MEDIA_ERROR:a.recoverMediaError();break;default:a.loadSource(o),a.startLoad();break}else switch(t&&t.details){case"bufferAddCodecError":a.swapAudioCodec(),a.recoverMediaError();break;case"levelLoadError":a.startLoad();break;case"bufferSeekOverHole":break;case"bufferStalledError":break;case"bufferNudgeOnStall":break;case"bufferAppendError":break;default:a.recoverMediaError();break}Ve.canPlay(o)}},this.setVideoVariableToZero=()=>{v=0,R=0,D=0,this.lastHttpSentTime=0},this.onPlayerReady=()=>{var n;const{onLoadingStop:e,isWelcomeVideoPreview:t=!1,session:s,pipModeVideo:i}=this.props,{enableCaptions:a}=i||{},{selectedLanguageCode:o}=this.state;if(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),!t){if(Xe()&&(s==null?void 0:s.streamProvider)==="DIRECT_UPLOAD"){const m=this.calculateVideoStartingSeconds();(n=this.ref)==null||n.seekTo(m,"seconds")}const l=this.ref.getInternalPlayer(),c=l==null?void 0:l.play();c!==void 0&&c.then(()=>{this.setState({loading:!1},()=>{e&&e()})}).catch(()=>{this.setState({showPopUp:!0,loading:!1},()=>{e&&e()})}),a!==void 0&&o&&setTimeout(()=>{this.setState({enableCaptions:a},()=>{this.updateCaptionTracks(o)})},1e3)}v=0,R=0},this.handleVolumeChange=e=>{var s;const t=document.getElementById("nativeVideo");((s=e==null?void 0:e.target)==null?void 0:s.value)==="0"?this.setState({muted:!0}):this.setState({muted:!1}),t&&(t.volume=parseFloat(e.target.value)),this.setState({volume:parseFloat(e.target.value)})},this.handleCaptionforNotDirectUpload=()=>{const{enableCaptions:e}=this.state,t=!e;this.setState({enableCaptions:t},()=>{var a;const s=(a=this.ref)==null?void 0:a.getInternalPlayer(),i=s==null?void 0:s.textTracks;if(i&&i.length>0){const o=i[0];this.showHideCaption(t,o)}})},this.handleCaption=()=>{this.setState(e=>({showDropdown:!e.showDropdown}))},this.closeDropdown=()=>{this.setState({showDropdown:!1})},this.toggleCaptions=e=>{this.setState({enableCaptions:e,showDropdown:!1,selectedLanguage:null},()=>{this.updateCaptionTracks("")})},this.selectLanguage=e=>{this.setState({selectedLanguage:e.name,enableCaptions:!0},()=>{this.updateCaptionTracks(e.code)})},this.updateCaptionTracks=e=>{var o,n;const{session:t}=this.props||{},{enableCaptions:s}
1=this.state,{captions:i}=t||{},a=(o=this.ref)==null?void 0:o.getInternalPlayer();if(a&&a.textTracks&&a.textTracks.length>0){for(let l=0;l<a.textTracks.length;l++)a.textTracks[l].mode="disabled";if(!e&&!(i!=null&&i.generatedSubtitles)&&(a!=null&&a.textTracks[0])&&(e=(n=a==null?void 0:a.textTracks[0])==null?void 0:n.language),e&&s||e&&(i!=null&&i.generatedSubtitles)&&!s){const l=e.replace("_","-");for(let c=0;c<a.textTracks.length;c++)if(a.textTracks[c].language===l){a.textTracks[c].mode="showing",this.setState({selectedLanguageCode:e});break}}}},this.showHideCaption=(e,t)=>{const{session:s}=this.props,{enableVideoCaption:i,captions:a}=s||{},{generatedSubtitles:o}=a||{},n=this.ref.getInternalPlayer(),l=this.getLanguagesFromSessionData(s,!1),c=l.length>0?l[0]:null;n!=null&&n.textTracks&&(o?n.textTracks[0]&&(e?(n.textTracks[0].mode="showing",this.setState({selectedLanguageCode:null,selectedLanguage:null})):(n.textTracks[0].mode="disabled",this.setState({enableCaptions:e},()=>{this.updateCaptionTracks(c==null?void 0:c.code)}))):i?e&&t?t.mode="showing":t&&(t.mode="disabled",this.updateCaptionTracks(c==null?void 0:c.code)):t&&(e?(t.mode="showing",this.updateCaptionTracks(c==null?void 0:c.code)):(t.mode="disabled",this.updateCaptionTracks(c==null?void 0:c.code))))},this.handleToggleMuted=()=>{if(this.state.isSupportNative){const e=document.getElementById("nativeVideo");e.muted=!this.state.muted}this.setState({muted:!this.state.muted})},this.getDetaultPlayback=e=>{const{eventData:t}=this.props,{eventURL:s,eventUrl:i}=t||{};this.props.getDetaultPlayback(s||i,e.sessionId).then(a=>{a&&!a.errorMessage&&this.setState({defaultPlayBackData:a==null?void 0:a.data})})},this.handlePipMode=()=>{var V;const{pip:e,enableCaptions:t,selectedLanguage:s,selectedLanguageCode:i}=this.state,{session:a,userTicketTypeIds:o,pushDataToKinesis:n,isFrom:l=null,streamUrl:c=null,isBroadCastLive:m,liveFrom:p,isSessionOrBroadcastLive:u,selectedPlayBack:P}=this.props,g=u||K,{src:S}=this.state,T=document.querySelector("#react-player video"),f=(V=this.ref)==null?void 0:V.getInternalPlayer();l&&(l==="LOBBY_STREAM"||l==="EXPO_STREAM")?(this.applyPipCaptionSettings(),this.props.isPipMode({src:S,currentTime:T==null?void 0:T.currentTime,showPipMo
1deVideo:!0,videoCurrentURL:`${window.location.pathname}`,isChimeMeetingPipMode:!1,session:a,isFrom:l,liveStreamUrl:c,onEnded:this.onEnded,volume:f==null?void 0:f.volume,playbackRate:f==null?void 0:f.playbackRate,muted:f==null?void 0:f.muted,isBroadCastLive:m,liveFrom:p,selectedPlayBack:P,enableCaptions:t,selectedLanguage:s,selectedLanguageCode:i})):this.props.isPipMode({src:S,currentTime:T==null?void 0:T.currentTime,showPipModeVideo:!0,session:a,userTicketTypeIds:o,pushDataToKinesis:n,videoCurrentURL:window.location.pathname,volume:f==null?void 0:f.volume,playbackRate:f==null?void 0:f.playbackRate,muted:f==null?void 0:f.muted,isBroadCastLive:m,liveFrom:p,enableCaptions:t,isSessionOrBroadcastLive:g,selectedPlayBack:P,selectedLanguage:s,selectedLanguageCode:i}),this.setState({pip:e,showPopUp:!1,src:null})},this.applyPipCaptionSettings=()=>{const{pipModeVideo:e}=this.props,{enableCaptions:t,selectedLanguageCode:s}=this.state;e!=null&&e.showPipModeVideo?this.props.isPipMode({...e,enableCaptions:t,selectedLanguage:this.state.selectedLanguage,selectedLanguageCode:s}):setTimeout(()=>{e!=null&&e.enableCaptions&&(e!=null&&e.selectedLanguageCode)&&this.setState({enableCaptions:e.enableCaptions,selectedLanguage:e.selectedLanguage,selectedLanguageCode:e.selectedLanguageCode},()=>{this.updateCaptionTracks(e.selectedLanguageCode)})},500)},this.nativeVideoOnStart=e=>{var s,i;const{isStartEventFire:t}=this.state;v=e,!t&&e<1&&(this.setState({isStartEventFire:!0}),(i=(s=this==null?void 0:this.props)==null?void 0:s.handleVideoViewChallenge)==null||i.call(s,e)),e<1&&this.setVideoVariableToZero()},this.nativeVideoProgress=e=>{var t,s;if(e&&e.target&&e.target.currentTime){const i=e.target.currentTime;if(i<1){this.nativeVideoOnStart(i);return}const a=R;if(R=i,Math.abs(R-a-.25)>.5){v=R;return}if(v+M<=i){const o=Math.abs(i-v);v=i,(s=(t=this==null?void 0:this.props)==null?void 0:t.handleVideoViewChallenge)==null||s.call(t,o>0&&o<=M+1?o:0)}}},this.nativeVideoPause=e=>{var t,s;if(this.isAcceleventsOrWorkshopStreamProvider()&&e&&e.target&&e.target.currentTime){const i=e.target.currentTime,a=i-v;v=i,(s=(t=this==null?void 0:this.props)==null?void 0:t.handleVideoViewChallenge)==null||s.call(t,a>0&&a<=M?a:0),this.captureVideoAnalyticsProgress("pause",i-this.lastHttpSentTime),this.lastHttpSentTime=i}},this.nativeVideoSeek=e=>{var t,s;if(this.isAcceleventsOrWorkshopStreamProvider()){const i=e.target.currentTime;v=i,(s=(t=this==null?void 0:this.props)==null?void 0:t.handleVideoViewChallenge)==null||s.call(t,0),this.captureVideoAnalyticsProgress("seek",i-this.lastHttpSentTime),this.lastHttpSentTime=i}},this.nativeVideoEnd=e=>{var s,i;let t=0;v=0,e&&e.target&&e.target.currentTime&&(t=e.target.currentTime-v),this.setState({isStartEventFire:!1}),(i=(s=this==null?void 0:this.props)==null?void 0:s.handleVideoViewChallenge)==null||i.call(s,t>0&&t<=M+1?t:0),this.captureVideoAnalyticsProgress("end",e.target.currentTime-this.lastHttpSentTime),this.lastHttpSentTime=e.target.currentTime},this.videoPlay=()=>{var l,c,m;const{isFromWelcomeVideo:e,pipModeVideo:t,session:s,isHost:i,src:a}=this.props||{};let o={isPause:!1,showPopUp:!1};t&&(o={...o,playbackRate:t==null?void 0:t.playbackRate,volume:t==null?void 0:t.volume,muted:(c=(l=this.ref)==null?void 0:l.getInternalPlayer())==null?void 0:c.muted});const n=this.calculateVideoStartingSeconds();!i&&(this.isSessionLive()&&(s==null?void 0:s.streamProvider)==="DIRECT_UPLOAD"||(s==null?void 0:s.format)==="WORKSHOP"||a!=null&&a.includes(x))&&n>0&&((m=this==null?void 0:this.ref)==null||m.seekTo(n,"seconds")),this.setState(o),e&&this.props.onPlay()},this.videoPause=e=>{var i,a,o,n;const{isPipClose:t}=this.state,s=(a=(i=this==null?void 0:this.ref)==null?void 0:i.getInternalPlayer)==null?void 0:a.call(i);if(t&&(this.setState({isPipClose:!1}),s&&s.play()),this.isAcceleventsOrWorkshopStreamProvider()&&(this.setState({isPause:!0}),e&&e.target&&e.target.currentTime)){const l=Math.abs(e.target.currentTime-v);v=e.target.currentTime,(n=(o=this==null?void 0:this.props)==null?void 0:o.handleVideoViewChallenge)==null||n.call(o,l<=M&&l>0?l:0);const{duration:c,currentTime:m}=s||{};c>
1=m+1&&(this.captureVideoAnalyticsProgress("pause",e.target.currentTime-this.lastHttpSentTime),this.lastHttpSentTime=e.target.currentTime)}},this.getIsCaptionsEnabled=e=>{var a,o;const{pipModeVideo:t,session:s}=this.props,{enableCaptions:i}=t||{};return s.streamProvider==="DIRECT_UPLOAD"?L?s.enableVideoCaption&&e:e:i===void 0?!!((o=(a=this.props.session)==null?void 0:a.captions)!=null&&o.generatedSubtitles):i},this.getCurrentSelectedLanguage=(e,t)=>e==null?void 0:e.find(s=>(s==null?void 0:s.code)===t),this.videoStart=()=>{var c,m;const{selectedLanguageCode:e}=this.state,{streamProvider:t}=this.props.session,s=(c=this.ref)==null?void 0:c.getInternalPlayer(),i=((m=s==null?void 0:s.textTracks)==null?void 0:m.length)>0;let a=this.getIsCaptionsEnabled(i);t!=="DIRECT_UPLOAD"&&(this.applyPipCaptionSettings(),a=!0);const o=this.getLanguagesFromSessionData(this.props.session,a),n=o.length>0?o[0]:null,l=this.getCurrentSelectedLanguage(o,e);this.setState({isCaptionsAvailable:i,enableCaptions:a,selectedLanguage:(l==null?void 0:l.name)||(n==null?void 0:n.name)||null,selectedLanguageCode:(l==null?void 0:l.code)||(n==null?void 0:n.code)||null,isPause:!1},()=>{var p,u;this.setVideoVariableToZero(),(u=(p=this==null?void 0:this.props)==null?void 0:p.handleVideoViewChallenge)==null||u.call(p,0),i&&this.state.selectedLanguageCode&&this.updateCaptionTracks(this.state.selectedLanguageCode)})},this.videoSeek=e=>{var t,s;this.isAcceleventsOrWorkshopStreamProvider()&&(v=e,(s=(t=this==null?void 0:this.props)==null?void 0:t.handleVideoViewChallenge)==null||s.call(t,0),this.captureVideoAnalyticsProgress("seek",D-this.lastHttpSentTime,D),this.lastHttpSentTime=e)},this.addDurationInCoockie=e=>{const{session:t}=this.props||{},{streamUrl:s,format:i,sessionId:a}=t||{};(s||i==="WORKSHOP")&&e>1&&B.set(i==="WORKSHOP"?a:s,e+1||0,{expires:2})},this.isAcceleventsOrWorkshopStreamProvider=()=>{const{session:e}=this.props,{format:t,streamProvider:s}=e||{};return!L&&(s==="ACCELEVENTS"||t==="WORKSHOP")||s==="DIRECT_UPLOAD"},this.videoProgress=e=>{var s,i;const{isPause:t}=this.state;if(D=e==null?void 0:e.playedSeconds,this.addDurationInCoockie(e==null?void 0:e.playedSeconds),this.setState({progressObject:e}),this.isAcceleventsOrWorkshopStreamProvider()&&e.played===1){v=0;return}if(!t&&(D-this.lastHttpSentTime>M-.5&&(this.captureVideoAnalyticsProgress("playing",D-this.lastHttpSentTime),this.lastHttpSentTime=D),v+M<=e.playedSeconds)){const a=Math.abs(e.playedSeconds-v);v=e.playedSeconds,(i=(s=this==null?void 0:this.props)==null?void 0:s.handleVideoViewChallenge)==null||i.call(s,a<=M+1&&a>0?a:0)}},this.onEnded=()=>{var o,n;v=0,this.captureVideoAnalyticsProgress("end",D-this.lastHttpSentTime),this.lastHttpSentTime=D,typeof((o=this.props)==null?void 0:o.onEnded)=="function"&&((n=this.props)==null||n.onEnded());const{session:e,isWelcomeVideo:t,isBroadCastLive:s,isHost:i}=this.props||{},{streamUrl:a}=e||{};a&&(e==null?void 0:e.format)!=="WORKSHOP"?B.remove(a):(e==null?void 0:e.format)==="WORKSHOP"&&B.remove(e==null?void 0:e.sessionId),!t&&!i&&!L&&!s&&this.setState({showPopUp:!0})},this.captureVideoAnalyticsProgress=(e,t,s=0)=>{const{session:i,eventData:a,user:o,isSessionOrBroadcastLive:n,isHost:l}=this.props||{},{sessionId:c,streamProvider:m}=i||{},{eventId:p}=a||{},{userId:u}=o||{},P=n||K;let g=0;const{isSupportNative:S}=this.state;if(l)return;if(S){const V=document.getElementById("nativeVideo");V&&V.currentTime&&(g=V.currentTime)}else this.ref&&this.ref.getCurrentTime&&(g=this.ref.getCurrentTime());const T=w().utc().valueOf(),f=s||g;if(p&&u&&c&&f>0&&t>0&&t<=M+1){const V={uuid:Ge(),event:e,userId:u,eventId:p,sessionId:c,streamProvider:m,isSessionLive:P,date:w.utc().format("YYYY-MM-DDTHH:mm:ss"),time:T,videoCurrentTime:f,watchTime:t,measureName:"watchTime"};Ze(V)}},this.onEnablePIPMode=()=>{document.pictureInPictureElement&&document.exitPictureInPicture().then(()=>{this.handlePipMode(),this.setState({pip:!1,isPipClose:!0})}).catch(e=>console.error(e))},this.onDisablePIP=()=>{this.setState({pip:!1,isPipClose:!0},()=>{setTimeout(()=>{if(this.props.pipModeVideo){const{enableCaptions:e,selectedLanguage:t,selectedLanguageCode:s}=this.props.pipModeVideo;e&&s&&this.setState({enableCaptions:e,selectedLanguage:t,selectedLanguageCode:s}
1,()=>{const i=this.ref.getInternalPlayer();if(i!=null&&i.textTracks)for(let a=0;a<i.textTracks.length;a++){const o=i.textTracks[a];o.language===(s==null?void 0:s.replace("_","-"))?o.mode="showing":o.mode="disabled"}})}},300)})},this.isSessionEnded=()=>{const{session:e,eventData:t}=this.props,s=t&&t.equivalentTimezone||"US/Eastern";return I(e==null?void 0:e.endTime,s).diff(w(),"seconds")<=0},this.isSessionLive=()=>{const{session:e,eventData:t}=this.props,s=t&&t.equivalentTimezone||"US/Eastern",i=I(e==null?void 0:e.startTime,s),a=I(e==null?void 0:e.endTime,s),o=w();return o>=i&&o<=a},this.calculateVideoStartingSeconds=()=>{const{session:e,liveFrom:t,isHost:s,isFrom:i=null,eventData:a,isBroadCastLive:o,selectedPlayBack:n}=this.props,{streamUrl:l,format:c,sessionId:m}=e||{},p=a&&a.equivalentTimezone||"US/Eastern",u=w().diff(I(e==null?void 0:e.startTime,p),"seconds"),g=new Date().getTime()/1e3-t;let S=-1;const T=B.get(c==="WORKSHOP"?m==null?void 0:m.toString():l),f=T&&parseInt(T,10);return e.streamProvider==="DIRECT_UPLOAD"||!this.isSessionLive()&&e.streamProvider==="ACCELEVENTS"?s?S=-1:this.isSessionLive()&&o&&t>0&&g<(n==null?void 0:n.duration)?S=g:this.isSessionLive()&&u<(n==null?void 0:n.duration)?S=u:u>0&&f<(n==null?void 0:n.duration)&&(S=f):i==="LOBBY_STREAM"||i==="EXPO_STREAM"?S=t>0?t:-1:this.isSessionEnded()&&e.format==="WORKSHOP"&&f?S=parseInt(f,10):S=-1,S},this.playerPlayButtonCallBack=()=>{const{isSupportNative:e}=this.state;if(e){const t=document.getElementById("nativeVideo");t&&t.play(),this.setState({showPauseIcon:!0,showPopUp:!1})}else{const t=this.ref&&this.ref.getInternalPlayer();t&&t.play(),this.setState({showPauseIcon:!0,showPopUp:!1})}this.closePauseIcon()},this.closePauseIcon=()=>{setTimeout(()=>{this.setState({showPauseIcon:!1})},2e3)},this.playerPauseButtonCallBack=()=>{const{isSupportNative:e}=this.state;if(e){const t=document.getElementById("nativeVideo");t&&t.pause(),this.setState({showPopUp:!0})}else{const t=this.ref&&this.ref.getInternalPlayer();t&&t.pause(),this.setState({showPopUp:!0})}},this.getLiveDuration=(e,t)=>{const s=t<3600?w.utc(Math.ceil(e||0)*1e3).format("mm:ss"):w.utc(Math.ceil(e||0)*1e3).format("HH:mm:ss"),i=t<3600?w.utc(Math.ceil(t||0)*1e3).format("mm:ss"):w.utc(Math.ceil(t||0)*1e3).format("HH:mm:ss");return`${s} / ${i}`},this.onBuffer=()=>{this.setState({loading:!0})},this.onBufferEnd=()=>{this.setState({loading:!1})},this.video=null,this.lastHttpSentTime=0,this.state={showPopUp:!1,playing:!0,volume:1,muted:!1,isSupportNative:!1,pip:!1,isPipClose:!1,isPause:!1,isStartEventFire:!1,loading:!0,defaultPlayBackData:null,authorizedDomain:null,playbackRate:1,enableCaptions:!1,showDropdown:!1,isCaptionsAvailable:!1,progressObject:{},duration:0,selectedLanguage:null,selectedLanguageCode:null,showPauseIcon:!1,src:""},this.browser=it()}autoplayCheckAndVideoSeek(d,e,t,s,i,a,o){const{pipModeVideo:n,session:l}=this.props,{isPipModeVideo:c,currentTime:m,session:p}=n||{};let u;const P=w().diff(I(e,t||"US/Eastern"),"seconds");!i&&a==="DIRECT_UPLOAD"&&P>0&&s?u=0:!i&&a==="DIRECT_UPLOAD"&&P>0&&!s&&!o?u=P:u=0,d.currentTime=c&&(p==null?void 0:p.sessionId)===(l==null?void 0:l.sessionId)?m:u;const g=d.play();g!==void 0&&g.then(()=>{}).catch(()=>{this.setState({showPopUp:!0}),d.pause()})}muxMonitor(d,e=!1){const{session:t,user:s,eventData:i,eventDetails:a,isHost:o,onLoadingStop:n}=this.props,{userId:l}=s||{},{title:c,sessionId:m}=t,p=i&&i.equivalentTimezone||"US/Eastern",u=I(t&&t.startTime,p),P=I(t&&t.endTime,p),g=w(),S=g>=u&&g<=P;v=0,R=0,e&&this.setState({loading:!1},()=>{n&&n()}),this.setVideoVariableToZero(),De.monitor(d,{debug:be!=="production",hlsjs:this.hls,data:{env_key:Qe,viewer_user_id:l||"",sub_property_id:o?`${a==null?void 0:a.name}_${a==null?void 0:a.eventId}`:`${i==null?void 0:i.name}_${i==null?void 0:i.eventId}`,player_init_time:Date.now(),video_title:`${c}_${m}`,video_content_type:"event",video_stream_type:S?t.streamProvider==="DIRECT_UPLOAD"?"Direct Upload Live":"Live":"Recorded"}})}nativeVideoPlayer(){const{session:d,isSessionEnded:e,eventData:t,isBroadCastLive:s,isWelcomeVideo:i}=this.props,{src:a}=this.state,o=document.getElementById("nativeVideo"),n=t&&t.equivalentTimezone||"US/Eastern";o.src=a,o.addEventListener("loadeddata",()=>{this.autoplayCheckAndVideoSeek(o,d.startTime,n,s,e,d.streamProvider,i),this.muxMonitor(o,!0)}),o.addEventListener("timeupdate",this.nativeVideoProgress),o.addEventListener("pause",this.nativeVideoPause),o.addEventListener("seeked",this.nativeVideoSeek),o.addEventListener("ended",this.nativeVideoEnd)}componentDidMount(){var a;const{pipModeVideo:d,session:e,src:t,eventData:s}=this.props;this.setState({src:t},()=>
1{const{showPipModeVideo:o,session:n}=d||{};o?Me(n,e)||this.props.isPipMode({showPipModeVideo:!1}):setTimeout(()=>{this.handleVideoPlayType()},1e3);const l=(s==null?void 0:s.equivalentTimezone)||"US/Eastern",c=I(e==null?void 0:e.startTime,l),m=I(e==null?void 0:e.endTime,l),p=w();e!=null&&e.startTime&&(e!=null&&e.endTime)&&(K=p>=c&&p<=m)}),!this.props.isFromWelcomeVideo&&e&&this.getDetaultPlayback(e);const i=(a=this.ref)==null?void 0:a.getInternalPlayer();i&&(i!=null&&i.textTracks)&&Array.from(i==null?void 0:i.textTracks).some(n=>(n==null?void 0:n.mode)==="showing")&&!this.state.enableCaptions&&this.setState({enableCaptions:!0})}UNSAFE_componentWillReceiveProps(d){var s,i,a;const{pipModeVideo:e}=this.props,{src:t}=this.state;if(t!==d.src&&this.setState({src:d.src}),e&&d.pipModeVideo&&!Me(at(d,"pipModeVideo.showPipModeVideo"),e.showPipModeVideo)&&((s=d==null?void 0:d.pipModeVideo)!=null&&s.doNoltLoadPlayerAgain&&typeof((i=this.props)==null?void 0:i.onEnded)=="function"&&((a=this.props)==null||a.onEnded()),!d.pipModeVideo.showPipModeVideo)){const{enableCaptions:o,selectedLanguage:n,selectedLanguageCode:l}=d.pipModeVideo||{};this.setState({enableCaptions:o!==void 0?o:this.state.enableCaptions,selectedLanguage:n||this.state.selectedLanguage,selectedLanguageCode:l||this.state.selectedLanguageCode},()=>{this.handleVideoPlayType(),setTimeout(()=>{this.state.enableCaptions&&this.state.selectedLanguageCode&&this.updateCaptionTracks(this.state.selectedLanguageCode)},1e3)})}}componentWillUnmount(){this.hls&&this.hls.destroy()}componentDidUpdate(d){if(d.isWelcomeVideoOn!==this.props.isWelcomeVideoOn&&!this.props.isWelcomeVideoOn){const e=this.ref&&this.ref.getInternalPlayer("hls");e!=null&&e.startLoad&&typeof e.startLoad=="function"&&e.startLoad()}}render(){var ee,te,se,ie,ae,oe,ne,re,le,ce,de,he,pe,me,ue,fe,ge,ve,Se,Te,Pe,Ee,ye,Ce;let{src:d}=this.state;const{session:e,isBroadCastLive:t,streamUrl:s,isWelcomeVideo:i,pipModeVideo:a,isHost:o,isEventStream:n,disableLoading:l=!1,isWelcomeVideoOn:c,hasWelcomeVideo:m=!1,isWelcomeVideoPreview:p=!1,t:u,isFrom:P,eventDetails:g,eventData:S,selectedPlayBack:T}=this.props,{loading:f,authorizedDomain:V,showPopUp:O,volume:X,playbackRate:Re,muted:H,isSupportNative:W,isCaptionsAvailable:_e,enableCaptions:E,showDropdown:Ae,progressObject:k,duration:G,selectedLanguage:Z,showPauseIcon:J}=this.state,F=this.getLanguagesFromSessionData(e,E),Oe=h=>(h==null?void 0:h.length)===1?"caption-single":(h==null?void 0:h.length)>4?"caption-bigger":(h==null?void 0:h.length)>3?"caption-large":"caption-medium",{isPipModeVideo:Ue,showPipModeVideo:Q,currentTime:U,session:$}=a||{},z=(e==null?void 0:e.streamProvider)==="DIRECT_UPLOAD"?"":!f&&`https://image.cast.accelevents.com/${e.streamUrl}/thumbnail.png${e!=null&&e.thumbnailRestrictionToken?`?token=${e==null?void 0:e.thumbnailRestrictionToken}`:""}?time=${U}`,xe=this.calculateVideoStartingSeconds();e.startTime&&e.endTime&&(L=this.isSessionLive());const j={file:{hlsVersion:"1.5.15",hlsOptions:{enableWebVTT:!0,debug:be!=="production",startPosition:Ue&&($==null?void 0:$.sessionId)===(e==null?void 0:e.sessionId)?U:xe,autoStartLoad:m?i||!c:!0},attributes:{disablePictureInPicture:!0,poster:z,controlsList:"noplaybackrate nodownload",crossOrigin:"true"}}};n&&(L=n),d!=null&&d.includes(x)&&U>0&&(d=`${d}?t=${U||0}`);const Be=`e_${o?g==null?void 0:g.eventId:S==null?void 0:S.eventId}/s_${i?0:e==null?void 0:e.sessionId}/`;if(d!=null&&d.includes(x)&&(T!=null&&T.subTitleFileUrl)){const{subTitleFileUrl:h}=T||{};j.file.tracks=F.map(y=>{var A;return{kind:"subtitles",src:`${x}${Be}${h}`,srcLang:(A=y.code)==null?void 0:A.replace("_","-"),default:y.code===this.state.selectedLanguage,label:y.name}})}return r.createElement(r.Fragment,null,!l&&f&&L&&!Q&&r.createElement("div",{className:"player-loader"},r.createElement("div",{className:"text-center"},!i&&!o&&r.createElement(je,{type:"SpinnerMedium"}),V&&r.createElement(Le,{header:V,variant:"heading2",labelClass:"font-mob-24",color:"#fff",className:"justify-content-center"}))),r.createElement("div",{id:"react-player",className:"react-awesome-player-container video-custom"},!Q&&r.createElement(r.Fragment,null,W&&r.createElement("video",{ref:this.video,src:d,width:"100%",controls:i||!L&&!t||o,
1className:"react-player native",autoPlay:!0,muted:H,poster:z,playsInline:!0,id:"nativeVideo"}),d&&s&&!W&&r.createElement(Ve,{id:"NotSupportNative",url:d,width:"100%",loop:!1,poster:z,height:"100%",onStart:this.videoStart,onPause:this.videoPause,onPlay:this.videoPlay,onSeek:this.videoSeek,onProgress:this.videoProgress,onReady:h=>{this.onPlayerReady(h)},onEnded:this.onEnded,className:"react-player",playing:p?!1:this.state.playing,ref:h=>this.ref=h,playbackRate:Re,volume:X,muted:H,onError:(h,y,A,Ne)=>{console.log("Video player Error ",h,y),this.checkStreamAvailable(h,y,A,Ne)},onDuration:h=>this.setState({duration:h}),onDisablePIP:()=>this.onDisablePIP(),config:j,playsinline:!0,controls:i||o,onEnablePIP:h=>this.onEnablePIPMode(h),onContextMenu:h=>(h.preventDefault(),!1),onBuffer:h=>this.onBuffer(h),onBufferEnd:h=>this.onBufferEnd(h)}),(O||J)&&r.createElement(nt,{showOverlay:O||J,showPlayButton:O,playButtonCallBack:()=>this.playerPlayButtonCallBack(),pauseButtonCallBack:()=>this.playerPauseButtonCallBack(),overlayMessage:!1}),!i&&!o&&r.createElement("div",{className:"player"},r.createElement("div",{className:"custom-controls"},!L&&!t&&r.createElement("div",{className:"progress-slider"},r.createElement("div",{className:"progress-bar-seek-slider rc-slider bg-transparent"},r.createElement("div",{className:"progress-load-bar",style:{width:`${Math.min((k==null?void 0:k.loaded)*100,100)}%`}}),r.createElement(ot,{max:Math.ceil(G),defaultValue:0,value:Math.ceil(k==null?void 0:k.playedSeconds),onChange:h=>{var y;(y=this.ref)==null||y.seekTo(parseFloat(h),"seconds")}}))),r.createElement("div",{className:"d-flex justify-space-between"},r.createElement("div",{className:"player-play-speaker-control m-l-10"},r.createElement("div",{className:"player-new-icon"},O?r.createElement(b,{svgIcon:"player-pause-icon",width:24,height:24,viewBox:"0 0 24 24",fill:"white",onClick:()=>this.playerPlayButtonCallBack()}):r.createElement(b,{svgIcon:"player-play-icon",width:24,height:24,viewBox:"0 0 17 20",fill:"white",onClick:()=>this.playerPauseButtonCallBack()})),r.createElement("div",{className:"player-new-icon m-l-10",onClick:this.handleToggleMuted},H?r.createElement(b,{svgIcon:"player-speaker-mute-icon",width:16,height:16,viewBox:"0 0 22 22",fill:"white"}):r.createElement(b,{svgIcon:"player-speaker-icon",width:16,height:16,viewBox:"0 0 20 14",fill:"white"})),r.createElement("div",{className:"player-new-icon player-volume-slider"},r.createElement("input",{type:"range",className:"m-b-3 volume-slider",min:"0",max:"1",value:X,step:"0.01",onChange:this.handleVolumeChange})),!i&&!L&&!t&&!o&&r.createElement("div",{className:"player-new-icon m-l-10"},r.createElement(Le,{header:this.getLiveDuration(Math.ceil(k==null?void 0:k.playedSeconds),Math.ceil((T==null?void 0:T.duration)||G)),variant:"custom-captions",labelClass:"font-mob-24 m-b-0",color:"#fff",className:"justify-content-center"}))),r.createElement("div",{className:`player-play-speaker-control m-r-5 ${Oe(F)}`},!(P==="LOBBY_STREAM"||P==="EXPO_STREAM"||(e==null?void 0:e.streamProvider)==="DIRECT_UPLOAD")&&r.createElement("div",{className:"player-new-icon m-r-10"},r.createElement(N,{tooltip:u("Caption"),overlayProps:{placement:"top"}},r.createElement("div",null,r.createElement(b,{svgIcon:E?"player-cc-icon":"player-cc-icon-disable",onClick:()=>this.handleCaptionforNotDirectUpload(),viewBox:"0 0 20 16",fill:E?"#fff":(te=C[(ee=this.context)==null?void 0:ee.theme])==null?void 0:te.neutral400,color:E?"#fff":(ie=C[(se=this.context)==null?void 0:se.theme])==null?void 0:ie.neutral400})))),(e==null?void 0:e.streamProvider)==="DIRECT_UPLOAD"&&(this.getIsCaptionsEnabled(_e)?r.createElement(r.Fragment,null,r.createElement("div",{className:"player-new-icon m-r-10"},r.createElement(N,{tooltip:u(E?"Caption":"Closed Captioning"),overlayProps:{placement:"top"}},r.createElement("div",null,r.createElement(b,{svgIcon:E?"player-cc-icon":"player-cc-icon-disable",onClick:()=>
1this.handleCaption(),viewBox:"0 0 20 16",fill:E?(oe=C[(ae=this.context)==null?void 0:ae.theme])==null?void 0:oe.neutral0:(re=C[(ne=this.context)==null?void 0:ne.theme])==null?void 0:re.neutral400,color:E?(ce=C[(le=this.context)==null?void 0:le.theme])==null?void 0:ce.neutral0:(he=C[(de=this.context)==null?void 0:de.theme])==null?void 0:he.neutral400,style:{backgroundColor:E?"transparent":"#585858",borderRadius:"8px",paddingTop:"5px",paddingRight:"7px",paddingLeft:"7px",paddingBottom:"2px"}})))),this.state.showDropdown&&r.createElement(et,{pullRight:!0,bsSize:"sm",isShowCaret:!1,style:{position:"absolute",top:"-100%",right:0,zIndex:10,display:"none"},open:Ae,onToggle:this.closeDropdown,id:"caption-dropdown"},r.createElement(ke,{eventKey:"0",className:"close-captioning",onClick:()=>this.toggleCaptions(!this.state.enableCaptions)},r.createElement(b,{svgIcon:"player-cc-icon",viewBox:"0 0 20 16",fill:E?(me=C[(pe=this.context)==null?void 0:pe.theme])==null?void 0:me.neutral0:(fe=C[(ue=this.context)==null?void 0:ue.theme])==null?void 0:fe.neutral400,color:E?(ve=C[(ge=this.context)==null?void 0:ge.theme])==null?void 0:ve.neutral0:(Te=C[(Se=this.context)==null?void 0:Se.theme])==null?void 0:Te.neutral400}),"Close Captioning"),r.createElement("hr",{className:"m-t-0 m-b-0"}),F.map((h,y)=>r.createElement(ke,{key:y,eventKey:y+1,onClick:A=>{A.stopPropagation(),this.selectLanguage(h)}},Z===h.name&&E&&r.createElement(b,{svgIcon:"portal-caption-selected",height:16,width:12,viewBox:"0 0 20 16"}),r.createElement("span",{className:Z===h.name&&E?"m-l-0":"m-l-25"},h.name))))):r.createElement("div",{className:"player-new-icon m-r-10"},r.createElement(N,{tooltip:u("Captioning Unavailable"),overlayProps:{placement:"top"}},r.createElement("div",null,r.createElement(b,{svgIcon:"player-cc-icon-disable",viewBox:"0 0 20 16",fill:(Ee=C[(Pe=this.context)==null?void 0:Pe.theme])==null?void 0:Ee.neutral400,color:(Ce=C[(ye=this.context)==null?void 0:ye.theme])==null?void 0:Ce.neutral400}))))),r.createElement("div",{className:"player-new-icon m-r-10"},r.createElement(N,{tooltip:u("PIPMode"),overlayProps:{placement:"top"}},r.createElement("div",null,r.createElement(b,{svgIcon:"player-pip-icon",onClick:()=>this.handlePipMode(),width:16,height:16,viewBox:"0 0 20 16"}
1)))),r.createElement("div",{className:"m-r-10"},r.createElement("div",{className:"fullscreen"},r.createElement(tt,{fullscreenThis:W?"nativeVideo":"react-player",viewsPage:!1}))))))))))}};Y.contextType=Je;let q=Y;const rt={isPipMode:Fe,getDetaultPlayback:We},lt=_=>({user:Ye(_),eventData:qe(_)||we(_),eventDetails:we(_),pipModeVideo:Ke(_),isWelcomeVideoOn:ze(_)}),Tt=He(lt,rt)($e("tooltipMsg")(q));export{Tt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.