@streamlayer/react-ui 1.28.2 → 1.29.0

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.
Files changed (39) hide show
  1. package/lib/app/app/Layout/styles.d.ts +1 -0
  2. package/lib/app/app/Layout/styles.js +33 -24
  3. package/lib/app/webos/Advertisement/AdvertisementUI.d.ts +0 -1
  4. package/lib/app/webos/Advertisement/AdvertisementUI.js +13 -15
  5. package/lib/app/webos/Advertisement/index.js +10 -11
  6. package/lib/app/webos/ExposedPauseAd/PauseAd.d.ts +2 -0
  7. package/lib/app/webos/ExposedPauseAd/PauseAd.js +92 -70
  8. package/lib/app/webos/ExposedPauseAd/styles.d.ts +1 -1
  9. package/lib/app/webos/ExposedPauseAd/styles.js +5 -5
  10. package/lib/app/webos/index.d.ts +4 -0
  11. package/lib/app/webos/index.js +38 -36
  12. package/lib/app/webos/story.js +47 -36
  13. package/lib/app/webos/ui/Sidebar/PromoAction.js +38 -34
  14. package/lib/app/webos/ui/Sidebar/index.d.ts +0 -1
  15. package/lib/app/webos/ui/Sidebar/index.js +70 -71
  16. package/lib/app/webos/ui/Sidebar/styles.d.ts +1 -0
  17. package/lib/app/webos/ui/Sidebar/styles.js +120 -115
  18. package/lib/app/webos/ui/insight/index.js +43 -77
  19. package/lib/assets/style.css +1 -1
  20. package/lib/{index-DXvAPWiE.js → index-l-eyvmpL.js} +296 -281
  21. package/lib/ui/advertisement/notification/index.js +24 -24
  22. package/lib/ui/advertisement/notification/lower-third/index.js +48 -40
  23. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +8 -7
  24. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.d.ts +9 -0
  25. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js +44 -0
  26. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +240 -6
  27. package/lib/ui/gamification/question/inapp/notification/AdNotification/index.js +62 -52
  28. package/lib/ui/video-player/index.d.ts +1 -0
  29. package/lib/ui/video-player/index.js +138 -125
  30. package/lib/ui/video-player/styles.d.ts +1 -0
  31. package/lib/ui/video-player/styles.js +32 -27
  32. package/lib/{useVastAds-CakWRNKN.js → vast-client.min-B0NUra1B.js} +358 -594
  33. package/package.json +17 -17
  34. package/lib/app/webos/ui/Layout/index.d.ts +0 -21
  35. package/lib/app/webos/ui/Layout/index.js +0 -78
  36. package/lib/app/webos/ui/Layout/styles.d.ts +0 -11
  37. package/lib/app/webos/ui/Layout/styles.js +0 -59
  38. package/lib/hooks/useKeyboardNavigation.d.ts +0 -15
  39. package/lib/hooks/useKeyboardNavigation.js +0 -74
@@ -1,93 +1,103 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { withFocusable as I } from "../../../../../../app/webos/useTvButton.js";
1
+ import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
+ import { withFocusable as D } from "../../../../../../app/webos/useTvButton.js";
3
3
  import { useState as Q, useRef as x, useEffect as R } from "react";
4
- import { QuestionType as u, NotificationUseContentMedia as F, QuestionStatus as W } from "@streamlayer/sdk-web-types";
4
+ import { QuestionType as d, NotificationUseContentMedia as w, QuestionStatus as W } from "@streamlayer/sdk-web-types";
5
5
  import { QuestionTypeData as j } from "../../../../constants.js";
6
- import { QuestionTypeHeader as y } from "../../../index.js";
7
- import { NotificationMedia as w } from "./NotificationMedia/index.js";
8
- import { NotificationContainer as H, LogoImgContainer as P, LogoImg as O, NotificationContent as S, MainContent as _, StyledChevronRight as h, TVButtons as z, Body as G, Title as J, Description as K, DismissButton as X, AnswerButton as Y, NotificationInterstitialContainer as Z } from "./styles.js";
9
- const $ = ({ title: a, questionType: c, questionTypeData: r, description: o, imageMode: t, webos: n }) => /* @__PURE__ */ l(G, { imageMode: t, questionType: c, webos: n, children: [
10
- /* @__PURE__ */ e(
11
- y,
6
+ import { QuestionTypeHeader as P } from "../../../index.js";
7
+ import { NotificationMedia as O } from "./NotificationMedia/index.js";
8
+ import { NotificationContainer as y, LogoImgContainer as H, LogoImg as S, NotificationContent as E, MainContent as _, StyledChevronRight as h, TVButtons as z, Body as G, Title as J, Description as K, DismissButton as X, AnswerButton as Y, NotificationInterstitialContainer as Z } from "./styles.js";
9
+ const $ = ({ title: a, questionType: c, questionTypeData: e, description: o, imageMode: t, webos: n }) => /* @__PURE__ */ u(G, { imageMode: t, questionType: c, webos: n, children: [
10
+ /* @__PURE__ */ r(
11
+ P,
12
12
  {
13
- questionTypeData: r,
13
+ questionTypeData: e,
14
14
  questionType: c,
15
15
  questionStatus: W.UNSET
16
16
  }
17
17
  ),
18
- a && /* @__PURE__ */ e(J, { webos: n, children: a }),
19
- o && /* @__PURE__ */ e(K, { children: o })
20
- ] }), q = I(Z), g = I(X), A = I(Y), p = ({
18
+ a && /* @__PURE__ */ r(J, { webos: n, children: a }),
19
+ o && /* @__PURE__ */ r(K, { children: o })
20
+ ] }), q = D(Z), g = D(X), A = D(Y), p = ({
21
21
  sponsorLogo: a,
22
22
  onClick: c,
23
- webos: r
24
- }) => /* @__PURE__ */ e(q, { autoFocus: !0, webos: r, onClick: c, "data-webos": r, children: /* @__PURE__ */ e(S, { withoutPadding: !0, children: /* @__PURE__ */ e(O, { src: a }) }) }), lo = ({
23
+ webos: e
24
+ }) => /* @__PURE__ */ r(q, { autoFocus: !0, webos: e, onClick: c, "data-webos": e, children: /* @__PURE__ */ r(E, { withoutPadding: !0, children: /* @__PURE__ */ r(S, { src: a }) }) }), uo = ({
25
25
  action: a,
26
26
  close: c,
27
- questionType: r,
27
+ questionType: e,
28
28
  inApp: o,
29
29
  insight: t,
30
30
  color: n,
31
31
  webos: s
32
32
  }) => {
33
- var N, T, B;
34
- const [E, d] = Q(!1), D = x();
35
- R(() => (o != null && o.sponsorLogo && (d(!0), D.current = setTimeout(() => {
36
- d(!1);
37
- }, 5e3)), () => clearTimeout(D.current)), [o == null ? void 0 : o.sponsorLogo]);
38
- const L = j[r];
39
- if (!L || !o || !o.notification)
33
+ var T, B, F;
34
+ const [b, m] = Q(!1), L = x();
35
+ R(() => (o != null && o.sponsorLogo && (m(!0), L.current = setTimeout(() => {
36
+ m(!1);
37
+ }, 5e3)), () => clearTimeout(L.current)), [o == null ? void 0 : o.sponsorLogo]);
38
+ const N = j[e];
39
+ if (!N || !o || !o.notification)
40
40
  return null;
41
- const { title: b, image: v, imageMode: m, useContentMedia: f } = o.notification, M = r === u.FACTOID ? t == null ? void 0 : t.heading : b, U = r === u.FACTOID ? t == null ? void 0 : t.body : "", V = v, i = r === u.FACTOID && ((N = t == null ? void 0 : t.video) == null ? void 0 : N.url) && (o == null ? void 0 : o.isVideo) && f === F.ENABLED, C = f === F.ENABLED ? i ? (T = t == null ? void 0 : t.video) == null ? void 0 : T.url : t == null ? void 0 : t.image : "";
42
- return o != null && o.sponsorLogo && E ? /* @__PURE__ */ e(
41
+ const { title: v, image: M, imageMode: i, useContentMedia: f } = o.notification, U = e === d.FACTOID ? t == null ? void 0 : t.heading : v, V = e === d.FACTOID ? t == null ? void 0 : t.body : "", k = M, C = e === d.FACTOID && ((T = t == null ? void 0 : t.video) == null ? void 0 : T.url) && (o == null ? void 0 : o.isVideo) && f === w.ENABLED, I = f === w.ENABLED ? C ? (B = t == null ? void 0 : t.video) == null ? void 0 : B.url : t == null ? void 0 : t.image : "";
42
+ return o != null && o.sponsorLogo && b ? /* @__PURE__ */ r(
43
43
  p,
44
44
  {
45
45
  sponsorLogo: o == null ? void 0 : o.sponsorLogo,
46
46
  webos: s,
47
- onClick: () => d(!1)
47
+ onClick: () => m(!1)
48
48
  }
49
- ) : /* @__PURE__ */ l(
50
- H,
49
+ ) : /* @__PURE__ */ u(
50
+ y,
51
51
  {
52
52
  "data-a": "intr",
53
53
  className: "SL_InApp",
54
- onClick: (k) => {
55
- s && (a == null || a(k));
54
+ onClick: (l) => {
55
+ s || a == null || a(l);
56
56
  },
57
- "data-is-insight": r === u.FACTOID,
57
+ "data-is-insight": e === d.FACTOID,
58
58
  "data-webos": s,
59
59
  children: [
60
- (o == null ? void 0 : o.sponsorLogo) && /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(O, { src: o == null ? void 0 : o.sponsorLogo }) }),
61
- /* @__PURE__ */ l(S, { children: [
62
- /* @__PURE__ */ l(_, { children: [
63
- !C && /* @__PURE__ */ e(w, { src: V, imageMode: m, withVideo: !!i, color: n }),
64
- C && /* @__PURE__ */ e(
65
- w,
60
+ (o == null ? void 0 : o.sponsorLogo) && /* @__PURE__ */ r(H, { children: /* @__PURE__ */ r(S, { src: o == null ? void 0 : o.sponsorLogo }) }),
61
+ /* @__PURE__ */ u(E, { children: [
62
+ /* @__PURE__ */ u(_, { children: [
63
+ !I && /* @__PURE__ */ r(O, { src: k, imageMode: i, withVideo: !!C, color: n }),
64
+ I && /* @__PURE__ */ r(
65
+ O,
66
66
  {
67
- src: C,
68
- imageMode: m,
69
- withVideo: !!i,
67
+ src: I,
68
+ imageMode: i,
69
+ withVideo: !!C,
70
70
  color: n,
71
71
  useContentMedia: f,
72
- thumbnailUrl: (B = t == null ? void 0 : t.video) == null ? void 0 : B.thumbnailUrl
72
+ thumbnailUrl: (F = t == null ? void 0 : t.video) == null ? void 0 : F.thumbnailUrl
73
73
  }
74
74
  ),
75
- /* @__PURE__ */ e(
75
+ /* @__PURE__ */ r(
76
76
  $,
77
77
  {
78
- questionTypeData: L,
79
- questionType: r,
80
- title: M,
81
- description: U,
82
- imageMode: m,
78
+ questionTypeData: N,
79
+ questionType: e,
80
+ title: U,
81
+ description: V,
82
+ imageMode: i,
83
83
  webos: s
84
84
  }
85
85
  )
86
86
  ] }),
87
- !s && /* @__PURE__ */ e(h, { name: "chevronRight" }),
88
- s && /* @__PURE__ */ l(z, { children: [
89
- /* @__PURE__ */ e(g, { webos: !0, "data-close-btn": "true", onClick: c, children: "Dismiss" }),
90
- /* @__PURE__ */ e(A, { webos: !0, autoFocus: !0, onClick: a, children: "Answer" })
87
+ !s && /* @__PURE__ */ r(h, { name: "chevronRight" }),
88
+ s && /* @__PURE__ */ u(z, { children: [
89
+ /* @__PURE__ */ r(
90
+ g,
91
+ {
92
+ webos: !0,
93
+ "data-close-btn": "true",
94
+ onClick: (l) => {
95
+ l.stopPropagation(), c == null || c(l);
96
+ },
97
+ children: "Dismiss"
98
+ }
99
+ ),
100
+ /* @__PURE__ */ r(A, { webos: !0, autoFocus: !0, onClick: a, children: "Answer" })
91
101
  ] })
92
102
  ] })
93
103
  ]
@@ -95,5 +105,5 @@ const $ = ({ title: a, questionType: c, questionTypeData: r, description: o, ima
95
105
  );
96
106
  };
97
107
  export {
98
- lo as InAppNotification
108
+ uo as InAppNotification
99
109
  };
@@ -19,6 +19,7 @@ export type VideoPlayerProps = {
19
19
  muted?: boolean;
20
20
  webos?: boolean;
21
21
  className?: string;
22
+ hasNotPausedVideo?: boolean;
22
23
  };
23
24
  export type ControlVideoCb = VideoPlayerProps['controlVideo'];
24
25
  export declare const pauseAllVideos: () => void;
@@ -1,23 +1,23 @@
1
- import { jsxs as N, jsx as t, Fragment as te } from "react/jsx-runtime";
2
- import { cx as Z } from "@linaria/core";
3
- import { withFocusable as re } from "../../app/webos/useTvButton.js";
4
- import { forwardRef as se, useRef as W, useState as L, useEffect as v, useCallback as T } from "react";
5
- import { SvgIcon as C } from "../icons/index.js";
6
- import { Loader as ne } from "../loader/index.js";
7
- import { ToggleIconPause as ce, HideControls as ie, Player as oe, Poster as ae, Control as P, Container as fe, VideoControls as ue, PauseIcon as le, PlayIcon as me, MuteIcon as de, WebOSIconButtonPlay as Y, WebOSIconButtonPause as be, WebOSIconButtonMute as ge, WebOSIconButtonUnmute as he } from "./styles.js";
8
- const pe = (r) => {
1
+ import { jsxs as q, jsx as e, Fragment as st } from "react/jsx-runtime";
2
+ import { cx as _ } from "@linaria/core";
3
+ import { withFocusable as nt } from "../../app/webos/useTvButton.js";
4
+ import { forwardRef as ct, useRef as F, useState as B, useEffect as O, useCallback as P } from "react";
5
+ import { SvgIcon as g } from "../icons/index.js";
6
+ import { Loader as ot } from "../loader/index.js";
7
+ import { ToggleIconPause as it, HideControls as ut, Player as at, Poster as ft, Control as M, Container as lt, VideoControls as mt, PauseIcon as dt, PlayIcon as ht, MuteIcon as bt, WebOSIconButtonMute as gt, WebOSIconButtonUnmute as pt, WebOSIconButtonPlay as vt, WebOSIconButton as St, WebOSIconButtonPause as Ct } from "./styles.js";
8
+ const It = (r) => {
9
9
  for (const s of r)
10
10
  s.isIntersecting ? s.target instanceof HTMLVideoElement && s.target.autoplay && s.target.play() : s.target instanceof HTMLVideoElement && !s.target.paused && s.target.pause();
11
- }, _ = new IntersectionObserver(pe, { threshold: 0.5 }), A = /* @__PURE__ */ new Set(), ve = (r) => {
12
- _.observe(r), A.add(r);
13
- }, Ce = (r) => {
14
- _.unobserve(r), A.delete(r);
15
- }, Se = () => {
16
- for (const r of A)
11
+ }, $ = new IntersectionObserver(It, { threshold: 0.5 }), N = /* @__PURE__ */ new Set(), Bt = (r) => {
12
+ $.observe(r), N.add(r);
13
+ }, Ot = (r) => {
14
+ $.unobserve(r), N.delete(r);
15
+ }, wt = () => {
16
+ for (const r of N)
17
17
  r instanceof HTMLVideoElement && !r.paused && r.pause();
18
18
  };
19
- function Ie(...r) {
20
- return T(
19
+ function yt(...r) {
20
+ return P(
21
21
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
22
  (s) => {
23
23
  for (const c of r)
@@ -28,166 +28,179 @@ function Ie(...r) {
28
28
  [...r]
29
29
  );
30
30
  }
31
- const Oe = re(fe), Le = ({ loading: r, autoPlay: s, played: c, playing: o, isMuted: l, unmute: m, mute: d, togglePlaying: f }) => !r && !s && !c ? /* @__PURE__ */ t(P, { children: o ? /* @__PURE__ */ t(C, { name: "icon-pause" }) : /* @__PURE__ */ t(C, { name: "icon-play" }) }) : c ? /* @__PURE__ */ N(ue, { children: [
32
- o ? /* @__PURE__ */ t(le, { onClick: f }) : /* @__PURE__ */ t(me, { onClick: f }),
33
- /* @__PURE__ */ t(de, { className: Z(!l && "muted"), onClick: l ? m : d })
34
- ] }) : null, Te = ({ loading: r, autoPlay: s, playMuted: c, playing: o, played: l, isMutedMediaVideo: m, unmute: d, mute: f, isMuted: g }) => /* @__PURE__ */ N(te, { children: [
35
- !r && !(s && c) && /* @__PURE__ */ t(P, { "data-control-btn": "true", children: o ? /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(C, { name: "icon-play" }) }) : l ? /* @__PURE__ */ t(be, { children: /* @__PURE__ */ t(C, { name: "icon-pause" }) }) : /* @__PURE__ */ t(Y, { name: "icon-play", "data-control-icon": "true" }) }),
36
- !r && s && c && m !== void 0 && /* @__PURE__ */ t(P, { children: m ? /* @__PURE__ */ t(ge, { onClick: g ? d : f, children: /* @__PURE__ */ t(C, { name: "iconMute" }) }) : /* @__PURE__ */ t(he, { onClick: g ? d : f, children: /* @__PURE__ */ t(C, { name: "iconUnMute" }) }) })
37
- ] }), Pe = se(
31
+ const Lt = nt(lt), Pt = ({ loading: r, autoPlay: s, played: c, playing: i, isMuted: f, unmute: d, mute: h, togglePlaying: l }) => !r && !s && !c ? /* @__PURE__ */ e(M, { children: i ? /* @__PURE__ */ e(g, { name: "icon-pause" }) : /* @__PURE__ */ e(g, { name: "icon-play" }) }) : c ? /* @__PURE__ */ q(mt, { children: [
32
+ i ? /* @__PURE__ */ e(dt, { onClick: l }) : /* @__PURE__ */ e(ht, { onClick: l }),
33
+ /* @__PURE__ */ e(bt, { className: _(!f && "muted"), onClick: f ? d : h })
34
+ ] }) : null, Tt = ({
35
+ loading: r,
36
+ autoPlay: s,
37
+ playMuted: c,
38
+ playing: i,
39
+ played: f,
40
+ unmute: d,
41
+ mute: h,
42
+ isMuted: l,
43
+ hasNotPausedVideo: p,
44
+ hasInteractedWithAudio: w
45
+ }) => /* @__PURE__ */ q(st, { children: [
46
+ !r && !(s && c) && /* @__PURE__ */ e(M, { "data-control-btn": "true", children: i ? p ? null : /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ e(g, { name: "icon-play" }) }) : f ? /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ e(g, { name: "icon-pause" }) }) : /* @__PURE__ */ e(St, { "data-control-icon": "true", children: /* @__PURE__ */ e(g, { name: "icon-play" }) }) }),
47
+ !r && s && c && w && /* @__PURE__ */ e(M, { children: l ? /* @__PURE__ */ e(gt, { onClick: d, children: /* @__PURE__ */ e(g, { name: "iconMute" }) }) : /* @__PURE__ */ e(pt, { onClick: h, children: /* @__PURE__ */ e(g, { name: "iconUnMute" }) }) })
48
+ ] }), Et = ct(
38
49
  ({
39
50
  poster: r,
40
51
  source: s,
41
52
  aspectRatio: c,
42
- controlVideo: o,
43
- onReplay: l,
44
- onPlay: m,
45
- onPause: d,
46
- onEnd: f,
47
- onRender: g,
48
- onMute: x,
53
+ controlVideo: i,
54
+ onReplay: f,
55
+ onPlay: d,
56
+ onPause: h,
57
+ onEnd: l,
58
+ onRender: p,
59
+ onMute: w,
49
60
  onQuartile: u,
50
- autoPlay: S,
51
- playMuted: k,
52
- className: $,
53
- muted: I,
54
- webos: B
55
- }, V) => {
56
- const n = W(null), R = Ie(n, V), E = W(!1), j = W(!1), b = W(/* @__PURE__ */ new Set()), [D, K] = L(!1), [w, y] = L(!1), [M, z] = L(!1), [G, H] = L(!0), [q, F] = L(k);
57
- v(() => {
58
- s && (F(k), K(!1));
61
+ autoPlay: v,
62
+ playMuted: S,
63
+ className: D,
64
+ muted: y,
65
+ webos: T,
66
+ hasNotPausedVideo: V
67
+ }, R) => {
68
+ const n = F(null), Q = yt(n, R), x = F(!1), E = F(!1), m = F(/* @__PURE__ */ new Set()), [K, z] = B(!1), [W, k] = B(!1), [j, G] = B(!1), [J, H] = B(!0), [A, U] = B(S), [X, tt] = B(!1);
69
+ O(() => {
70
+ s && (U(S), z(!1));
59
71
  }, [s]);
60
- const p = T(() => {
61
- o == null || o({ muted: !1 });
62
- }, [o]), J = T(() => {
63
- o == null || o({ muted: !0 });
64
- }, [o]), O = T((e) => {
65
- e == null || e.stopPropagation(), n.current && (n.current.muted = !0), F(!0);
66
- }, []), U = T((e) => {
67
- e == null || e.stopPropagation(), n.current && (n.current.muted = !1), F(!1);
72
+ const C = P(() => {
73
+ i == null || i({ muted: !1 });
74
+ }, [i]), Y = P(() => {
75
+ i == null || i({ muted: !0 });
76
+ }, [i]), I = P((t) => {
77
+ t == null || t.stopPropagation(), n.current && (n.current.muted = !0), U(!0);
78
+ }, []), L = P((t) => {
79
+ t == null || t.stopPropagation(), n.current && (n.current.muted = !1), U(!1), X || tt(!0);
68
80
  }, []);
69
- v(() => {
70
- I !== void 0 && (I ? O() : U());
71
- }, [O, I, U]);
72
- const X = (e) => {
73
- var h;
74
- (h = e.stopPropagation) == null || h.call(e);
75
- const i = n == null ? void 0 : n.current;
76
- if (i)
77
- if (w)
78
- i.pause();
81
+ O(() => {
82
+ y !== void 0 && (y ? I() : L());
83
+ }, [I, y, L]);
84
+ const Z = (t) => {
85
+ var b;
86
+ (b = t.stopPropagation) == null || b.call(t);
87
+ const o = n == null ? void 0 : n.current;
88
+ if (o)
89
+ if (W)
90
+ o.pause();
79
91
  else {
80
92
  const a = n == null ? void 0 : n.current;
81
93
  if (!a)
82
94
  return;
83
- Se(), a.play().catch((ee) => console.log(ee)), H(!1);
95
+ wt(), a.play().catch((rt) => console.log(rt)), H(!1);
84
96
  }
85
- }, Q = () => {
86
- var e;
87
- (e = n == null ? void 0 : n.current) == null || e.load(), H(!0);
97
+ }, et = () => {
98
+ var t;
99
+ (t = n == null ? void 0 : n.current) == null || t.load(), H(!0);
88
100
  };
89
- return v(() => () => {
90
- p();
91
- }, [p]), v(() => {
92
- const e = n.current;
93
- return e ? (j.current = e.muted, F(e.muted), ve(e), () => {
94
- Ce(e);
101
+ return O(() => () => {
102
+ C();
103
+ }, [C]), O(() => {
104
+ const t = n.current;
105
+ return t ? (E.current = t.muted, U(t.muted), Bt(t), () => {
106
+ Ot(t);
95
107
  }) : () => {
96
108
  };
97
- }, []), v(() => {
98
- g == null || g();
99
- }, [g]), v(() => {
100
- b.current.clear(), E.current = !1;
101
- }, [s]), /* @__PURE__ */ N(
102
- Oe,
109
+ }, []), O(() => {
110
+ p == null || p();
111
+ }, [p]), O(() => {
112
+ m.current.clear(), x.current = !1;
113
+ }, [s]), /* @__PURE__ */ q(
114
+ Lt,
103
115
  {
104
- webos: B,
105
- onClick: S ? void 0 : X,
116
+ webos: T,
117
+ onClick: v && S ? A ? L : I : Z,
106
118
  "data-a": "intr",
107
119
  autoFocus: !0,
108
120
  options: { focusKey: "video-play-btn" },
109
- className: Z(w && ce, S && ie, $),
121
+ className: _(W && !T && it, v && ut, D),
110
122
  style: c ? { aspectRatio: c } : {},
111
123
  children: [
112
- /* @__PURE__ */ t(
113
- oe,
124
+ /* @__PURE__ */ e(
125
+ at,
114
126
  {
115
- ref: R,
127
+ ref: Q,
116
128
  src: s,
117
- autoPlay: S,
129
+ autoPlay: v,
118
130
  onPlay: () => {
119
- K(!0), E.current && (l == null || l(), b.current.clear()), y(!0), H(!1), m == null || m(), k ? O() : J();
131
+ z(!0), x.current && (f == null || f(), m.current.clear()), k(!0), H(!1), d == null || d(), S ? I() : Y();
120
132
  },
121
- onTimeUpdate: (e) => {
122
- const i = e.target.duration, h = e.target.currentTime;
123
- if (i && h) {
124
- const a = Math.floor(h / i * 100);
125
- a >= 25 && a < 50 && !b.current.has(25) ? (u == null || u(25), b.current.add(25)) : a >= 50 && a < 75 && !b.current.has(50) ? (u == null || u(50), b.current.add(50)) : a >= 75 && !b.current.has(75) && (u == null || u(75), b.current.add(75));
133
+ onTimeUpdate: (t) => {
134
+ const o = t.target.duration, b = t.target.currentTime;
135
+ if (o && b) {
136
+ const a = Math.floor(b / o * 100);
137
+ a >= 25 && a < 50 && !m.current.has(25) ? (u == null || u(25), m.current.add(25)) : a >= 50 && a < 75 && !m.current.has(50) ? (u == null || u(50), m.current.add(50)) : a >= 75 && !m.current.has(75) && (u == null || u(75), m.current.add(75));
126
138
  }
127
139
  },
128
- onVolumeChange: (e) => {
129
- const i = e.target.muted;
130
- j.current !== i && (x == null || x(i), j.current = i, (i !== I || I === void 0) && (i ? p() : J()));
140
+ onVolumeChange: (t) => {
141
+ const o = t.target.muted;
142
+ E.current !== o && (w == null || w(o), E.current = o, (o !== y || y === void 0) && (o ? C() : Y()));
131
143
  },
132
- onError: async (e) => {
144
+ onError: async (t) => {
133
145
  try {
134
- if (e.target instanceof HTMLVideoElement) {
135
- z(!0);
136
- const h = await (await fetch(e.target.src)).blob(), a = URL.createObjectURL(h);
137
- e.target.src = a;
146
+ if (t.target instanceof HTMLVideoElement) {
147
+ G(!0);
148
+ const b = await (await fetch(t.target.src)).blob(), a = URL.createObjectURL(b);
149
+ t.target.src = a;
138
150
  }
139
- } catch (i) {
140
- console.error("video fallback fetch failed", i), y(!0), H(!0);
151
+ } catch (o) {
152
+ console.error("video fallback fetch failed", o), k(!0), H(!0);
141
153
  } finally {
142
- z(!1), p();
154
+ G(!1), C();
143
155
  }
144
156
  },
145
157
  onPause: () => {
146
- y(!1), d == null || d(), p();
158
+ k(!1), h == null || h(), C();
147
159
  },
148
160
  onEnded: () => {
149
- y(!1), E.current = !0, Q(), f == null || f(), p();
161
+ k(!1), x.current = !0, et(), l == null || l(), C();
150
162
  },
151
- style: { visibility: G ? "hidden" : "visible" },
163
+ style: { visibility: J ? "hidden" : "visible" },
152
164
  controls: !1,
153
165
  playsInline: !0
154
166
  }
155
167
  ),
156
- /* @__PURE__ */ t(ae, { src: r, style: { visibility: G ? "visible" : "hidden" } }),
157
- !B && /* @__PURE__ */ t(
158
- Le,
168
+ /* @__PURE__ */ e(ft, { src: r, style: { visibility: J ? "visible" : "hidden" } }),
169
+ !T && /* @__PURE__ */ e(
170
+ Pt,
159
171
  {
160
- loading: M,
161
- autoPlay: S,
162
- played: D,
163
- playing: w,
164
- isMuted: q,
165
- unmute: U,
166
- mute: O,
167
- togglePlaying: X
172
+ loading: j,
173
+ autoPlay: v,
174
+ played: K,
175
+ playing: W,
176
+ isMuted: A,
177
+ unmute: L,
178
+ mute: I,
179
+ togglePlaying: Z
168
180
  }
169
181
  ),
170
- B && /* @__PURE__ */ t(
171
- Te,
182
+ T && /* @__PURE__ */ e(
183
+ Tt,
172
184
  {
173
- loading: M,
174
- autoPlay: S,
175
- playMuted: k,
176
- playing: w,
177
- played: D,
178
- isMutedMediaVideo: q,
179
- unmute: U,
180
- mute: O,
181
- isMuted: q
185
+ loading: j,
186
+ autoPlay: v,
187
+ playMuted: S,
188
+ playing: W,
189
+ played: K,
190
+ unmute: L,
191
+ mute: I,
192
+ isMuted: A,
193
+ hasNotPausedVideo: V,
194
+ hasInteractedWithAudio: X
182
195
  }
183
196
  ),
184
- M && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(ne, {}) })
197
+ j && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ot, {}) })
185
198
  ]
186
199
  }
187
200
  );
188
201
  }
189
202
  );
190
203
  export {
191
- Pe as VideoPlayer,
192
- Se as pauseAllVideos
204
+ Et as VideoPlayer,
205
+ wt as pauseAllVideos
193
206
  };
@@ -20,6 +20,7 @@ export declare const PlayIcon: {
20
20
  } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
21
21
  as?: React.ElementType;
22
22
  }>;
23
+ export declare const WebOSIconButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
23
24
  export declare const WebOSIconButtonPlay: {
24
25
  __wyw_meta: unknown;
25
26
  } & import('react').FunctionComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown> & {
@@ -1,9 +1,9 @@
1
1
  import { styled as s } from "@linaria/react";
2
- const I = /* @__PURE__ */ s("div")({
2
+ const i = /* @__PURE__ */ s("div")({
3
3
  name: "Container",
4
4
  class: "c1bgb86j",
5
5
  propsAsIs: !1
6
- }), m = /* @__PURE__ */ s("video")({
6
+ }), A = /* @__PURE__ */ s("video")({
7
7
  name: "Player",
8
8
  class: "p6703cq",
9
9
  propsAsIs: !1
@@ -11,11 +11,11 @@ const I = /* @__PURE__ */ s("div")({
11
11
  name: "Poster",
12
12
  class: "p12ow7zo",
13
13
  propsAsIs: !1
14
- }), A = /* @__PURE__ */ s("div")({
14
+ }), B = /* @__PURE__ */ s("div")({
15
15
  name: "Control",
16
16
  class: "cdpal9o",
17
17
  propsAsIs: !1
18
- }), i = "t1xke4ml", y = "h1yzxv57", P = /* @__PURE__ */ s("div")({
18
+ }), x = "t1xke4ml", y = "h1yzxv57", P = /* @__PURE__ */ s("div")({
19
19
  name: "VideoControls",
20
20
  class: "vxo8xch",
21
21
  propsAsIs: !1
@@ -23,52 +23,57 @@ const I = /* @__PURE__ */ s("div")({
23
23
  name: "ControlBtn",
24
24
  class: "coyuzu0",
25
25
  propsAsIs: !1
26
- }), t = () => n, x = /* @__PURE__ */ s(t())({
26
+ }), t = () => n, O = /* @__PURE__ */ s(t())({
27
27
  name: "MuteIcon",
28
28
  class: "musmi9a",
29
29
  propsAsIs: !0
30
- }), e = () => n, B = /* @__PURE__ */ s(e())({
30
+ }), e = () => n, S = /* @__PURE__ */ s(e())({
31
31
  name: "PauseIcon",
32
32
  class: "p1qe7rum",
33
33
  propsAsIs: !0
34
- }), c = () => n, d = /* @__PURE__ */ s(c())({
34
+ }), c = () => n, W = /* @__PURE__ */ s(c())({
35
35
  name: "PlayIcon",
36
36
  class: "psevery",
37
37
  propsAsIs: !0
38
- }), o = /* @__PURE__ */ s("button")({
38
+ }), a = /* @__PURE__ */ s("button")({
39
39
  name: "WebOSIconButton",
40
40
  class: "w1q3u7py",
41
41
  propsAsIs: !1
42
- }), a = () => o, O = /* @__PURE__ */ s(a())({
43
- name: "WebOSIconButtonPlay",
42
+ }), p = () => a, o = /* @__PURE__ */ s(p())({
43
+ name: "WebOSIconButtonAnimation",
44
44
  class: "wdlqvum",
45
45
  propsAsIs: !0
46
- }), p = () => o, S = /* @__PURE__ */ s(p())({
47
- name: "WebOSIconButtonPause",
46
+ }), l = () => o, d = /* @__PURE__ */ s(l())({
47
+ name: "WebOSIconButtonPlay",
48
48
  class: "w1ylz9ea",
49
49
  propsAsIs: !0
50
- }), l = () => o, W = /* @__PURE__ */ s(l())({
51
- name: "WebOSIconButtonMute",
50
+ }), r = () => o, C = /* @__PURE__ */ s(r())({
51
+ name: "WebOSIconButtonPause",
52
52
  class: "w1iylt55",
53
53
  propsAsIs: !0
54
- }), r = () => o, C = /* @__PURE__ */ s(r())({
55
- name: "WebOSIconButtonUnmute",
54
+ }), u = () => o, f = /* @__PURE__ */ s(u())({
55
+ name: "WebOSIconButtonMute",
56
56
  class: "w8h4h7",
57
57
  propsAsIs: !0
58
+ }), I = () => o, v = /* @__PURE__ */ s(I())({
59
+ name: "WebOSIconButtonUnmute",
60
+ class: "w12l12kt",
61
+ propsAsIs: !0
58
62
  });
59
63
  export {
60
- I as Container,
61
- A as Control,
64
+ i as Container,
65
+ B as Control,
62
66
  y as HideControls,
63
- x as MuteIcon,
64
- B as PauseIcon,
65
- d as PlayIcon,
66
- m as Player,
67
+ O as MuteIcon,
68
+ S as PauseIcon,
69
+ W as PlayIcon,
70
+ A as Player,
67
71
  b as Poster,
68
- i as ToggleIconPause,
72
+ x as ToggleIconPause,
69
73
  P as VideoControls,
70
- W as WebOSIconButtonMute,
71
- S as WebOSIconButtonPause,
72
- O as WebOSIconButtonPlay,
73
- C as WebOSIconButtonUnmute
74
+ a as WebOSIconButton,
75
+ f as WebOSIconButtonMute,
76
+ C as WebOSIconButtonPause,
77
+ d as WebOSIconButtonPlay,
78
+ v as WebOSIconButtonUnmute
74
79
  };