boss-web-player-sdk 1.1.16 → 1.1.18

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/core.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./src-DKTjFFN1.cjs");var t=class{player;install(e){this.player=e,this.onInstall()}destroy(){this.onDestroy()}onDestroy(){}};exports.AnalyticsModule=e.l,exports.BasePlayerPlugin=t,exports.CastingModule=e.r,exports.ChaptersModule=e.o,exports.DRMModule=e.i,exports.FirebaseAnalyticsProvider=e.c,exports.KeyMomentsModule=e.s,exports.SubtitlesModule=e.a,exports.ThumbnailsModule=e.n,exports.VideoPlayerSDK=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./src-o2e7eh0w.cjs");var t=class{player;install(e){this.player=e,this.onInstall()}destroy(){this.onDestroy()}onDestroy(){}};exports.AnalyticsModule=e.l,exports.BasePlayerPlugin=t,exports.CastingModule=e.r,exports.ChaptersModule=e.o,exports.DRMModule=e.i,exports.FirebaseAnalyticsProvider=e.c,exports.KeyMomentsModule=e.s,exports.SubtitlesModule=e.a,exports.ThumbnailsModule=e.n,exports.VideoPlayerSDK=e.t;
2
2
  //# sourceMappingURL=core.cjs.map
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./src-DpzwcDhH.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "./src-BpmZXlMs.js";
2
2
  //#region ../plugins/src/plugins.ts
3
3
  var l = class {
4
4
  player;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require("./src-DKTjFFN1.cjs");let l=require("react");l=s(l,1);let u=require("react-dom"),d=require("react/jsx-runtime"),ee=require("react-dom/client");function te({title:e=`Something Went Wrong`,subtitle:t=`We encountered an error while playing this video.
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require("./src-o2e7eh0w.cjs");let l=require("react");l=s(l,1);let u=require("react-dom"),d=require("react/jsx-runtime"),ee=require("react-dom/client");function te({title:e=`Something Went Wrong`,subtitle:t=`We encountered an error while playing this video.
2
2
  Please try again.`,onRetry:n}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{style:{width:80,height:80,borderRadius:`50%`,background:`rgba(255,255,255,0.08)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,d.jsxs)(`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:[(0,d.jsx)(`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`}),(0,d.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,d.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]})}),(0,d.jsxs)(`div`,{style:{textAlign:`center`,padding:`0 24px`},children:[(0,d.jsx)(`p`,{style:{color:`#ffffff`,fontSize:22,fontWeight:700,margin:`0 0 8px`,letterSpacing:`-0.2px`},children:e}),(0,d.jsx)(`p`,{style:{color:`rgba(255,255,255,0.5)`,fontSize:14,margin:0,lineHeight:1.6,whiteSpace:`pre-line`},children:t})]}),(0,d.jsxs)(`button`,{onClick:n,style:{display:`flex`,alignItems:`center`,gap:10,background:`#ffffff`,color:`#09090e`,border:`none`,borderRadius:10,padding:`14px 32px`,fontSize:16,fontWeight:700,cursor:`pointer`,letterSpacing:`-0.1px`},children:[(0,d.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,d.jsx)(`polyline`,{points:`1 4 1 10 7 10`}),(0,d.jsx)(`path`,{d:`M3.51 15a9 9 0 1 0 .49-3.51`})]}),`Retry Now`]})]})}var ne=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),re=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ie=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ae=e=>{let t=ie(e);return t.charAt(0).toUpperCase()+t.slice(1)},oe={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`},se=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ce=(0,l.createContext)({}),le=()=>(0,l.useContext)(ce),ue=(0,l.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:ee=!1,color:te=`currentColor`,className:re=``}=le()??{},ie=r??ee?Number(n??d)*24/Number(t??u):n??d;return(0,l.createElement)(`svg`,{ref:c,...oe,width:t??u??oe.width,height:t??u??oe.height,stroke:e??te,strokeWidth:ie,className:ne(`lucide`,re,i),...!a&&!se(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,l.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),f=(e,t)=>{let n=(0,l.forwardRef)(({className:n,...r},i)=>(0,l.createElement)(ue,{ref:i,iconNode:t,className:ne(`lucide-${re(ae(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ae(e),n},de=f(`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`}]]),fe=f(`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`}]]),pe=f(`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`}]]),p=f(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),me=f(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),he=f(`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`}]]),ge=f(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),_e=f(`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`}]]),ve=f(`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`}]]),ye=f(`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`}]]),m=f(`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`}]]),be=f(`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`}]]),xe=f(`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`}]]),Se=f(`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`}]]),Ce=f(`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`}]]),we=f(`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`}]]),Te=f(`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`}]]),Ee=f(`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`}]]),De=f(`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`}]]),Oe=f(`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`}]]),ke=1e4,Ae=!1,je=`
3
3
  html, body { margin: 0; padding: 0; height: 100%; background: #000; overflow: hidden; }
4
4
  * { box-sizing: border-box; }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as e, t, u as n } from "./src-DpzwcDhH.js";
1
+ import { c as e, t, u as n } from "./src-BpmZXlMs.js";
2
2
  import { createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
3
  import { createPortal as ee } from "react-dom";
4
4
  import { Fragment as te, jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -19647,60 +19647,91 @@ var wu = class {
19647
19647
  } catch {
19648
19648
  return e.url ?? "";
19649
19649
  }
19650
- }, n = t(e[0]), r = [];
19651
- for (let i of e) {
19652
- let e = t(i) !== n, a = i.start ?? 0, o = a + (i.duration ?? 0), s = r[r.length - 1];
19653
- s && s.isAd === e ? s.endTime = o : r.push({
19650
+ }, n = /* @__PURE__ */ new Map();
19651
+ for (let r of e) {
19652
+ let e = t(r);
19653
+ n.set(e, (n.get(e) ?? 0) + (r.duration ?? 0));
19654
+ }
19655
+ let r = t(e[0]), i = -1;
19656
+ for (let [e, t] of n) t > i && (i = t, r = e);
19657
+ let a = [];
19658
+ for (let n of e) {
19659
+ let e = t(n) !== r, i = n.start ?? 0, o = i + (n.duration ?? 0), s = a[a.length - 1];
19660
+ s && s.isAd === e ? s.endTime = o : a.push({
19654
19661
  isAd: e,
19655
- startTime: a,
19662
+ startTime: i,
19656
19663
  endTime: o
19657
19664
  });
19658
19665
  }
19659
- return r.filter((e) => e.isAd).map((e) => ({
19666
+ return a.filter((e) => e.isAd).map((e) => ({
19660
19667
  startTime: e.startTime,
19661
19668
  endTime: e.endTime
19662
19669
  }));
19663
19670
  }
19664
19671
  parseAdBreaksFromPlaylist(e, t) {
19665
- let n = e.split(/\r?\n/).map((e) => e.trim()), r = [], i = 0, a = null, o = null, s = null, c = !1, l = null, u = !1, d = (e) => {
19672
+ let n = e.split(/\r?\n/).map((e) => e.trim()), r = [], i = (e) => {
19666
19673
  let t = e.substring(e.indexOf(":") + 1), n = t.match(/DURATION=([0-9.]+)/i)?.[1] ?? t, r = parseFloat(n);
19667
19674
  return Number.isFinite(r) ? r : null;
19668
- }, f = (e) => {
19675
+ }, a = (e) => {
19669
19676
  try {
19670
19677
  return new URL(e, t).host;
19671
19678
  } catch {
19672
19679
  return e;
19673
19680
  }
19674
- };
19675
- for (let e of n) if (e.startsWith("#EXT-X-CUE-OUT")) c = !0, a = i, o = d(e);
19676
- else if (e.startsWith("#EXT-X-CUE-IN")) {
19677
- if (a !== null) {
19678
- let e = o === null ? i : a + o;
19679
- e > a && r.push({
19680
- startTime: a,
19681
- endTime: e
19682
- }), a = null, o = null;
19683
- }
19684
- } else if (e.startsWith("#EXTINF:")) {
19681
+ }, o = [], s = !1, c = 0, l = null;
19682
+ for (let e of n) if (e.startsWith("#EXT-X-CUE-OUT")) s = !0;
19683
+ else if (e.startsWith("#EXTINF:")) {
19685
19684
  let t = parseFloat(e.substring(8).split(",")[0]);
19686
- Number.isFinite(t) && (s = t);
19685
+ Number.isFinite(t) && (l = t);
19687
19686
  } else if (!e.startsWith("#") && e.length > 0) {
19688
- let t = i;
19689
- if (s !== null && (i += s, s = null), !c) {
19690
- let n = f(e);
19691
- l === null && (l = n);
19692
- let i = n !== l;
19693
- i && !u ? (u = !0, a = t) : !i && u && (u = !1, a !== null && r.push({
19694
- startTime: a,
19695
- endTime: t
19696
- }), a = null);
19697
- }
19698
- }
19699
- if (a !== null) {
19700
- let e = c ? o === null ? i : a + o : i;
19701
- e > a && r.push({
19702
- startTime: a,
19703
- endTime: e
19687
+ let t = c, n = l ?? 0;
19688
+ l !== null && (c += l, l = null), o.push({
19689
+ start: t,
19690
+ duration: n,
19691
+ host: a(e)
19692
+ });
19693
+ }
19694
+ if (s) {
19695
+ let e = null, t = null, a = 0;
19696
+ for (let o of n) if (o.startsWith("#EXT-X-CUE-OUT")) e = a, t = i(o);
19697
+ else if (o.startsWith("#EXT-X-CUE-IN")) {
19698
+ if (e !== null) {
19699
+ let n = t === null ? a : e + t;
19700
+ n > e && r.push({
19701
+ startTime: e,
19702
+ endTime: n
19703
+ }), e = null, t = null;
19704
+ }
19705
+ } else if (o.startsWith("#EXTINF:")) {
19706
+ let e = parseFloat(o.substring(8).split(",")[0]);
19707
+ Number.isFinite(e) && (l = e);
19708
+ } else !o.startsWith("#") && o.length > 0 && l !== null && (a += l, l = null);
19709
+ if (e !== null) {
19710
+ let n = t === null ? a : e + t;
19711
+ n > e && r.push({
19712
+ startTime: e,
19713
+ endTime: n
19714
+ });
19715
+ }
19716
+ return r;
19717
+ }
19718
+ let u = /* @__PURE__ */ new Map();
19719
+ for (let e of o) u.set(e.host, (u.get(e.host) ?? 0) + e.duration);
19720
+ let d = "", f = -1;
19721
+ for (let [e, t] of u) t > f && (f = t, d = e);
19722
+ let p = !1, m = null;
19723
+ for (let e of o) {
19724
+ let t = e.host !== d;
19725
+ t && !p ? (p = !0, m = e.start) : !t && p && (p = !1, m !== null && r.push({
19726
+ startTime: m,
19727
+ endTime: e.start
19728
+ }), m = null);
19729
+ }
19730
+ if (p && m !== null && o.length > 0) {
19731
+ let e = o[o.length - 1];
19732
+ r.push({
19733
+ startTime: m,
19734
+ endTime: e.start + e.duration
19704
19735
  });
19705
19736
  }
19706
19737
  return r;
@@ -19760,4 +19791,4 @@ var wu = class {
19760
19791
  //#endregion
19761
19792
  export { Au as a, Du as c, ju as i, wu as l, Nu as n, ku as o, Mu as r, Ou as s, Pu as t, $ as u };
19762
19793
 
19763
- //# sourceMappingURL=src-DpzwcDhH.js.map
19794
+ //# sourceMappingURL=src-BpmZXlMs.js.map