@streamlayer/react-ui 1.28.2 → 1.28.3
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/lib/app/webos/Advertisement/AdvertisementUI.d.ts +0 -1
- package/lib/app/webos/Advertisement/AdvertisementUI.js +13 -15
- package/lib/app/webos/Advertisement/index.js +10 -11
- package/lib/app/webos/story.js +43 -36
- package/lib/app/webos/ui/Sidebar/index.d.ts +0 -1
- package/lib/app/webos/ui/Sidebar/index.js +73 -74
- package/lib/app/webos/ui/insight/index.js +43 -77
- package/lib/assets/style.css +1 -1
- package/lib/ui/gamification/question/inapp/notification/AdNotification/index.js +62 -52
- package/lib/ui/video-player/index.d.ts +1 -0
- package/lib/ui/video-player/index.js +138 -125
- package/lib/ui/video-player/styles.d.ts +1 -0
- package/lib/ui/video-player/styles.js +32 -27
- package/package.json +15 -15
- package/lib/hooks/useKeyboardNavigation.d.ts +0 -15
- package/lib/hooks/useKeyboardNavigation.js +0 -74
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { TVSidebar as
|
|
3
|
-
import { Banner as
|
|
4
|
-
import { Notification as
|
|
5
|
-
import { Sidebar as
|
|
6
|
-
const
|
|
2
|
+
import { TVSidebar as N } from "../ui/Sidebar/index.js";
|
|
3
|
+
import { Banner as S } from "../../../ui/advertisement/banner/index.js";
|
|
4
|
+
import { Notification as b } from "../../../ui/advertisement/notification/index.js";
|
|
5
|
+
import { Sidebar as g } from "../../../ui/advertisement/sidebar/index.js";
|
|
6
|
+
const A = ({
|
|
7
7
|
advertisement: o,
|
|
8
8
|
close: t,
|
|
9
9
|
skipAutoClose: p,
|
|
@@ -18,10 +18,9 @@ const B = ({
|
|
|
18
18
|
fireEvent: u,
|
|
19
19
|
muted: I,
|
|
20
20
|
toggleMute: h,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
g,
|
|
21
|
+
isNotification: q
|
|
22
|
+
}) => o.promotion ? q && o.notification ? /* @__PURE__ */ r(
|
|
23
|
+
b,
|
|
25
24
|
{
|
|
26
25
|
open: () => i == null ? void 0 : i({ fromNotification: !0 }),
|
|
27
26
|
notification: o.notification,
|
|
@@ -29,8 +28,8 @@ const B = ({
|
|
|
29
28
|
close: t,
|
|
30
29
|
webos: !0
|
|
31
30
|
}
|
|
32
|
-
) : n ? /* @__PURE__ */ r(
|
|
33
|
-
|
|
31
|
+
) : n ? /* @__PURE__ */ r(g, { className: "PromoSidebarContainer", direction: n, hiding: !1, children: /* @__PURE__ */ r(
|
|
32
|
+
N,
|
|
34
33
|
{
|
|
35
34
|
markAsViewed: c,
|
|
36
35
|
promotionId: o.question.id,
|
|
@@ -44,11 +43,10 @@ const B = ({
|
|
|
44
43
|
isEventFired: m,
|
|
45
44
|
fireEvent: u,
|
|
46
45
|
muted: I,
|
|
47
|
-
toggleMute: h
|
|
48
|
-
isMuted: q
|
|
46
|
+
toggleMute: h
|
|
49
47
|
}
|
|
50
48
|
) }) : f ? /* @__PURE__ */ r(
|
|
51
|
-
|
|
49
|
+
S,
|
|
52
50
|
{
|
|
53
51
|
promotionId: o.question.id,
|
|
54
52
|
hiding: !1,
|
|
@@ -59,5 +57,5 @@ const B = ({
|
|
|
59
57
|
}
|
|
60
58
|
) : null : null;
|
|
61
59
|
export {
|
|
62
|
-
|
|
60
|
+
A as AdvertisementUI
|
|
63
61
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { styled as
|
|
4
|
-
import { useAnalyticsListener as
|
|
5
|
-
import { useHideTransition as
|
|
1
|
+
import { jsxs as T, jsx as P } from "react/jsx-runtime";
|
|
2
|
+
import { cx as V } from "@linaria/core";
|
|
3
|
+
import { styled as x } from "@linaria/react";
|
|
4
|
+
import { useAnalyticsListener as F } from "../../../hooks/analytics.js";
|
|
5
|
+
import { useHideTransition as M } from "../../../hooks/showIn.js";
|
|
6
6
|
import { forwardRef as O, useEffect as B, useRef as j } from "react";
|
|
7
7
|
import { useStore as u } from "@streamlayer/react-polyfills";
|
|
8
8
|
import { eventBus as E } from "@streamlayer/sdk-web-interfaces";
|
|
9
9
|
import { PromotionType as q, FeatureType as D } from "@streamlayer/sdk-web-types";
|
|
10
10
|
import { useAdvertisementBackground as H } from "../../../ui/theme/utils.js";
|
|
11
11
|
import { AdvertisementUI as K } from "./AdvertisementUI.js";
|
|
12
|
-
const N = /* @__PURE__ */
|
|
12
|
+
const N = /* @__PURE__ */ x("div")({
|
|
13
13
|
name: "AdvertisementUIWrap",
|
|
14
14
|
class: "a17b2u9w",
|
|
15
15
|
propsAsIs: !1
|
|
@@ -45,8 +45,8 @@ const N = /* @__PURE__ */ V("div")({
|
|
|
45
45
|
var p, f, g, v, A, b, S, y, U, I;
|
|
46
46
|
const e = u(t.advertisement.$store), {
|
|
47
47
|
finished: c
|
|
48
|
-
} =
|
|
49
|
-
|
|
48
|
+
} = M();
|
|
49
|
+
F(d, {
|
|
50
50
|
enabled: !!e.data,
|
|
51
51
|
event: "click",
|
|
52
52
|
listener: R
|
|
@@ -59,12 +59,12 @@ const N = /* @__PURE__ */ V("div")({
|
|
|
59
59
|
landscapeUrl: W,
|
|
60
60
|
portraitUrl: h
|
|
61
61
|
});
|
|
62
|
-
return e.data === void 0 || !m && e.isViewed ? null : /* @__PURE__ */
|
|
62
|
+
return e.data === void 0 || !m && e.isViewed ? null : /* @__PURE__ */ T(N, {
|
|
63
63
|
ref: d,
|
|
64
64
|
style: {
|
|
65
65
|
height: k ? "auto" : "100%"
|
|
66
66
|
},
|
|
67
|
-
className:
|
|
67
|
+
className: V("SL-AdvertisementUIWrap", "SL-AdvertisementWebOs", "SL-AdvertisementUIWrap--lower-third"),
|
|
68
68
|
children: [!n && w, /* @__PURE__ */ P(K, {
|
|
69
69
|
sidebar: s,
|
|
70
70
|
banner: i,
|
|
@@ -74,7 +74,6 @@ const N = /* @__PURE__ */ V("div")({
|
|
|
74
74
|
}),
|
|
75
75
|
toggleMute: e.toggleMute || (() => {
|
|
76
76
|
}),
|
|
77
|
-
isMuted: e.isMuted,
|
|
78
77
|
close: e.close,
|
|
79
78
|
isEventFired: e.isEventFired,
|
|
80
79
|
fireEvent: e.fireEvent,
|
package/lib/app/webos/story.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as a, jsxs as p, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import c from "hls.js";
|
|
3
3
|
import { useRef as m, useState as d, useEffect as u } from "react";
|
|
4
|
-
import { StreamLayerProvider as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { StreamLayerProvider as y, useStreamLayer as l, useStreamLayerUI as S } from "@streamlayer/react";
|
|
5
|
+
import { anonymous as h } from "@streamlayer/sdk-web-anonymous-auth";
|
|
6
|
+
import { useStreamLayerDebug as b } from "../../utils/debug/index.js";
|
|
7
|
+
import { StreamLayerSDKTv as g } from "./index.js";
|
|
8
|
+
const w = ({ src: t }) => {
|
|
9
|
+
const e = m(), n = m(), [r, o] = d(t);
|
|
9
10
|
return u(() => {
|
|
10
|
-
o(
|
|
11
|
-
}, [
|
|
12
|
-
|
|
11
|
+
o(t);
|
|
12
|
+
}, [t]), u(() => () => {
|
|
13
|
+
n.current && clearTimeout(n.current);
|
|
13
14
|
}, []), u(() => {
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
15
|
+
if (r && r.includes("m3u8"))
|
|
16
|
+
if (c.isSupported() && e.current) {
|
|
17
|
+
const s = new c({
|
|
17
18
|
debug: !1
|
|
18
19
|
});
|
|
19
|
-
|
|
20
|
+
s.loadSource(r), s.attachMedia(e.current);
|
|
20
21
|
} else
|
|
21
22
|
o("");
|
|
22
|
-
e.current && (e.current.volume = 0.1, e.current.play().catch((
|
|
23
|
-
var
|
|
24
|
-
console.error(
|
|
23
|
+
e.current && (e.current.volume = 0.1, e.current.play().catch((s) => {
|
|
24
|
+
var i;
|
|
25
|
+
console.error(s), (i = e.current) == null || i.play();
|
|
25
26
|
}));
|
|
26
|
-
}, [
|
|
27
|
+
}, [r]), /* @__PURE__ */ a(
|
|
27
28
|
"video",
|
|
28
29
|
{
|
|
29
|
-
src:
|
|
30
|
+
src: r || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
|
|
30
31
|
ref: e,
|
|
31
32
|
style: { width: "100%", height: "100%", borderRadius: 10, objectFit: "contain" },
|
|
32
33
|
autoPlay: !0,
|
|
@@ -37,38 +38,44 @@ const h = ({ src: r }) => {
|
|
|
37
38
|
controls: !0
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
return u(() =>
|
|
43
|
-
var o,
|
|
44
|
-
(
|
|
41
|
+
}, v = () => {
|
|
42
|
+
const t = l(), [e, n] = d("");
|
|
43
|
+
return u(() => t ? t.streamSummary().subscribe((r) => {
|
|
44
|
+
var o, s;
|
|
45
|
+
(s = (o = r.data) == null ? void 0 : o.summary) != null && s.stream && n(r.data.summary.stream);
|
|
45
46
|
}) : () => {
|
|
46
|
-
}, [
|
|
47
|
-
|
|
47
|
+
}, [t]), /* @__PURE__ */ a(
|
|
48
|
+
w,
|
|
48
49
|
{
|
|
49
50
|
src: e || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4"
|
|
50
51
|
}
|
|
51
52
|
);
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
}, L = ({ sdk: t }) => (u(() => {
|
|
54
|
+
t.anonymousAuthorization();
|
|
55
|
+
}, [t]), null), k = ({ persistent: t }) => {
|
|
56
|
+
const e = l(), n = S();
|
|
57
|
+
return e ? /* @__PURE__ */ p(f, { children: [
|
|
58
|
+
/* @__PURE__ */ a(L, { sdk: e }),
|
|
59
|
+
/* @__PURE__ */ a(g, { sdk: e, persistent: t, uiState: n, children: /* @__PURE__ */ a(v, {}) })
|
|
60
|
+
] }) : null;
|
|
61
|
+
}, R = /* @__PURE__ */ new Set([h]), P = ({ sdkKey: t, eventId: e, persistent: n, production: r }) => {
|
|
62
|
+
const o = b({ sdkKey: t, eventId: e, production: r });
|
|
63
|
+
return /* @__PURE__ */ a(
|
|
64
|
+
y,
|
|
59
65
|
{
|
|
60
66
|
event: o.event,
|
|
61
67
|
sdkKey: o.sdkKey,
|
|
62
68
|
production: o.env === "production",
|
|
69
|
+
plugins: R,
|
|
63
70
|
autoEnable: !0,
|
|
64
71
|
withAd: !0,
|
|
65
72
|
withAdNotification: !0,
|
|
66
73
|
webOS: !0,
|
|
67
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ a(k, { persistent: n })
|
|
68
75
|
}
|
|
69
76
|
);
|
|
70
77
|
};
|
|
71
78
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
w as Player,
|
|
80
|
+
P as WebOSStory
|
|
74
81
|
};
|
|
@@ -1,57 +1,56 @@
|
|
|
1
|
-
import { jsx as d, jsxs as l, Fragment as
|
|
2
|
-
import { updateAllLayouts as
|
|
3
|
-
import { withFocusable as
|
|
4
|
-
import { useRef as
|
|
1
|
+
import { jsx as d, jsxs as l, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import { updateAllLayouts as ee } from "@noriginmedia/norigin-spatial-navigation";
|
|
3
|
+
import { withFocusable as oe } from "../../useTvButton.js";
|
|
4
|
+
import { useRef as T, useState as I, useEffect as h } from "react";
|
|
5
5
|
import { eventBus as p } from "@streamlayer/sdk-web-interfaces";
|
|
6
|
-
import { PromotionType as r, AutoPlayVideo as
|
|
7
|
-
import { SvgIcon as
|
|
8
|
-
import { PromoAction as
|
|
9
|
-
import { Container as
|
|
10
|
-
const
|
|
6
|
+
import { PromotionType as r, AutoPlayVideo as te, PlayVideoMuted as de } from "@streamlayer/sdk-web-types";
|
|
7
|
+
import { SvgIcon as W } from "../../../../ui/icons/index.js";
|
|
8
|
+
import { PromoAction as ae } from "./PromoAction.js";
|
|
9
|
+
import { Container as ne, Header as ie, BrandBlock as re, LogoIcon as le, BrandText as pe, BrandNameContainer as se, BrandName as ce, Sponsored as ye, CloseIcon as me, VideoBlock as ue, VideoWrapper as he, FocusableVideo as Ae, VideoStatus as O, Title as Be, Description as Ie, CloseButton as be } from "./styles.js";
|
|
10
|
+
const Me = oe(be, {
|
|
11
11
|
isFocusBoundary: !0
|
|
12
|
-
}),
|
|
13
|
-
var
|
|
12
|
+
}), Le = (j) => {
|
|
13
|
+
var N, _, w, P, S, g, L, C, G, D, v, x, U, k;
|
|
14
14
|
const {
|
|
15
15
|
promotion: e,
|
|
16
|
-
open:
|
|
16
|
+
open: c,
|
|
17
17
|
togglePause: a,
|
|
18
|
-
controlVideo:
|
|
19
|
-
promotionId:
|
|
18
|
+
controlVideo: s,
|
|
19
|
+
promotionId: i,
|
|
20
20
|
onClose: b,
|
|
21
21
|
markAsViewed: A,
|
|
22
|
-
advertisementPaused:
|
|
22
|
+
advertisementPaused: H,
|
|
23
23
|
isEventFired: o,
|
|
24
24
|
fireEvent: t,
|
|
25
|
-
muted:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
let m = (N = e.banner) == null ? void 0 : N.url;
|
|
25
|
+
muted: $
|
|
26
|
+
} = j, q = T(null), B = T(null), [M, z] = I(0), K = e.type === r.INGAME_IAB11_LBAR ? M : M / 2, R = !!((_ = (N = e.banner) == null ? void 0 : N.video) != null && _.url), y = e.autoPlayVideo === te.ENABLED, V = e.playVideoMuted === de.ENABLED, Q = V && y, J = e.type === r.INGAME_IAB11_LBAR || e.type === r.INGAME_IAB11 || e.type === r.INGAME_IAB11_SIDEBAR, [f, X] = I(!0), [Y, Z] = I(void 0);
|
|
27
|
+
let m = (w = e.banner) == null ? void 0 : w.url;
|
|
29
28
|
return m && !m.startsWith("http") && (m = `https://${m}`), h(() => {
|
|
30
29
|
if (!B.current) return;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
30
|
+
const n = new ResizeObserver(([u]) => {
|
|
31
|
+
const E = u.contentRect.width;
|
|
32
|
+
z(E);
|
|
34
33
|
});
|
|
35
|
-
return
|
|
36
|
-
|
|
34
|
+
return n.observe(B.current), ee(), () => {
|
|
35
|
+
n.disconnect();
|
|
37
36
|
};
|
|
38
37
|
}, []), h(() => {
|
|
39
|
-
a == null || a(R ||
|
|
40
|
-
}, [R,
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
/* @__PURE__ */ l(
|
|
46
|
-
e.logoMode === 1 && /* @__PURE__ */ l(
|
|
47
|
-
/* @__PURE__ */ d(
|
|
48
|
-
/* @__PURE__ */ l(
|
|
49
|
-
/* @__PURE__ */ d(
|
|
50
|
-
/* @__PURE__ */ d(
|
|
38
|
+
a == null || a(R || y), c == null || c();
|
|
39
|
+
}, [R, y, c, a]), h(() => {
|
|
40
|
+
i && e.type && A && A();
|
|
41
|
+
}, [i, e.type, A]), h(() => () => {
|
|
42
|
+
s == null || s({ muted: !1 });
|
|
43
|
+
}, [s]), /* @__PURE__ */ d("div", { children: /* @__PURE__ */ l(ne, { ref: B, children: [
|
|
44
|
+
/* @__PURE__ */ l(ie, { children: [
|
|
45
|
+
e.logoMode === 1 && /* @__PURE__ */ l(re, { children: [
|
|
46
|
+
/* @__PURE__ */ d(le, { src: (P = e.sponsor) == null ? void 0 : P.logo, alt: "Logo" }),
|
|
47
|
+
/* @__PURE__ */ l(pe, { children: [
|
|
48
|
+
/* @__PURE__ */ d(se, { children: /* @__PURE__ */ d(ce, { children: (S = e.sponsor) == null ? void 0 : S.name }) }),
|
|
49
|
+
/* @__PURE__ */ d(ye, { children: "SPONSORED" })
|
|
51
50
|
] })
|
|
52
51
|
] }),
|
|
53
52
|
e.logoMode === 2 && e.type === r.INGAME_IAB11_LBAR && /* @__PURE__ */ d("img", { src: (g = e.sponsor) == null ? void 0 : g.logo, alt: "Video paused preview", style: { height: "56px" } }),
|
|
54
|
-
/* @__PURE__ */ d(
|
|
53
|
+
/* @__PURE__ */ d(Me, { options: { focusKey: "close-ad-button" }, webos: !0, onClick: b, "data-close-btn": "true", children: /* @__PURE__ */ d(me, {}) })
|
|
55
54
|
] }),
|
|
56
55
|
e.logoMode === 2 && e.type !== r.INGAME_IAB11_LBAR && /* @__PURE__ */ d(
|
|
57
56
|
"img",
|
|
@@ -66,60 +65,60 @@ const Be = Z(Ae, {
|
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
),
|
|
69
|
-
((
|
|
68
|
+
((C = e.banner) == null ? void 0 : C.imageUrl) && /* @__PURE__ */ d(ue, { style: { height: K }, children: /* @__PURE__ */ d(
|
|
70
69
|
"img",
|
|
71
70
|
{
|
|
72
|
-
src: (
|
|
71
|
+
src: (G = e.banner) == null ? void 0 : G.imageUrl,
|
|
73
72
|
alt: "Video paused preview",
|
|
74
73
|
style: { width: "100%", height: "100%", objectFit: "cover" }
|
|
75
74
|
}
|
|
76
75
|
) }),
|
|
77
|
-
((
|
|
76
|
+
((D = e.banner) == null ? void 0 : D.video) && /* @__PURE__ */ l(he, { children: [
|
|
78
77
|
/* @__PURE__ */ d(
|
|
79
|
-
|
|
78
|
+
Ae,
|
|
80
79
|
{
|
|
81
80
|
source: e.banner.video.url,
|
|
82
|
-
poster: (
|
|
81
|
+
poster: (x = (v = e.banner) == null ? void 0 : v.video) == null ? void 0 : x.thumbnailUrl,
|
|
83
82
|
webos: !0,
|
|
84
|
-
aspectRatio:
|
|
85
|
-
ref:
|
|
83
|
+
aspectRatio: J ? "1/1" : "2/1",
|
|
84
|
+
ref: q,
|
|
86
85
|
onRender: () => {
|
|
87
86
|
o != null && o("video-rendered") || (p.emit("advertisement", {
|
|
88
87
|
action: "videoRendered",
|
|
89
88
|
payload: {
|
|
90
|
-
id:
|
|
89
|
+
id: i,
|
|
91
90
|
type: e.type
|
|
92
91
|
}
|
|
93
92
|
}), t == null || t("video-rendered"));
|
|
94
93
|
},
|
|
95
|
-
onQuartile: (
|
|
96
|
-
o != null && o(`video-quartile-${
|
|
94
|
+
onQuartile: (n) => {
|
|
95
|
+
o != null && o(`video-quartile-${n}`) || (p.emit("advertisement", {
|
|
97
96
|
action: "quartileCompleted",
|
|
98
97
|
payload: {
|
|
99
|
-
id:
|
|
98
|
+
id: i,
|
|
100
99
|
type: e.type,
|
|
101
|
-
quartile:
|
|
100
|
+
quartile: n
|
|
102
101
|
}
|
|
103
|
-
}), t == null || t(`video-quartile-${
|
|
102
|
+
}), t == null || t(`video-quartile-${n}`));
|
|
104
103
|
},
|
|
105
|
-
onMute: (
|
|
106
|
-
const u =
|
|
104
|
+
onMute: (n) => {
|
|
105
|
+
const u = n ? "muted" : "unmuted";
|
|
107
106
|
o != null && o(u) || (p.emit("advertisement", {
|
|
108
|
-
action:
|
|
107
|
+
action: n ? "videoMuted" : "videoUnmuted",
|
|
109
108
|
payload: {
|
|
110
|
-
id:
|
|
109
|
+
id: i,
|
|
111
110
|
type: e.type
|
|
112
111
|
}
|
|
113
|
-
}), t == null || t(u));
|
|
112
|
+
}), t == null || t(u)), Z(n);
|
|
114
113
|
},
|
|
115
114
|
onPause: () => {
|
|
116
|
-
|
|
115
|
+
a == null || a(!0), X(!1);
|
|
117
116
|
},
|
|
118
117
|
onReplay: () => {
|
|
119
118
|
o != null && o("replayed") || (p.emit("advertisement", {
|
|
120
119
|
action: "videoReplayed",
|
|
121
120
|
payload: {
|
|
122
|
-
id:
|
|
121
|
+
id: i,
|
|
123
122
|
type: e.type
|
|
124
123
|
}
|
|
125
124
|
}), t == null || t("replayed"));
|
|
@@ -128,13 +127,13 @@ const Be = Z(Ae, {
|
|
|
128
127
|
o != null && o("played") || (p.emit("advertisement", {
|
|
129
128
|
action: "videoPlay",
|
|
130
129
|
payload: {
|
|
131
|
-
id:
|
|
130
|
+
id: i,
|
|
132
131
|
type: e.type
|
|
133
132
|
}
|
|
134
133
|
}), t == null || t("played")), a == null || a(!1), o != null && o("played") && (o != null && o("ended")) && !(o != null && o("replayed")) && (p.emit("advertisement", {
|
|
135
134
|
action: "videoReplayed",
|
|
136
135
|
payload: {
|
|
137
|
-
id:
|
|
136
|
+
id: i,
|
|
138
137
|
type: e.type
|
|
139
138
|
}
|
|
140
139
|
}), t == null || t("replayed"));
|
|
@@ -143,34 +142,34 @@ const Be = Z(Ae, {
|
|
|
143
142
|
o != null && o("ended") || (p.emit("advertisement", {
|
|
144
143
|
action: "videoEnd",
|
|
145
144
|
payload: {
|
|
146
|
-
id:
|
|
145
|
+
id: i,
|
|
147
146
|
type: e.type
|
|
148
147
|
}
|
|
149
148
|
}), t == null || t("ended"));
|
|
150
149
|
},
|
|
151
150
|
muted: $,
|
|
152
|
-
autoPlay:
|
|
153
|
-
playMuted:
|
|
154
|
-
controlVideo:
|
|
151
|
+
autoPlay: y,
|
|
152
|
+
playMuted: V,
|
|
153
|
+
controlVideo: s,
|
|
154
|
+
hasNotPausedVideo: f
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
|
-
|
|
158
|
-
/* @__PURE__ */ d(
|
|
157
|
+
H && !f && /* @__PURE__ */ l(O, { children: [
|
|
158
|
+
/* @__PURE__ */ d(W, { name: "icon-pause" }),
|
|
159
159
|
"PAUSED"
|
|
160
160
|
] }),
|
|
161
|
-
|
|
162
|
-
/* @__PURE__ */ d(
|
|
161
|
+
Y && Q && /* @__PURE__ */ l(O, { children: [
|
|
162
|
+
/* @__PURE__ */ d(W, { name: "iconMute" }),
|
|
163
163
|
"MUTED"
|
|
164
|
-
] })
|
|
165
|
-
" "
|
|
164
|
+
] })
|
|
166
165
|
] }),
|
|
167
|
-
e.type !== r.INGAME_IAB11 && e.type !== r.INGAME_IAB11_LBAR && e.type !== r.INGAME_IAB11_SIDEBAR && /* @__PURE__ */ l(
|
|
168
|
-
/* @__PURE__ */ d(
|
|
169
|
-
/* @__PURE__ */ d(
|
|
166
|
+
e.type !== r.INGAME_IAB11 && e.type !== r.INGAME_IAB11_LBAR && e.type !== r.INGAME_IAB11_SIDEBAR && /* @__PURE__ */ l(F, { children: [
|
|
167
|
+
/* @__PURE__ */ d(Be, { children: (U = e.banner) == null ? void 0 : U.title }),
|
|
168
|
+
/* @__PURE__ */ d(Ie, { children: (k = e.banner) == null ? void 0 : k.body })
|
|
170
169
|
] }),
|
|
171
|
-
/* @__PURE__ */ d(
|
|
170
|
+
/* @__PURE__ */ d(ae, { promotion: e, onClose: b })
|
|
172
171
|
] }) });
|
|
173
172
|
};
|
|
174
173
|
export {
|
|
175
|
-
|
|
174
|
+
Le as TVSidebar
|
|
176
175
|
};
|
|
@@ -1,100 +1,66 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
muted: x
|
|
1
|
+
import { jsxs as l, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as j, useState as c } from "react";
|
|
3
|
+
import { PlayVideoMuted as F, AutoPlayVideo as P, QuestionImages as H } from "@streamlayer/sdk-web-types";
|
|
4
|
+
import { SvgIcon as v } from "../../../../ui/icons/index.js";
|
|
5
|
+
import { Container as O, VideoWrapper as Q, FocusableVideo as W, contentContainerClassName as C, VideoStatus as A, ImageContainer as k, Image as q, Content as s, Title as z, Description as G } from "./styles.js";
|
|
6
|
+
const _ = ({
|
|
7
|
+
instantView: o,
|
|
8
|
+
isDetail: u,
|
|
9
|
+
notification: r,
|
|
10
|
+
controlVideo: B,
|
|
11
|
+
muted: D
|
|
13
12
|
}) => {
|
|
14
|
-
var
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, []), q = A(
|
|
21
|
-
(r) => {
|
|
22
|
-
const t = document.activeElement;
|
|
23
|
-
if (y().includes(t))
|
|
24
|
-
switch (r.tagName) {
|
|
25
|
-
case "BUTTON":
|
|
26
|
-
r.click();
|
|
27
|
-
break;
|
|
28
|
-
case "VIDEO":
|
|
29
|
-
E.current = setTimeout(() => {
|
|
30
|
-
const u = r;
|
|
31
|
-
m && s ? u.muted ? (M(!1), u.muted = !1) : (M(!0), u.muted = !0) : u.paused || u.ended ? (o(!1), N(!0), u.play().then(() => {
|
|
32
|
-
}).catch((K) => console.warn("⛔ start failed:", K))) : (o(!0), u.pause(), N(!0));
|
|
33
|
-
}, 0);
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
[s, m, y]
|
|
38
|
-
);
|
|
39
|
-
return W(() => () => {
|
|
40
|
-
E.current && clearTimeout(E.current);
|
|
41
|
-
}, []), Q({
|
|
42
|
-
containerSelector: ".webos",
|
|
43
|
-
getElements: y,
|
|
44
|
-
onEscape: () => {
|
|
45
|
-
},
|
|
46
|
-
onEnter: q,
|
|
47
|
-
initialFocusPriority: s ? 0 : 1,
|
|
48
|
-
enabled: !0,
|
|
49
|
-
dependencies: [s, m]
|
|
50
|
-
}), /* @__PURE__ */ a(H, { children: [
|
|
51
|
-
((I = e == null ? void 0 : e.video) == null ? void 0 : I.url) && /* @__PURE__ */ a(J, { children: [
|
|
52
|
-
/* @__PURE__ */ c(
|
|
53
|
-
X,
|
|
13
|
+
var E, N;
|
|
14
|
+
const I = j(null), [b, e] = c(!1), [f, g] = c(void 0), m = (o == null ? void 0 : o.playVideoMuted) === F.ENABLED, T = u && (o == null ? void 0 : o.autoPlayVideo) === P.ENABLED, S = m && T, p = o == null ? void 0 : o.heading, y = o == null ? void 0 : o.body, h = p || y, [M, U] = c(!0), x = r == null ? void 0 : r.title, L = r == null ? void 0 : r.body;
|
|
15
|
+
return /* @__PURE__ */ l(O, { children: [
|
|
16
|
+
((E = o == null ? void 0 : o.video) == null ? void 0 : E.url) && /* @__PURE__ */ l(Q, { children: [
|
|
17
|
+
/* @__PURE__ */ d(
|
|
18
|
+
W,
|
|
54
19
|
{
|
|
55
|
-
className:
|
|
56
|
-
source:
|
|
57
|
-
poster:
|
|
58
|
-
controlVideo:
|
|
59
|
-
muted:
|
|
60
|
-
autoPlay:
|
|
61
|
-
|
|
62
|
-
ref: p,
|
|
20
|
+
className: C,
|
|
21
|
+
source: o.video.url,
|
|
22
|
+
poster: o.video.thumbnailUrl,
|
|
23
|
+
controlVideo: B,
|
|
24
|
+
muted: D,
|
|
25
|
+
autoPlay: u && o.autoPlayVideo === P.ENABLED,
|
|
26
|
+
ref: I,
|
|
63
27
|
onPause: () => {
|
|
64
|
-
|
|
28
|
+
e == null || e(!0), U(!1);
|
|
29
|
+
},
|
|
30
|
+
onMute: (R) => {
|
|
31
|
+
g(R);
|
|
65
32
|
},
|
|
66
33
|
onPlay: () => {
|
|
67
|
-
|
|
34
|
+
e == null || e(!1);
|
|
68
35
|
},
|
|
69
36
|
playMuted: m,
|
|
70
|
-
|
|
71
|
-
isMutedMediaVideo: f,
|
|
37
|
+
hasNotPausedVideo: M,
|
|
72
38
|
webos: !0
|
|
73
39
|
}
|
|
74
40
|
),
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */
|
|
41
|
+
b && !M && /* @__PURE__ */ l(A, { children: [
|
|
42
|
+
/* @__PURE__ */ d(v, { name: "icon-pause" }),
|
|
77
43
|
"PAUSED"
|
|
78
44
|
] }),
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */
|
|
45
|
+
f && S && /* @__PURE__ */ l(A, { children: [
|
|
46
|
+
/* @__PURE__ */ d(v, { name: "iconMute" }),
|
|
81
47
|
"MUTED"
|
|
82
48
|
] })
|
|
83
49
|
] }),
|
|
84
|
-
(
|
|
85
|
-
|
|
50
|
+
(o == null ? void 0 : o.image) && !((N = o == null ? void 0 : o.video) != null && N.url) && /* @__PURE__ */ d(
|
|
51
|
+
k,
|
|
86
52
|
{
|
|
87
|
-
className:
|
|
88
|
-
"data-rounded":
|
|
89
|
-
children: /* @__PURE__ */
|
|
53
|
+
className: C,
|
|
54
|
+
"data-rounded": o.imageMode === H.ROUNDED,
|
|
55
|
+
children: /* @__PURE__ */ d(q, { src: o == null ? void 0 : o.image })
|
|
90
56
|
}
|
|
91
57
|
),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ l(s, { children: [
|
|
59
|
+
/* @__PURE__ */ d(z, { children: u && h ? p : x }),
|
|
60
|
+
/* @__PURE__ */ d(G, { children: u && h ? y : L })
|
|
95
61
|
] })
|
|
96
62
|
] });
|
|
97
63
|
};
|
|
98
64
|
export {
|
|
99
|
-
|
|
65
|
+
_ as InsightContentTV
|
|
100
66
|
};
|