boss-web-player-sdk 1.1.76 → 1.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,t,u as r}from"./chunks/src-
|
|
1
|
+
import{c as e,t,u as r}from"./chunks/src-Bj9k6EMK.js";import{createContext as n,createElement as i,forwardRef as a,useCallback as s,useContext as o,useEffect as c,useMemo as l,useRef as u,useState as d}from"react";import{createPortal as m}from"react-dom";import{Fragment as p,jsx as h,jsxs as f}from"react/jsx-runtime";import{createRoot as k}from"react-dom/client";var b=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),g=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},y={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},v=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},T=n({}),w=a(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:a="",children:s,iconNode:c,...l},u)=>{const{size:d=24,strokeWidth:m=2,absoluteStrokeWidth:p=!1,color:h="currentColor",className:f=""}=o(T)??{},k=n??p?24*Number(r??m)/Number(t??d):r??m;return i("svg",{ref:u,...y,width:t??d??y.width,height:t??d??y.height,stroke:e??h,strokeWidth:k,className:b("lucide",f,a),...!s&&!v(l)&&{"aria-hidden":"true"},...l},[...c.map(([e,t])=>i(e,t)),...Array.isArray(s)?s:[s]])}),x=(e,t)=>{const r=a(({className:r,...n},a)=>{return i(w,{ref:a,iconNode:t,className:b(`lucide-${s=g(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n});var s});return r.displayName=g(e),r},S=x("airplay",[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]]),N=x("captions",[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]]),M=x("cast",[["path",{d:"M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",key:"3zrzxg"}],["path",{d:"M2 12a9 9 0 0 1 8 8",key:"g6cvee"}],["path",{d:"M2 16a5 5 0 0 1 4 4",key:"1y1dii"}],["line",{x1:"2",x2:"2.01",y1:"20",y2:"20",key:"xu2jvo"}]]),C=x("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),E=x("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),A=x("cloud-off",[["path",{d:"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057",key:"1uxyv8"}],["path",{d:"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78",key:"99tcn7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),P=x("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),L=x("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]),I=x("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]),$=x("list-video",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 19H3",key:"108z41"}],["path",{d:"M15 12.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997a1 1 0 0 1-1.517-.86z",key:"ms4nik"}]]),D=x("maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]),_=x("minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]),z=x("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]),R=x("picture-in-picture",[["path",{d:"M2 10h6V4",key:"zwrco"}],["path",{d:"m2 4 6 6",key:"ug085t"}],["path",{d:"M21 10V7a2 2 0 0 0-2-2h-7",key:"git5jr"}],["path",{d:"M3 14v2a2 2 0 0 0 2 2h3",key:"1f7fh3"}],["rect",{x:"12",y:"14",width:"10",height:"7",rx:"1",key:"1wjs3o"}]]),F=x("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),V=x("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),q=x("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),B=x("skip-forward",[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]),U=x("volume-1",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]]),j=x("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),H=x("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]),W=x("volume",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}]]);function K({offline:e=!1,title:t=(e?"No Internet Connection":"Something Went Wrong"),subtitle:r=(e?"Please check your network connection and try again.":"We encountered an error while playing this video.\nPlease try again."),onRetry:n,icon:i=(e?/* @__PURE__ */h(A,{size:36,color:"rgba(255,255,255,0.85)"}):void 0)}){/* @__PURE__ */
|
|
2
2
|
return f(p,{children:[
|
|
3
3
|
/* @__PURE__ */h("div",{style:{width:80,height:80,borderRadius:"50%",background:"rgba(255,255,255,0.08)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i??/* @__PURE__ */f("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"rgba(255,255,255,0.85)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[
|
|
4
4
|
/* @__PURE__ */h("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),
|
|
@@ -57,6 +57,6 @@ return f("div",{role:"button",tabIndex:0,className:"sdk-desktop-chapter-card"+(r
|
|
|
57
57
|
/* @__PURE__ */h("button",{className:"gb-pip-btn",onClick:()=>us(-10,"fast_backward"),"aria-label":"Rewind 10 seconds",disabled:ns,children:/* @__PURE__ */h(V,{size:20,"aria-hidden":"true"})}),
|
|
58
58
|
/* @__PURE__ */h("button",{className:"gb-pip-btn gb-pip-play",onClick:ss,"aria-label":tn?"Replay":Hs?"Pause":"Play",children:tn?/* @__PURE__ */h(V,{size:24,"aria-hidden":"true"}):Hs?/* @__PURE__ */h(z,{size:24,"aria-hidden":"true"}):/* @__PURE__ */h(F,{size:24,"aria-hidden":"true",style:{marginLeft:2}})}),
|
|
59
59
|
/* @__PURE__ */h("button",{className:"gb-pip-btn",onClick:()=>us(10,"fast_forward"),"aria-label":"Skip forward 10 seconds",disabled:ns,children:/* @__PURE__ */h(q,{size:20,"aria-hidden":"true"})})]}),
|
|
60
|
-
/* @__PURE__ */f("div",{className:"gb-pip-bottom",children:[/* @__PURE__ */h("div",{className:"gb-pip-progress",onClick:ys,onMouseDown:vs,children:/* @__PURE__ */h("div",{className:"gb-pip-progress-fill",style:{width:(t?(r??0)/t*100:0)+"%"}})}),/* @__PURE__ */h("div",{className:"gb-pip-time",children:null!==t?`${js(r??0)} / ${js(t)}`:"––:––"})]})]}),Zr.document.body)})()]})},ke="https://dev-api.go-boss.com";function be(e){return{"x-player-key":e,"Content-Type":"application/json"}}async function ge(e,t=ke,r={}){const n=await fetch(`${t}/api/player/sdk/init`,{method:"POST",headers:be(e),body:JSON.stringify({videoUrl:r.videoUrl})});if(!n.ok)throw new Error(`SDK init failed: ${n.status}`);return await n.json()}async function ye(e,t,r=ke){const{sessionId:n,videoId:i,videoTitle:a,videoUrl:s,contentDurationSec:o}=t,c=await fetch(`${r}/api/player/sdk/session/start`,{method:"POST",headers:be(e),body:JSON.stringify({sessionId:n,videoId:i,videoTitle:a,videoUrl:s,contentDurationSec:"number"==typeof o&&Number.isFinite(o)&&o>0?o:void 0})});if(!c.ok)throw new Error(`Session start failed: ${c.status}`)}async function ve(e,t,r,n,i=ke){const a={sessionId:t,currentTime:r,duration:n},s=await fetch(`${i}/api/player/sdk/session/heartbeat`,{method:"POST",headers:be(e),body:JSON.stringify(a)});if(!s.ok)throw new Error(`Heartbeat failed: ${s.status}`)}async function Te(e,t,r=0,n=0,i=ke){const a=await fetch(`${i}/api/player/sdk/session/end`,{method:"POST",headers:be(e),body:JSON.stringify({sessionId:t,currentTime:r,duration:n})});if(!a.ok)throw new Error(`Session end failed: ${a.status}`)}async function we(e,t,r=ke){const n=await fetch(`${r}/api/player/sdk/events`,{method:"POST",headers:be(e),body:JSON.stringify(t)});if(!n.ok)throw new Error(`Event ${t.eventType} failed: ${n.status}`)}function xe(e,t,r=0,n=0,i=ke){fetch(`${i}/api/player/sdk/session/end`,{method:"POST",headers:be(e),body:JSON.stringify({sessionId:t,currentTime:r,duration:n}),keepalive:!0})}function Se(){if("undefined"!=typeof screen)return screen.orientation?.type??void 0}var Ne=class{constructor(){this.autoplay=!1,this.keyMoments=[],this.isPlaybackActive=!1,this.hasFinished=!1,this.hasDismissed=!1,this.lastCurrentTime=0,this.lastDuration=0,this.lastWatchDuration=0,this.prevSpeed=1,this.pendingSeek=null}setDelegate(e){this.delegate=e}setAutoplay(e){this.autoplay=e}setKeyMoments(e){this.keyMoments=e}handleAnalyticsEvent(e){switch("number"!=typeof e.currentTime||Number.isNaN(e.currentTime)||(this.lastCurrentTime=e.currentTime),"number"!=typeof e.duration||Number.isNaN(e.duration)||(this.lastDuration=e.duration),"number"==typeof e.totalWatchTime&&(this.lastWatchDuration=e.totalWatchTime),e.eventType){case"play":this.isPlaybackActive?this.call("playerDidResumePlaying",e.currentTime):(this.isPlaybackActive=!0,this.hasFinished=!1,this.call("playerDidStartPlaying",e.currentTime,this.autoplay));break;case"pause":e.duration>0&&e.currentTime>=e.duration-.25||this.call("playerDidPause",e.currentTime);break;case"ended":this.isPlaybackActive=!1,this.hasFinished=!0,this.call("playerDidFinishPlaying",e.currentTime,e.totalWatchTime??this.lastWatchDuration);break;case"seek":this.beginSeek(e.seekFrom??this.lastCurrentTime,e.seekTo??e.currentTime);break;case"fast_forward":this.beginSeek(Math.max(0,e.currentTime-(e.skipSeconds??10)),e.currentTime);break;case"fast_backward":this.beginSeek(e.currentTime+(e.skipSeconds??10),e.currentTime);break;case"buffering_start":this.call("playerDidStartBuffering",e.currentTime);break;case"buffering_end":this.call("playerDidFinishBuffering",e.currentTime);break;case"quality_change":{const t=e.rendition;t&&t!==this.prevQuality&&(this.call("playerDidChangeQuality",this.prevQuality,t,e.isAutoSwitch??!1),this.prevQuality=t);break}case"subtitle_change":if(!1===e.subtitleEnabled)this.call("playerDidDisableSubtitle",this.prevSubtitle),this.prevSubtitle=void 0;else{const t=e.subtitleLanguage??"";this.call("playerDidChangeSubtitle",this.prevSubtitle,t),this.prevSubtitle=t}break;case"audio_track_change":{const t=e.audioTrack??"";this.call("playerDidChangeAudioTrack",this.prevAudioTrack,t),this.prevAudioTrack=t;break}case"speed_change":{const t=e.speed??1;t!==this.prevSpeed&&(this.call("playerDidChangePlaybackSpeed",this.prevSpeed,t),this.prevSpeed=t);break}case"fullscreen_enter":this.call("playerDidEnterFullscreen",Se());break;case"fullscreen_exit":this.call("playerDidExitFullscreen",Se());break;case"key_moments":{const t=e.momentTitle??"",r=e.momentTime??e.currentTime,n=this.keyMoments,i=n.findIndex(e=>t&&e.title===t||e.startTime===r),a=i>=0?n[i]:void 0;this.call("playerDidSelectKeyMoment",i>=0?String(i):void 0,a?.title??t,a?.startTime??r,a?.endTime??r);break}case"pip_toggle":(e.pipState?"entered"===e.pipState:"entered"===e.errorMessage)?this.call("playerDidEnterPictureInPicture",e.currentTime):this.call("playerDidExitPictureInPicture",e.currentTime);break;case"error":this.call("playerDidEncounterPlaybackError",null!=e.errorCode?String(e.errorCode):"PLAYER_ERROR",e.errorMessage??"Unknown player error",e.isRecoverable??!1);break;case"network_error":this.call("playerDidEncounterNetworkError",e.errorCode??0,e.errorMessage??"Network error",e.isRecoverable??!1)}}handleTimeUpdate(e){if(this.lastCurrentTime=e,this.pendingSeek){const{fromTime:t,startedWallMs:r}=this.pendingSeek;this.pendingSeek=null,this.call("playerDidFinishSeeking",t,e,(Date.now()-r)/1e3)}this.call("playerDidUpdateCurrentTime",e,this.lastDuration)}notifyDismissed(){this.hasDismissed||!this.isPlaybackActive||this.hasFinished||(this.hasDismissed=!0,this.call("playerDidDismiss",this.lastCurrentTime,this.lastWatchDuration))}beginSeek(e,t){this.pendingSeek?this.pendingSeek.toTime=t:(this.pendingSeek={fromTime:e,toTime:t,startedWallMs:Date.now()},this.call("playerDidStartSeeking",e))}call(e,...t){const r=this.delegate,n=r?.[e];if("function"==typeof n)try{n.apply(r,t)}catch(i){}}},Me={subtitles:"subtitle_support",ads:"ad_support",chapterMarkers:"key_moments",playbackSpeed:"playback_speed",airplay:"airplay",chromecast:"chromecast",pictureInPicture:"picture_in_picture",multipleResolution:"multiple_resolution",multipleAudio:"multiple_audio",drmProtection:"drm_protection",screenRecordingPrevention:"screen_recording_prevention",signalStrength:"signal_strength"};function Ce(e){const t={m3u8_playback:!0,subtitle_support:!1,playback_speed:!1,airplay:!1,chromecast:!1,picture_in_picture:!1,multiple_resolution:!1,multiple_audio:!1,key_moments:!1,drm_protection:!1,screen_recording_prevention:!1,signal_strength:!1,ad_support:!1};for(const[r,n]of Object.entries(Me))r in e&&(t[n]=e[r]);return t}function Ee({playerKey:e,src:t,subtitles:r,licenseKey:n,themeColor:i="#6366f1",firebaseConfig:a,proxyDomains:o,apiBaseUrl:m,adTrackingUrl:p,overlayAdUrl:k,videoId:b,title:g,artworkUrl:y,watermark:v,autoplay:T=!1,muted:w=!1,autoFullscreen:x=!1,enableControls:S=!0,enableSkipAd:N,skipAdAfterSeconds:M,chaptersDisplayMode:C="strip",volumeControlType:E="slider",subtitleStyle:A,drmConfig:P,onAnalyticsEvent:L,delegate:I,onKeyMomentsLoaded:$,initialTime:D,onTimeUpdate:_,introStartTime:z,introEndTime:R,hasNextEpisode:F,outroStartTime:V,nextEpisodeLabel:q,onNextEpisode:B,nextEpisodeAutoAdvanceSeconds:U,nextEpisodeThumbnailUrl:j,featureOverrides:H,enableQuality:W,enableSources:O=!1}){const[X,Q]=d([]),[J,G]=d(0),[Y]=d(()=>new Ne);c(()=>{Y.setDelegate(I),Y.setAutoplay(T)},[Y,I,T]),c(()=>()=>Y.notifyDismissed(),[Y]);const Z=Array.isArray(t)?t:[{label:"Default",url:t}],ee=Z[J]?.url??Z[0]?.url??"",[te,re]=d("loading"),[ne,ie]=d(null),[ae,se]=d(0),[oe,ce]=d("network"),le=u(null),ue=u(!1),de=u(""),me=u(!1),pe=u(!1),he=u(void 0),ke=u(!1),be=u(3e4),Se=u(null),Ee=u(0),Ae=u(null),Pe=u({currentTime:0,duration:0}),Le=u(()=>{}),Ie=ee.split("/").filter(Boolean),$e=b||(Ie[Ie.length-1]??"").replace(/\.m3u8.*$/,"")||"video",De=u(ee);c(()=>{De.current=ee},[ee]);const _e=s(()=>function(e){if(!e)return e=>e;const t=[];for(const r of e.split(",")){const[e,n]=r.split("=");e?.trim()&&n?.trim()&&t.push({domain:e.trim(),proxyPath:n.trim()})}return e=>{for(const{domain:r,proxyPath:n}of t)if(e.includes(r))try{const t=new URL(e);return`${n}${t.pathname}${t.search}`}catch{return e.replace(`https://${r}`,n)}return e}}(o),[o])(),ze=function(e){const t=e.replace("#","");return 6!==t.length?"99, 102, 241":`${parseInt(t.substring(0,2),16)}, ${parseInt(t.substring(2,4),16)}, ${parseInt(t.substring(4,6),16)}`}(i);c(()=>{document.documentElement.style.setProperty("--accent-indigo",i),document.documentElement.style.setProperty("--accent-indigo-rgb",ze)},[i,ze]),c(()=>{let t=!1;return ge(e,m,{videoUrl:De.current}).then(e=>{if(t)return;le.current=e;const{features:r,planTier:n,heartbeatIntervalSeconds:i}=e.result.data;be.current="number"==typeof i&&i>0?1e3*i:3e4;const a={package:n,is_active:!0,features:Ce(r),limits:{streaming_minutes:0}};ie(a),re("ready")}).catch(e=>{if(t)return;const r=e.message??"";ce(/init failed: 4\d\d/.test(r)?"auth":"network"),re("error")}),()=>{t=!0,Se.current&&(clearTimeout(Se.current),Se.current=null),Ee.current=0,Ae.current=null,re("loading"),ie(null),me.current=!1,de.current="",pe.current=!1,he.current=void 0}},[e,m,ae]);const Re=s(()=>{Se.current&&(clearTimeout(Se.current),Se.current=null,null!==Ae.current&&(Ee.current+=Date.now()-Ae.current,Ae.current=null))},[]),Fe=s(()=>{Se.current&&(clearTimeout(Se.current),Se.current=null),Ee.current=0,Ae.current=null},[]),Ve=s(()=>{if(Se.current||!de.current)return;Ae.current=Date.now();const t=be.current-Ee.current;Se.current=setTimeout(()=>{Se.current=null,Ee.current=0,Ae.current=null;const{currentTime:t,duration:r}=Pe.current;ve(e,de.current,t,r,m).catch(e=>{}),Le.current()},t)},[e,m]);c(()=>{Le.current=Ve},[Ve]);const qe=u(!0);c(()=>{qe.current?qe.current=!1:(ke.current=!0,he.current=void 0,Re())},[J,Re]),c(()=>{const t=()=>{if(Y.notifyDismissed(),!de.current||pe.current)return;pe.current=!0,Fe();const{currentTime:t,duration:r}=Pe.current;xe(e,de.current,t,r,m)};return window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t),()=>{if(window.removeEventListener("beforeunload",t),window.removeEventListener("pagehide",t),de.current&&!pe.current){pe.current=!0,Fe();const{currentTime:t,duration:r}=Pe.current;xe(e,de.current,t,r,m)}else Fe()}},[e,m,Fe,Y]);const Be=s(t=>{const r=t;if(void 0!==t.currentTime&&(Pe.current={currentTime:t.currentTime,duration:t.duration}),"session_start"!==t.eventType||me.current||(me.current=!0,pe.current=!1,de.current="string"==typeof r.sessionId?r.sessionId:"",ye(e,{sessionId:de.current,videoId:$e,videoTitle:g,videoUrl:De.current,contentDurationSec:t.duration},m).catch(e=>{}),ue.current||Ve()),"play"!==t.eventType||!me.current||ue.current||ke.current||Ve(),"pause"===t.eventType&&Re(),"buffering_start"===t.eventType&&Re(),"buffering_end"===t.eventType&&me.current&&!ue.current&&(ke.current=!1,Ve()),"ended"===t.eventType&&(Fe(),de.current)){pe.current=!0;const{currentTime:t,duration:r}=Pe.current;Te(e,de.current,t,r,m).catch(e=>{})}if(me.current&&de.current&&!pe.current){const r=function(e,t){switch(e.eventType){case"pause":return{eventType:"pause",extras:{}};case"seek":return{eventType:"seek",extras:{seekFrom:e.seekFrom??0,seekTo:e.seekTo??e.currentTime??0}};case"mute":return{eventType:"mute",extras:{isMuted:e.isMuted??!0}};case"fast_forward":return{eventType:"fast_forward",extras:{skipSeconds:e.skipSeconds??10}};case"fast_backward":return{eventType:"fast_backward",extras:{skipSeconds:e.skipSeconds??10}};case"key_moments":return{eventType:"key_moments",extras:{momentTitle:e.momentTitle??"",momentTime:e.momentTime??0}};case"buffering_start":return{eventType:"buffering_start",extras:{bufferingCount:e.bufferingCount??0}};case"buffering_end":return{eventType:"buffering_end",extras:{}};case"quality_change":return t&&e.rendition&&t!==e.rendition?{eventType:"quality_change",extras:{from:t,to:e.rendition}}:null;case"speed_change":return{eventType:"speed_change",extras:{speed:e.speed??1}};case"subtitle_change":return!1===e.subtitleEnabled?{eventType:"subtitle_disable",extras:{enabled:!1}}:{eventType:"subtitle_change",extras:{language:e.subtitleLanguage??"",enabled:!0}};case"audio_track_change":return{eventType:"audio_track_change",extras:{track:e.audioTrack??""}};case"pip_toggle":return{eventType:"pip_toggle",extras:{enabled:"entered"===e.errorMessage}};case"fullscreen_enter":return{eventType:"fullscreen_toggle",extras:{enabled:!0}};case"fullscreen_exit":return{eventType:"fullscreen_toggle",extras:{enabled:!1}};case"error":return{eventType:"player_error",extras:{code:null!=e.errorCode?String(e.errorCode):"PLAYER_ERROR",message:e.errorMessage??"Unknown player error"}};case"network_error":return{eventType:"network_error",extras:{code:e.errorCode?String(e.errorCode):"NETWORK_ERROR",message:e.errorMessage??"Network error"}};default:return null}}(t,he.current);r&&we(e,{eventType:r.eventType,sessionId:de.current,currentTime:t.currentTime??0,videoId:$e,videoTitle:g,...r.extras},m).catch(e=>{})}"quality_change"===t.eventType&&t.rendition&&(he.current=t.rendition),Y.handleAnalyticsEvent(t),L?.(t)},[e,m,$e,g,Ve,Re,Fe,L,Y]),Ue=s(e=>{ue.current=e,e?Re():me.current&&Ve()},[Re,Ve]),je=s(e=>{Y.setKeyMoments(e),Q(e),$?.(e)},[$,Y]),He=s(e=>{Pe.current={...Pe.current,currentTime:e},Y.handleTimeUpdate(e),_?.(e)},[_,Y]),We=s(()=>{if(de.current&&!pe.current){pe.current=!0,Fe();const{currentTime:t,duration:r}=Pe.current,n=de.current;de.current="",me.current=!1,Te(e,n,t,r,m).catch(e=>{})}else Fe();B?.()},[B,e,m,Fe]),Ke=l(()=>{if(!ne||!H)return ne;const e={...ne.features};for(const[t,r]of Object.entries(H)){const n=Me[t];n&&(e[n]=e[n]&&!1!==r)}return{...ne,features:e}},[ne,H]);if("loading"===te)/* @__PURE__ */return f("div",{style:{width:"100%",aspectRatio:"16 / 9",background:"#000",borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */h("style",{children:"@keyframes boss-sdk-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */h("div",{style:{width:60,height:60,borderRadius:"50%",border:`4px solid rgba(${ze}, 0.1)`,borderLeftColor:i,borderRightColor:`rgba(${ze}, 0.2)`,filter:`drop-shadow(0 0 10px rgba(${ze}, 0.5))`,animation:"boss-sdk-spin 1s linear infinite"}})]});if("error"===te){const e="auth"===oe;/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */f("div",{className:"gb-pip-bottom",children:[/* @__PURE__ */h("div",{className:"gb-pip-progress",onClick:ys,onMouseDown:vs,children:/* @__PURE__ */h("div",{className:"gb-pip-progress-fill",style:{width:(t?(r??0)/t*100:0)+"%"}})}),/* @__PURE__ */h("div",{className:"gb-pip-time",children:null!==t?`${js(r??0)} / ${js(t)}`:"––:––"})]})]}),Zr.document.body)})()]})},ke="https://dev-api.go-boss.com";function be(e){return{"x-player-key":e,"Content-Type":"application/json"}}async function ge(e,t=ke,r={}){const n=await fetch(`${t}/api/player/sdk/init`,{method:"POST",headers:be(e),body:JSON.stringify({videoUrl:r.videoUrl})});if(!n.ok)throw new Error(`SDK init failed: ${n.status}`);return await n.json()}async function ye(e,t,r=ke){const{sessionId:n,videoId:i,videoTitle:a,videoUrl:s,contentDurationSec:o}=t,c=await fetch(`${r}/api/player/sdk/session/start`,{method:"POST",headers:be(e),body:JSON.stringify({sessionId:n,videoId:i,videoTitle:a,videoUrl:s,contentDurationSec:"number"==typeof o&&Number.isFinite(o)&&o>0?o:void 0})});if(!c.ok)throw new Error(`Session start failed: ${c.status}`)}async function ve(e,t,r,n,i=ke){const a={sessionId:t,currentTime:r,duration:n},s=await fetch(`${i}/api/player/sdk/session/heartbeat`,{method:"POST",headers:be(e),body:JSON.stringify(a)});if(!s.ok)throw new Error(`Heartbeat failed: ${s.status}`)}async function Te(e,t,r=0,n=0,i=ke){const a=await fetch(`${i}/api/player/sdk/session/end`,{method:"POST",headers:be(e),body:JSON.stringify({sessionId:t,currentTime:r,duration:n})});if(!a.ok)throw new Error(`Session end failed: ${a.status}`)}async function we(e,t,r=ke){const n=await fetch(`${r}/api/player/sdk/events`,{method:"POST",headers:be(e),body:JSON.stringify(t)});if(!n.ok)throw new Error(`Event ${t.eventType} failed: ${n.status}`)}var xe=null;function Se(e,t,r=0,n=0,i=ke){const a=`${i}/api/player/sdk/session/end`,s=JSON.stringify({sessionId:t,currentTime:r,duration:n});if(function(){if(null===xe)try{xe="keepalive"in new Request(ke)}catch{xe=!1}return xe}())fetch(a,{method:"POST",headers:be(e),body:s,keepalive:!0}).catch(()=>{});else try{const t=new XMLHttpRequest;t.open("POST",a,!1),t.setRequestHeader("x-player-key",e),t.setRequestHeader("Content-Type","application/json"),t.send(s)}catch{}}function Ne(){if("undefined"!=typeof screen)return screen.orientation?.type??void 0}var Me=class{constructor(){this.autoplay=!1,this.keyMoments=[],this.isPlaybackActive=!1,this.hasFinished=!1,this.hasDismissed=!1,this.lastCurrentTime=0,this.lastDuration=0,this.lastWatchDuration=0,this.prevSpeed=1,this.pendingSeek=null}setDelegate(e){this.delegate=e}setAutoplay(e){this.autoplay=e}setKeyMoments(e){this.keyMoments=e}handleAnalyticsEvent(e){switch("number"!=typeof e.currentTime||Number.isNaN(e.currentTime)||(this.lastCurrentTime=e.currentTime),"number"!=typeof e.duration||Number.isNaN(e.duration)||(this.lastDuration=e.duration),"number"==typeof e.totalWatchTime&&(this.lastWatchDuration=e.totalWatchTime),e.eventType){case"play":this.isPlaybackActive?this.call("playerDidResumePlaying",e.currentTime):(this.isPlaybackActive=!0,this.hasFinished=!1,this.call("playerDidStartPlaying",e.currentTime,this.autoplay));break;case"pause":e.duration>0&&e.currentTime>=e.duration-.25||this.call("playerDidPause",e.currentTime);break;case"ended":this.isPlaybackActive=!1,this.hasFinished=!0,this.call("playerDidFinishPlaying",e.currentTime,e.totalWatchTime??this.lastWatchDuration);break;case"seek":this.beginSeek(e.seekFrom??this.lastCurrentTime,e.seekTo??e.currentTime);break;case"fast_forward":this.beginSeek(Math.max(0,e.currentTime-(e.skipSeconds??10)),e.currentTime);break;case"fast_backward":this.beginSeek(e.currentTime+(e.skipSeconds??10),e.currentTime);break;case"buffering_start":this.call("playerDidStartBuffering",e.currentTime);break;case"buffering_end":this.call("playerDidFinishBuffering",e.currentTime);break;case"quality_change":{const t=e.rendition;t&&t!==this.prevQuality&&(this.call("playerDidChangeQuality",this.prevQuality,t,e.isAutoSwitch??!1),this.prevQuality=t);break}case"subtitle_change":if(!1===e.subtitleEnabled)this.call("playerDidDisableSubtitle",this.prevSubtitle),this.prevSubtitle=void 0;else{const t=e.subtitleLanguage??"";this.call("playerDidChangeSubtitle",this.prevSubtitle,t),this.prevSubtitle=t}break;case"audio_track_change":{const t=e.audioTrack??"";this.call("playerDidChangeAudioTrack",this.prevAudioTrack,t),this.prevAudioTrack=t;break}case"speed_change":{const t=e.speed??1;t!==this.prevSpeed&&(this.call("playerDidChangePlaybackSpeed",this.prevSpeed,t),this.prevSpeed=t);break}case"fullscreen_enter":this.call("playerDidEnterFullscreen",Ne());break;case"fullscreen_exit":this.call("playerDidExitFullscreen",Ne());break;case"key_moments":{const t=e.momentTitle??"",r=e.momentTime??e.currentTime,n=this.keyMoments,i=n.findIndex(e=>t&&e.title===t||e.startTime===r),a=i>=0?n[i]:void 0;this.call("playerDidSelectKeyMoment",i>=0?String(i):void 0,a?.title??t,a?.startTime??r,a?.endTime??r);break}case"pip_toggle":(e.pipState?"entered"===e.pipState:"entered"===e.errorMessage)?this.call("playerDidEnterPictureInPicture",e.currentTime):this.call("playerDidExitPictureInPicture",e.currentTime);break;case"error":this.call("playerDidEncounterPlaybackError",null!=e.errorCode?String(e.errorCode):"PLAYER_ERROR",e.errorMessage??"Unknown player error",e.isRecoverable??!1);break;case"network_error":this.call("playerDidEncounterNetworkError",e.errorCode??0,e.errorMessage??"Network error",e.isRecoverable??!1)}}handleTimeUpdate(e){if(this.lastCurrentTime=e,this.pendingSeek){const{fromTime:t,startedWallMs:r}=this.pendingSeek;this.pendingSeek=null,this.call("playerDidFinishSeeking",t,e,(Date.now()-r)/1e3)}this.call("playerDidUpdateCurrentTime",e,this.lastDuration)}notifyDismissed(){this.hasDismissed||!this.isPlaybackActive||this.hasFinished||(this.hasDismissed=!0,this.call("playerDidDismiss",this.lastCurrentTime,this.lastWatchDuration))}beginSeek(e,t){this.pendingSeek?this.pendingSeek.toTime=t:(this.pendingSeek={fromTime:e,toTime:t,startedWallMs:Date.now()},this.call("playerDidStartSeeking",e))}call(e,...t){const r=this.delegate,n=r?.[e];if("function"==typeof n)try{n.apply(r,t)}catch(i){}}},Ce={subtitles:"subtitle_support",ads:"ad_support",chapterMarkers:"key_moments",playbackSpeed:"playback_speed",airplay:"airplay",chromecast:"chromecast",pictureInPicture:"picture_in_picture",multipleResolution:"multiple_resolution",multipleAudio:"multiple_audio",drmProtection:"drm_protection",screenRecordingPrevention:"screen_recording_prevention",signalStrength:"signal_strength"};function Ee(e){const t={m3u8_playback:!0,subtitle_support:!1,playback_speed:!1,airplay:!1,chromecast:!1,picture_in_picture:!1,multiple_resolution:!1,multiple_audio:!1,key_moments:!1,drm_protection:!1,screen_recording_prevention:!1,signal_strength:!1,ad_support:!1};for(const[r,n]of Object.entries(Ce))r in e&&(t[n]=e[r]);return t}function Ae({playerKey:e,src:t,subtitles:r,licenseKey:n,themeColor:i="#6366f1",firebaseConfig:a,proxyDomains:o,apiBaseUrl:m,adTrackingUrl:p,overlayAdUrl:k,videoId:b,title:g,artworkUrl:y,watermark:v,autoplay:T=!1,muted:w=!1,autoFullscreen:x=!1,enableControls:S=!0,enableSkipAd:N,skipAdAfterSeconds:M,chaptersDisplayMode:C="strip",volumeControlType:E="slider",subtitleStyle:A,drmConfig:P,onAnalyticsEvent:L,delegate:I,onKeyMomentsLoaded:$,initialTime:D,onTimeUpdate:_,introStartTime:z,introEndTime:R,hasNextEpisode:F,outroStartTime:V,nextEpisodeLabel:q,onNextEpisode:B,nextEpisodeAutoAdvanceSeconds:U,nextEpisodeThumbnailUrl:j,featureOverrides:H,enableQuality:W,enableSources:O=!1}){const[X,Q]=d([]),[J,G]=d(0),[Y]=d(()=>new Me);c(()=>{Y.setDelegate(I),Y.setAutoplay(T)},[Y,I,T]),c(()=>()=>Y.notifyDismissed(),[Y]);const Z=Array.isArray(t)?t:[{label:"Default",url:t}],ee=Z[J]?.url??Z[0]?.url??"",[te,re]=d("loading"),[ne,ie]=d(null),[ae,se]=d(0),[oe,ce]=d("network"),le=u(null),ue=u(!1),de=u(""),me=u(!1),pe=u(!1),he=u(null),ke=u(!1),be=u(void 0),xe=u(!1),Ne=u(3e4),Ae=u(null),Pe=u(0),Le=u(null),Ie=u({currentTime:0,duration:0}),$e=u(()=>{}),De=ee.split("/").filter(Boolean),_e=b||(De[De.length-1]??"").replace(/\.m3u8.*$/,"")||"video",ze=u(ee);c(()=>{ze.current=ee},[ee]);const Re=s(()=>function(e){if(!e)return e=>e;const t=[];for(const r of e.split(",")){const[e,n]=r.split("=");e?.trim()&&n?.trim()&&t.push({domain:e.trim(),proxyPath:n.trim()})}return e=>{for(const{domain:r,proxyPath:n}of t)if(e.includes(r))try{const t=new URL(e);return`${n}${t.pathname}${t.search}`}catch{return e.replace(`https://${r}`,n)}return e}}(o),[o])(),Fe=function(e){const t=e.replace("#","");return 6!==t.length?"99, 102, 241":`${parseInt(t.substring(0,2),16)}, ${parseInt(t.substring(2,4),16)}, ${parseInt(t.substring(4,6),16)}`}(i);c(()=>{document.documentElement.style.setProperty("--accent-indigo",i),document.documentElement.style.setProperty("--accent-indigo-rgb",Fe)},[i,Fe]),c(()=>{let t=!1;return ge(e,m,{videoUrl:ze.current}).then(e=>{if(t)return;le.current=e;const{features:r,planTier:n,heartbeatIntervalSeconds:i}=e.result.data;Ne.current="number"==typeof i&&i>0?1e3*i:3e4;const a={package:n,is_active:!0,features:Ee(r),limits:{streaming_minutes:0}};ie(a),re("ready")}).catch(e=>{if(t)return;const r=e.message??"";ce(/init failed: 4\d\d/.test(r)?"auth":"network"),re("error")}),()=>{t=!0,Ae.current&&(clearTimeout(Ae.current),Ae.current=null),Pe.current=0,Le.current=null,re("loading"),ie(null),me.current=!1,de.current="",pe.current=!1,he.current=null,ke.current=!1,be.current=void 0}},[e,m,ae]);const Ve=s(e=>{const t=he.current;return t?t.then(()=>{if(!ke.current)return e()}):e()},[]),qe=s(()=>{Ae.current&&(clearTimeout(Ae.current),Ae.current=null,null!==Le.current&&(Pe.current+=Date.now()-Le.current,Le.current=null))},[]),Be=s(()=>{Ae.current&&(clearTimeout(Ae.current),Ae.current=null),Pe.current=0,Le.current=null},[]),Ue=s(()=>{if(Ae.current||!de.current)return;Le.current=Date.now();const t=Ne.current-Pe.current;Ae.current=setTimeout(()=>{Ae.current=null,Pe.current=0,Le.current=null;const{currentTime:t,duration:r}=Ie.current,n=de.current;Ve(()=>ve(e,n,t,r,m)).catch(e=>{}),$e.current()},t)},[e,m,Ve]);c(()=>{$e.current=Ue},[Ue]);const je=u(!0);c(()=>{je.current?je.current=!1:(xe.current=!0,be.current=void 0,qe())},[J,qe]),c(()=>{const t=()=>{if(Y.notifyDismissed(),!de.current||pe.current)return;pe.current=!0,Be();const{currentTime:t,duration:r}=Ie.current;Se(e,de.current,t,r,m)};return window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t),()=>{if(window.removeEventListener("beforeunload",t),window.removeEventListener("pagehide",t),de.current&&!pe.current){pe.current=!0,Be();const{currentTime:t,duration:r}=Ie.current;Se(e,de.current,t,r,m)}else Be()}},[e,m,Be,Y]);const He=s(t=>{const r=t;if(void 0!==t.currentTime&&(Ie.current={currentTime:t.currentTime,duration:t.duration}),"session_start"!==t.eventType||me.current||(me.current=!0,pe.current=!1,de.current="string"==typeof r.sessionId?r.sessionId:"",ke.current=!1,he.current=ye(e,{sessionId:de.current,videoId:_e,videoTitle:g,videoUrl:ze.current,contentDurationSec:t.duration},m).catch(e=>{ke.current=!0}),ue.current||Ue()),"play"!==t.eventType||!me.current||ue.current||xe.current||Ue(),"pause"===t.eventType&&qe(),"buffering_start"===t.eventType&&qe(),"buffering_end"===t.eventType&&me.current&&!ue.current&&(xe.current=!1,Ue()),"ended"===t.eventType&&(Be(),de.current)){pe.current=!0;const{currentTime:t,duration:r}=Ie.current,n=de.current;Ve(()=>Te(e,n,t,r,m)).catch(e=>{})}if(me.current&&de.current&&!pe.current){const r=function(e,t){switch(e.eventType){case"pause":return{eventType:"pause",extras:{}};case"seek":return{eventType:"seek",extras:{seekFrom:e.seekFrom??0,seekTo:e.seekTo??e.currentTime??0}};case"mute":return{eventType:"mute",extras:{isMuted:e.isMuted??!0}};case"fast_forward":return{eventType:"fast_forward",extras:{skipSeconds:e.skipSeconds??10}};case"fast_backward":return{eventType:"fast_backward",extras:{skipSeconds:e.skipSeconds??10}};case"key_moments":return{eventType:"key_moments",extras:{momentTitle:e.momentTitle??"",momentTime:e.momentTime??0}};case"buffering_start":return{eventType:"buffering_start",extras:{bufferingCount:e.bufferingCount??0}};case"buffering_end":return{eventType:"buffering_end",extras:{}};case"quality_change":return t&&e.rendition&&t!==e.rendition?{eventType:"quality_change",extras:{from:t,to:e.rendition}}:null;case"speed_change":return{eventType:"speed_change",extras:{speed:e.speed??1}};case"subtitle_change":return!1===e.subtitleEnabled?{eventType:"subtitle_disable",extras:{enabled:!1}}:{eventType:"subtitle_change",extras:{language:e.subtitleLanguage??"",enabled:!0}};case"audio_track_change":return{eventType:"audio_track_change",extras:{track:e.audioTrack??""}};case"pip_toggle":return{eventType:"pip_toggle",extras:{enabled:"entered"===e.errorMessage}};case"fullscreen_enter":return{eventType:"fullscreen_toggle",extras:{enabled:!0}};case"fullscreen_exit":return{eventType:"fullscreen_toggle",extras:{enabled:!1}};case"error":return{eventType:"player_error",extras:{code:null!=e.errorCode?String(e.errorCode):"PLAYER_ERROR",message:e.errorMessage??"Unknown player error"}};case"network_error":return{eventType:"network_error",extras:{code:e.errorCode?String(e.errorCode):"NETWORK_ERROR",message:e.errorMessage??"Network error"}};default:return null}}(t,be.current);if(r){const n={eventType:r.eventType,sessionId:de.current,currentTime:t.currentTime??0,videoId:_e,videoTitle:g,...r.extras};Ve(()=>we(e,n,m)).catch(e=>{})}}"quality_change"===t.eventType&&t.rendition&&(be.current=t.rendition),Y.handleAnalyticsEvent(t),L?.(t)},[e,m,_e,g,Ue,qe,Be,L,Y,Ve]),We=s(e=>{ue.current=e,e?qe():me.current&&Ue()},[qe,Ue]),Ke=s(e=>{Y.setKeyMoments(e),Q(e),$?.(e)},[$,Y]),Oe=s(e=>{Ie.current={...Ie.current,currentTime:e},Y.handleTimeUpdate(e),_?.(e)},[_,Y]),Xe=s(()=>{if(de.current&&!pe.current){pe.current=!0,Be();const{currentTime:t,duration:r}=Ie.current,n=de.current;de.current="",me.current=!1,Ve(()=>Te(e,n,t,r,m)).catch(e=>{})}else Be();B?.()},[B,e,m,Be,Ve]),Qe=l(()=>{if(!ne||!H)return ne;const e={...ne.features};for(const[t,r]of Object.entries(H)){const n=Ce[t];n&&(e[n]=e[n]&&!1!==r)}return{...ne,features:e}},[ne,H]);if("loading"===te)/* @__PURE__ */return f("div",{style:{width:"100%",aspectRatio:"16 / 9",background:"#000",borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */h("style",{children:"@keyframes boss-sdk-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */h("div",{style:{width:60,height:60,borderRadius:"50%",border:`4px solid rgba(${Fe}, 0.1)`,borderLeftColor:i,borderRightColor:`rgba(${Fe}, 0.2)`,filter:`drop-shadow(0 0 10px rgba(${Fe}, 0.5))`,animation:"boss-sdk-spin 1s linear infinite"}})]});if("error"===te){const e="auth"===oe;/* @__PURE__ */
|
|
61
61
|
return h("div",{style:{width:"100%",aspectRatio:"16 / 9",background:"#09090e",borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:20},children:/* @__PURE__ */h(K,{title:e?"Invalid Player Key":"Something Went Wrong",subtitle:e?"Your player key is invalid or expired.\nPlease check your configuration.":"We encountered an error while connecting.\nPlease try again.",onRetry:()=>se(e=>e+1)})})}/* @__PURE__ */
|
|
62
|
-
return h(fe,{src:ee,sources:Z,enableSources:O,enableQuality:W,activeSourceIndex:J,onSourceChange:e=>G(e),subtitles:r,keyMoments:X,themeColor:i,firebaseConfig:a,resolvedEntitlement:
|
|
62
|
+
return h(fe,{src:ee,sources:Z,enableSources:O,enableQuality:W,activeSourceIndex:J,onSourceChange:e=>G(e),subtitles:r,keyMoments:X,themeColor:i,firebaseConfig:a,resolvedEntitlement:Qe,licenseKey:n,title:g,artworkUrl:y,watermark:v,autoplay:T,muted:w,autoFullscreen:x,enableControls:S,enableSkipAd:N,skipAdAfterSeconds:M,chaptersDisplayMode:C,volumeControlType:E,subtitleStyle:A,drmConfig:P,overlayAdUrl:k,adTrackingUrl:p,videoId:_e,urlTransformer:Re,onAnalyticsEvent:He,onAdBreakChange:We,onKeyMomentsLoaded:Ke,initialTime:D,onTimeUpdate:Oe,introStartTime:z,introEndTime:R,hasNextEpisode:F,outroStartTime:V,nextEpisodeLabel:q,onNextEpisode:Xe,nextEpisodeAutoAdvanceSeconds:U,nextEpisodeThumbnailUrl:j})}function Pe(e,t){const r=k(e);let n=t;return r.render(i(Ae,n)),{update(e){n={...n,...e},r.render(i(Ae,n))},destroy(){r.unmount()}}}export{Ae as BossVideoPlayer,K as ErrorScreen,e as FirebaseAnalyticsProvider,t as VideoPlayerSDK,fe as WebVideoPlayer,Pe as createPlayer,Te as endSession,ge as initSdk,we as sendEvent,ve as sendHeartbeat,ye as startSession};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "boss-web-player-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.78",
|
|
4
4
|
"description": "Unified high-performance OTT web video player SDK supporting adaptive HLS/DASH streaming, secure token-based DRM protection, dynamic watermarking, captioning, and premium UI components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|