@streamlayer/react-ui 1.28.3 → 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.
- package/lib/app/app/Layout/styles.d.ts +1 -0
- package/lib/app/app/Layout/styles.js +33 -24
- package/lib/app/webos/ExposedPauseAd/PauseAd.d.ts +2 -0
- package/lib/app/webos/ExposedPauseAd/PauseAd.js +92 -70
- package/lib/app/webos/ExposedPauseAd/styles.d.ts +1 -1
- package/lib/app/webos/ExposedPauseAd/styles.js +5 -5
- package/lib/app/webos/index.d.ts +4 -0
- package/lib/app/webos/index.js +38 -36
- package/lib/app/webos/story.js +29 -25
- package/lib/app/webos/ui/Sidebar/PromoAction.js +38 -34
- package/lib/app/webos/ui/Sidebar/index.js +24 -24
- package/lib/app/webos/ui/Sidebar/styles.d.ts +1 -0
- package/lib/app/webos/ui/Sidebar/styles.js +120 -115
- package/lib/assets/style.css +1 -1
- package/lib/{index-DXvAPWiE.js → index-l-eyvmpL.js} +296 -281
- package/lib/ui/advertisement/notification/index.js +24 -24
- package/lib/ui/advertisement/notification/lower-third/index.js +48 -40
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +8 -7
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.d.ts +9 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js +44 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +240 -6
- package/lib/{useVastAds-CakWRNKN.js → vast-client.min-B0NUra1B.js} +358 -594
- package/package.json +17 -17
- package/lib/app/webos/ui/Layout/index.d.ts +0 -21
- package/lib/app/webos/ui/Layout/index.js +0 -78
- package/lib/app/webos/ui/Layout/styles.d.ts +0 -11
- package/lib/app/webos/ui/Layout/styles.js +0 -59
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const breakpoints: (value: string) => string;
|
|
1
2
|
export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
2
3
|
export declare const ContentContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
3
4
|
export declare const Sidebar: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
@@ -1,64 +1,73 @@
|
|
|
1
1
|
import { styled as s } from "@linaria/react";
|
|
2
|
-
const
|
|
2
|
+
const n = (a) => `
|
|
3
|
+
@media only screen and (max-width: 1024px) {
|
|
4
|
+
${a}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@media only screen and (max-width: 1366px) and (orientation: landscape) {
|
|
8
|
+
${a}
|
|
9
|
+
}
|
|
10
|
+
`, o = /* @__PURE__ */ s("div")({
|
|
3
11
|
name: "Container",
|
|
4
12
|
class: "c6rz41d",
|
|
5
13
|
propsAsIs: !1
|
|
6
|
-
}),
|
|
14
|
+
}), i = /* @__PURE__ */ s("div")({
|
|
7
15
|
name: "ContentContainer",
|
|
8
16
|
class: "clv6awu",
|
|
9
17
|
propsAsIs: !1
|
|
10
|
-
}),
|
|
18
|
+
}), t = /* @__PURE__ */ s("div")({
|
|
11
19
|
name: "Sidebar",
|
|
12
20
|
class: "ssfv9z7",
|
|
13
21
|
propsAsIs: !1
|
|
14
|
-
}),
|
|
22
|
+
}), r = /* @__PURE__ */ s("div")({
|
|
15
23
|
name: "SideBarOverlay",
|
|
16
24
|
class: "sweyrp8",
|
|
17
25
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
26
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
19
27
|
name: "Banner",
|
|
20
28
|
class: "b5w8mb1",
|
|
21
29
|
propsAsIs: !1
|
|
22
|
-
}),
|
|
30
|
+
}), l = /* @__PURE__ */ s("div")({
|
|
23
31
|
name: "VideoContainer",
|
|
24
32
|
class: "v1uhtlpt",
|
|
25
33
|
propsAsIs: !1
|
|
26
|
-
}),
|
|
34
|
+
}), c = /* @__PURE__ */ s("div")({
|
|
27
35
|
name: "VideoBox",
|
|
28
36
|
class: "v7viet2",
|
|
29
37
|
propsAsIs: !1
|
|
30
|
-
}),
|
|
38
|
+
}), d = /* @__PURE__ */ s("div")({
|
|
31
39
|
name: "VideoPlayer",
|
|
32
40
|
class: "v9y7cje",
|
|
33
41
|
propsAsIs: !1
|
|
34
|
-
}),
|
|
42
|
+
}), m = /* @__PURE__ */ s("div")({
|
|
35
43
|
name: "Overlay",
|
|
36
44
|
class: "opmmtyi",
|
|
37
45
|
propsAsIs: !1
|
|
38
|
-
}),
|
|
46
|
+
}), v = /* @__PURE__ */ s("div")({
|
|
39
47
|
name: "Notification",
|
|
40
48
|
class: "nk5geky",
|
|
41
49
|
propsAsIs: !1
|
|
42
|
-
}),
|
|
50
|
+
}), f = /* @__PURE__ */ s("div")({
|
|
43
51
|
name: "PointsContainer",
|
|
44
52
|
class: "p17bxk8w",
|
|
45
53
|
propsAsIs: !1
|
|
46
|
-
}),
|
|
54
|
+
}), A = /* @__PURE__ */ s("div")({
|
|
47
55
|
name: "InApp",
|
|
48
56
|
class: "i1h25kze",
|
|
49
57
|
propsAsIs: !1
|
|
50
58
|
});
|
|
51
59
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
p as Banner,
|
|
61
|
+
o as Container,
|
|
62
|
+
i as ContentContainer,
|
|
63
|
+
A as InApp,
|
|
64
|
+
v as Notification,
|
|
65
|
+
m as Overlay,
|
|
66
|
+
f as PointsContainer,
|
|
67
|
+
r as SideBarOverlay,
|
|
68
|
+
t as Sidebar,
|
|
69
|
+
c as VideoBox,
|
|
70
|
+
l as VideoContainer,
|
|
71
|
+
d as VideoPlayer,
|
|
72
|
+
n as breakpoints
|
|
64
73
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StreamLayerSDKTvOptions } from '..';
|
|
1
2
|
export interface PauseAdProps {
|
|
2
3
|
vastUrls: Array<{
|
|
3
4
|
template?: 'default';
|
|
@@ -11,5 +12,6 @@ export interface PauseAdProps {
|
|
|
11
12
|
onRender?: (params: {
|
|
12
13
|
rendered: boolean;
|
|
13
14
|
}) => void;
|
|
15
|
+
options?: StreamLayerSDKTvOptions;
|
|
14
16
|
}
|
|
15
17
|
export declare const PauseAd: React.FC<PauseAdProps>;
|
|
@@ -1,95 +1,117 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useFocusable as
|
|
4
|
-
import { useState as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
const { ref:
|
|
1
|
+
import { jsx as e, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { cx as B } from "@linaria/core";
|
|
3
|
+
import { useFocusable as L } from "@noriginmedia/norigin-spatial-navigation";
|
|
4
|
+
import { useState as x, useRef as k, useEffect as P } from "react";
|
|
5
|
+
import { useStore as G } from "@streamlayer/react-polyfills";
|
|
6
|
+
import { eventBus as g } from "@streamlayer/sdk-web-interfaces";
|
|
7
|
+
import { useLoadGAMStatic as b } from "../../../ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js";
|
|
8
|
+
import { PauseAdOverlay as M, PauseAdContent as D, PauseAdGradientLeft as F, PauseAdGradientRight as I, PauseAdGradientBottom as j, PauseAdTopLeft as K, PauseAdTitle as N, PauseAdCaption as $, PauseAdBottomLeft as O, PauseAdPlayButton as V, PauseAdSidebar as _, ExternalAdContainer as w } from "./styles.js";
|
|
9
|
+
const q = ({ vastUrl: t }) => {
|
|
10
|
+
var d;
|
|
11
|
+
const [, n] = b(), u = G(n, { keys: [t] });
|
|
12
|
+
return (d = u == null ? void 0 : u[t]) != null && d.imageSrc ? u[t].adUrl ? /* @__PURE__ */ e("a", { href: u[t].adUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ e(w, { src: u[t].imageSrc }) }) : /* @__PURE__ */ e(w, { src: u[t].imageSrc }) : null;
|
|
13
|
+
}, z = ({ isClosing: t, title: n, caption: u, onPlay: d, onClose: s, vastUrl: a, options: r }) => {
|
|
14
|
+
const { ref: o, focusSelf: f } = L({
|
|
15
15
|
focusKey: "sl-pause-ad-play",
|
|
16
|
-
onEnterRelease:
|
|
16
|
+
onEnterRelease: d,
|
|
17
17
|
isFocusBoundary: !0,
|
|
18
18
|
forceFocus: !0
|
|
19
19
|
});
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
|
|
20
|
+
return P(() => {
|
|
21
|
+
o.current && f();
|
|
22
|
+
}, [o, f]), P(() => {
|
|
23
|
+
const A = (m) => {
|
|
24
|
+
const l = m.keyCode;
|
|
25
|
+
if (l === 461 || l === 10009 || l === 27) {
|
|
26
|
+
m.preventDefault(), m.stopPropagation(), m.stopImmediatePropagation(), s == null || s();
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
return window.addEventListener("keydown",
|
|
31
|
-
}, [s]), /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
30
|
+
return window.addEventListener("keydown", A, { capture: !0 }), () => window.removeEventListener("keydown", A, { capture: !0 });
|
|
31
|
+
}, [s]), /* @__PURE__ */ e(M, { className: B(t && "pause-ad-closing"), children: /* @__PURE__ */ y(D, { children: [
|
|
32
|
+
/* @__PURE__ */ e(F, {}),
|
|
33
|
+
/* @__PURE__ */ e(I, {}),
|
|
34
|
+
/* @__PURE__ */ e(j, {}),
|
|
35
|
+
/* @__PURE__ */ y(K, { children: [
|
|
36
|
+
/* @__PURE__ */ e(N, { children: n }),
|
|
37
|
+
/* @__PURE__ */ e($, { children: u })
|
|
38
38
|
] }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
39
|
+
(r == null ? void 0 : r.showPauseButton) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
40
|
+
V,
|
|
41
41
|
{
|
|
42
|
-
ref:
|
|
43
|
-
onClick:
|
|
44
|
-
onMouseEnter: () =>
|
|
42
|
+
ref: o,
|
|
43
|
+
onClick: d,
|
|
44
|
+
onMouseEnter: () => o.current.focus(),
|
|
45
45
|
"aria-label": "Resume playback"
|
|
46
46
|
}
|
|
47
47
|
) }),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ y(_, { children: [
|
|
49
|
+
a && /* @__PURE__ */ e(q, { vastUrl: a }),
|
|
50
|
+
/* @__PURE__ */ e("span", { children: "ADVERTISEMENT" })
|
|
51
51
|
] })
|
|
52
52
|
] }) });
|
|
53
|
-
},
|
|
54
|
-
showPauseAd:
|
|
55
|
-
vastUrls:
|
|
53
|
+
}, R = ({
|
|
54
|
+
showPauseAd: t,
|
|
55
|
+
vastUrls: n,
|
|
56
56
|
title: u,
|
|
57
|
-
caption:
|
|
57
|
+
caption: d,
|
|
58
58
|
onPlay: s,
|
|
59
|
-
onClose:
|
|
60
|
-
onRender:
|
|
59
|
+
onClose: a,
|
|
60
|
+
onRender: r,
|
|
61
|
+
options: o
|
|
61
62
|
}) => {
|
|
62
|
-
const [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
63
|
+
const [f, A] = x(!1), [m, l] = x(!1), c = k(), i = n == null ? void 0 : n[0].url, h = k(i);
|
|
64
|
+
h.current = i;
|
|
65
|
+
const [S, T] = b();
|
|
66
|
+
return P(() => {
|
|
67
|
+
if (t && i) {
|
|
68
|
+
g.emit("exposedPauseAd", {
|
|
69
|
+
action: "enabled",
|
|
70
|
+
payload: {}
|
|
71
|
+
}), S(i).then((p) => {
|
|
72
|
+
h.current === i && (p == null ? void 0 : p.success) !== !0 && (clearTimeout(c.current), a == null || a());
|
|
73
|
+
}).catch(() => {
|
|
74
|
+
h.current === i && (clearTimeout(c.current), a == null || a());
|
|
75
|
+
});
|
|
76
|
+
const E = () => {
|
|
77
|
+
var p;
|
|
78
|
+
(p = T.get()[h.current]) != null && p.imageSrc ? (clearTimeout(c.current), l(!1), A(!0), g.emit("exposedPauseAd", {
|
|
79
|
+
action: "rendered",
|
|
80
|
+
payload: {}
|
|
81
|
+
})) : c.current = setTimeout(() => {
|
|
82
|
+
E();
|
|
83
|
+
}, 200);
|
|
84
|
+
};
|
|
85
|
+
c.current = setTimeout(() => {
|
|
86
|
+
E();
|
|
87
|
+
}, 5e3);
|
|
88
|
+
} else
|
|
89
|
+
g.emit("exposedPauseAd", {
|
|
90
|
+
action: "disabled",
|
|
91
|
+
payload: {}
|
|
92
|
+
}), l(!0), c.current = setTimeout(() => {
|
|
93
|
+
A(!1);
|
|
94
|
+
}, 400);
|
|
95
|
+
return () => {
|
|
96
|
+
c.current && clearTimeout(c.current);
|
|
97
|
+
};
|
|
98
|
+
}, [T, S, a, t, i]), P(() => {
|
|
99
|
+
r == null || r({ rendered: f });
|
|
100
|
+
}, [f, r]), P(() => () => {
|
|
101
|
+
r == null || r({ rendered: !1 });
|
|
102
|
+
}, [r]), f ? /* @__PURE__ */ e(
|
|
103
|
+
z,
|
|
83
104
|
{
|
|
84
|
-
onClose:
|
|
85
|
-
isClosing:
|
|
105
|
+
onClose: a,
|
|
106
|
+
isClosing: m,
|
|
86
107
|
title: u,
|
|
87
|
-
caption:
|
|
108
|
+
caption: d,
|
|
88
109
|
onPlay: s,
|
|
89
|
-
vastUrl:
|
|
110
|
+
vastUrl: i,
|
|
111
|
+
options: o
|
|
90
112
|
}
|
|
91
113
|
) : null;
|
|
92
114
|
};
|
|
93
115
|
export {
|
|
94
|
-
|
|
116
|
+
R as PauseAd
|
|
95
117
|
};
|
|
@@ -9,4 +9,4 @@ export declare const PauseAdCaption: import('@linaria/react').StyledComponent<im
|
|
|
9
9
|
export declare const PauseAdBottomLeft: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
10
10
|
export declare const PauseAdPlayButton: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & Record<never, unknown>>;
|
|
11
11
|
export declare const PauseAdSidebar: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
12
|
-
export declare const ExternalAdContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<
|
|
12
|
+
export declare const ExternalAdContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLImageElement> & import('react').ImgHTMLAttributes<HTMLImageElement> & Record<never, unknown>>;
|
|
@@ -15,11 +15,11 @@ const e = /* @__PURE__ */ s("div")({
|
|
|
15
15
|
name: "PauseAdGradientRight",
|
|
16
16
|
class: "p1kh2yb0",
|
|
17
17
|
propsAsIs: !1
|
|
18
|
-
}),
|
|
18
|
+
}), p = /* @__PURE__ */ s("div")({
|
|
19
19
|
name: "PauseAdGradientBottom",
|
|
20
20
|
class: "pl8f94x",
|
|
21
21
|
propsAsIs: !1
|
|
22
|
-
}),
|
|
22
|
+
}), d = /* @__PURE__ */ s("div")({
|
|
23
23
|
name: "PauseAdTopLeft",
|
|
24
24
|
class: "p1m6zmrt",
|
|
25
25
|
propsAsIs: !1
|
|
@@ -43,7 +43,7 @@ const e = /* @__PURE__ */ s("div")({
|
|
|
43
43
|
name: "PauseAdSidebar",
|
|
44
44
|
class: "p1dpvfl1",
|
|
45
45
|
propsAsIs: !1
|
|
46
|
-
}), c = /* @__PURE__ */ s("
|
|
46
|
+
}), c = /* @__PURE__ */ s("img")({
|
|
47
47
|
name: "ExternalAdContainer",
|
|
48
48
|
class: "ezfmabr",
|
|
49
49
|
propsAsIs: !1
|
|
@@ -53,12 +53,12 @@ export {
|
|
|
53
53
|
r as PauseAdBottomLeft,
|
|
54
54
|
A as PauseAdCaption,
|
|
55
55
|
t as PauseAdContent,
|
|
56
|
-
|
|
56
|
+
p as PauseAdGradientBottom,
|
|
57
57
|
o as PauseAdGradientLeft,
|
|
58
58
|
n as PauseAdGradientRight,
|
|
59
59
|
e as PauseAdOverlay,
|
|
60
60
|
i as PauseAdPlayButton,
|
|
61
61
|
u as PauseAdSidebar,
|
|
62
62
|
l as PauseAdTitle,
|
|
63
|
-
|
|
63
|
+
d as PauseAdTopLeft
|
|
64
64
|
};
|
package/lib/app/webos/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
import { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
3
3
|
import { PauseAdProps } from './ExposedPauseAd/PauseAd';
|
|
4
|
+
export type StreamLayerSDKTvOptions = {
|
|
5
|
+
showPauseButton?: boolean;
|
|
6
|
+
};
|
|
4
7
|
export type StreamLayerSDKTvProps = {
|
|
5
8
|
persistent?: boolean;
|
|
6
9
|
children: React.ReactNode;
|
|
@@ -11,6 +14,7 @@ export type StreamLayerSDKTvProps = {
|
|
|
11
14
|
onRenderPauseAd?: (params: {
|
|
12
15
|
rendered: boolean;
|
|
13
16
|
}) => void;
|
|
17
|
+
options?: StreamLayerSDKTvOptions;
|
|
14
18
|
};
|
|
15
19
|
export declare class StreamLayerSDKTv extends Component<StreamLayerSDKTvProps, {
|
|
16
20
|
hasError: boolean;
|
package/lib/app/webos/index.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { init as y } from "@noriginmedia/norigin-spatial-navigation";
|
|
3
|
-
import { Layout as
|
|
4
|
-
import { Component as D, useCallback as
|
|
5
|
-
import { useStore as
|
|
6
|
-
import { StreamLayerSDKAdvertisementWebOS as
|
|
7
|
-
import { PauseAd as
|
|
8
|
-
import { StreamLayerSDKQuestionWebOS as
|
|
3
|
+
import { Layout as b } from "../app/Layout/index.js";
|
|
4
|
+
import { Component as D, useCallback as c } from "react";
|
|
5
|
+
import { useStore as x } from "@streamlayer/react-polyfills";
|
|
6
|
+
import { StreamLayerSDKAdvertisementWebOS as u } from "./Advertisement/index.js";
|
|
7
|
+
import { PauseAd as v } from "./ExposedPauseAd/PauseAd.js";
|
|
8
|
+
import { StreamLayerSDKQuestionWebOS as s } from "./Question/index.js";
|
|
9
9
|
y({
|
|
10
10
|
shouldFocusDOMNode: !0
|
|
11
11
|
});
|
|
12
|
-
const
|
|
13
|
-
persistent:
|
|
14
|
-
children:
|
|
12
|
+
const L = ({
|
|
13
|
+
persistent: e,
|
|
14
|
+
children: o,
|
|
15
15
|
sdk: r,
|
|
16
|
-
showPauseAd:
|
|
17
|
-
pauseAdVastUrl:
|
|
18
|
-
onClosePauseAd:
|
|
19
|
-
onRenderPauseAd:
|
|
16
|
+
showPauseAd: l,
|
|
17
|
+
pauseAdVastUrl: m,
|
|
18
|
+
onClosePauseAd: n,
|
|
19
|
+
onRenderPauseAd: f,
|
|
20
|
+
options: S
|
|
20
21
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
}, [
|
|
22
|
+
const a = x(r.uiState), p = c(() => {
|
|
23
|
+
n == null || n();
|
|
24
|
+
}, [n]), h = c(() => {
|
|
24
25
|
r.controlVideoPlayer({ play: !0 });
|
|
25
|
-
}, [r])
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
26
|
+
}, [r]);
|
|
27
|
+
return /* @__PURE__ */ d(
|
|
28
|
+
b,
|
|
28
29
|
{
|
|
29
30
|
sdk: r,
|
|
30
|
-
sidebar: ({ promo:
|
|
31
|
-
notification: ({ promo:
|
|
32
|
-
banner: /* @__PURE__ */ t(
|
|
31
|
+
sidebar: ({ promo: i }) => a.exposedPauseAd ? null : i ? /* @__PURE__ */ t(u, { sdk: r, persistent: e, sidebar: "right" }) : /* @__PURE__ */ t(s, { sdk: r, persistent: e }),
|
|
32
|
+
notification: ({ promo: i }) => a.exposedPauseAd ? null : i ? /* @__PURE__ */ t(u, { sdk: r, notification: !0, persistent: e }) : /* @__PURE__ */ t(s, { notification: !0, sdk: r, persistent: e }),
|
|
33
|
+
banner: a.exposedPauseAd ? null : /* @__PURE__ */ t(u, { sdk: r, persistent: e, banner: "bottom" }),
|
|
33
34
|
webos: !0,
|
|
34
35
|
children: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
o,
|
|
37
|
+
m && /* @__PURE__ */ t(
|
|
38
|
+
v,
|
|
38
39
|
{
|
|
39
|
-
showPauseAd:
|
|
40
|
-
vastUrls:
|
|
41
|
-
onClose:
|
|
42
|
-
onRender:
|
|
43
|
-
onPlay: h
|
|
40
|
+
showPauseAd: l,
|
|
41
|
+
vastUrls: m,
|
|
42
|
+
onClose: p,
|
|
43
|
+
onRender: f,
|
|
44
|
+
onPlay: h,
|
|
45
|
+
options: S
|
|
44
46
|
}
|
|
45
47
|
)
|
|
46
48
|
]
|
|
@@ -48,17 +50,17 @@ const K = ({
|
|
|
48
50
|
);
|
|
49
51
|
};
|
|
50
52
|
class W extends D {
|
|
51
|
-
constructor(
|
|
52
|
-
super(
|
|
53
|
+
constructor(o) {
|
|
54
|
+
super(o), this.state = { hasError: !1 };
|
|
53
55
|
}
|
|
54
56
|
static getDerivedStateFromError() {
|
|
55
57
|
return { hasError: !0 };
|
|
56
58
|
}
|
|
57
|
-
componentDidCatch(
|
|
58
|
-
console.error("StreamLayerSDKTv error:",
|
|
59
|
+
componentDidCatch(o, r) {
|
|
60
|
+
console.error("StreamLayerSDKTv error:", o, r.componentStack);
|
|
59
61
|
}
|
|
60
62
|
render() {
|
|
61
|
-
return this.state.hasError ? this.props.children : /* @__PURE__ */ t(
|
|
63
|
+
return this.state.hasError ? this.props.children : /* @__PURE__ */ t(L, { ...this.props });
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
export {
|
package/lib/app/webos/story.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsx as a, jsxs as p, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import c from "hls.js";
|
|
3
|
-
import { useRef as m, useState as d, useEffect as
|
|
3
|
+
import { useRef as m, useState as d, useEffect as i } from "react";
|
|
4
4
|
import { StreamLayerProvider as y, useStreamLayer as l, useStreamLayerUI as S } from "@streamlayer/react";
|
|
5
5
|
import { anonymous as h } from "@streamlayer/sdk-web-anonymous-auth";
|
|
6
6
|
import { useStreamLayerDebug as b } from "../../utils/debug/index.js";
|
|
7
7
|
import { StreamLayerSDKTv as g } from "./index.js";
|
|
8
|
-
const w = ({ src:
|
|
9
|
-
const e = m(), n = m(), [
|
|
10
|
-
return
|
|
11
|
-
o(
|
|
12
|
-
}, [
|
|
8
|
+
const w = ({ src: r }) => {
|
|
9
|
+
const e = m(), n = m(), [t, o] = d(r);
|
|
10
|
+
return i(() => {
|
|
11
|
+
o(r);
|
|
12
|
+
}, [r]), i(() => () => {
|
|
13
13
|
n.current && clearTimeout(n.current);
|
|
14
|
-
}, []),
|
|
15
|
-
if (
|
|
14
|
+
}, []), i(() => {
|
|
15
|
+
if (t && t.includes("m3u8"))
|
|
16
16
|
if (c.isSupported() && e.current) {
|
|
17
17
|
const s = new c({
|
|
18
18
|
debug: !1
|
|
19
19
|
});
|
|
20
|
-
s.loadSource(
|
|
20
|
+
s.loadSource(t), s.attachMedia(e.current);
|
|
21
21
|
} else
|
|
22
22
|
o("");
|
|
23
23
|
e.current && (e.current.volume = 0.1, e.current.play().catch((s) => {
|
|
24
|
-
var
|
|
25
|
-
console.error(s), (
|
|
24
|
+
var u;
|
|
25
|
+
console.error(s), (u = e.current) == null || u.play();
|
|
26
26
|
}));
|
|
27
|
-
}, [
|
|
27
|
+
}, [t]), /* @__PURE__ */ a(
|
|
28
28
|
"video",
|
|
29
29
|
{
|
|
30
|
-
src:
|
|
30
|
+
src: t || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4",
|
|
31
31
|
ref: e,
|
|
32
32
|
style: { width: "100%", height: "100%", borderRadius: 10, objectFit: "contain" },
|
|
33
33
|
autoPlay: !0,
|
|
@@ -39,39 +39,43 @@ const w = ({ src: t }) => {
|
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
}, v = () => {
|
|
42
|
-
const
|
|
43
|
-
return
|
|
42
|
+
const r = l(), [e, n] = d("");
|
|
43
|
+
return i(() => r ? r.streamSummary().subscribe((t) => {
|
|
44
44
|
var o, s;
|
|
45
|
-
(s = (o =
|
|
45
|
+
(s = (o = t.data) == null ? void 0 : o.summary) != null && s.stream && n(t.data.summary.stream);
|
|
46
46
|
}) : () => {
|
|
47
|
-
}, [
|
|
47
|
+
}, [r]), /* @__PURE__ */ a(
|
|
48
48
|
w,
|
|
49
49
|
{
|
|
50
50
|
src: e || "https://storage.googleapis.com/cdn.streamlayer.io/assets/sdk-web/Own%20The%20Game%201080p%20RF18.mp4"
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
}, [
|
|
53
|
+
}, k = ({ sdk: r }) => (i(() => {
|
|
54
|
+
r.anonymousAuthorization();
|
|
55
|
+
}, [r]), null), L = ({ persistent: r }) => {
|
|
56
56
|
const e = l(), n = S();
|
|
57
57
|
return e ? /* @__PURE__ */ p(f, { children: [
|
|
58
|
-
/* @__PURE__ */ a(
|
|
59
|
-
/* @__PURE__ */ a(g, { sdk: e, persistent:
|
|
58
|
+
/* @__PURE__ */ a(k, { sdk: e }),
|
|
59
|
+
/* @__PURE__ */ a(g, { sdk: e, persistent: r, uiState: n, children: /* @__PURE__ */ a(v, {}) })
|
|
60
60
|
] }) : null;
|
|
61
|
-
}, R = /* @__PURE__ */ new Set([h]), P = ({ sdkKey:
|
|
62
|
-
const o = b({ sdkKey:
|
|
61
|
+
}, R = /* @__PURE__ */ new Set([h]), P = ({ sdkKey: r, eventId: e, persistent: n, production: t }) => {
|
|
62
|
+
const o = b({ sdkKey: r, eventId: e, production: t });
|
|
63
63
|
return /* @__PURE__ */ a(
|
|
64
64
|
y,
|
|
65
65
|
{
|
|
66
66
|
event: o.event,
|
|
67
67
|
sdkKey: o.sdkKey,
|
|
68
68
|
production: o.env === "production",
|
|
69
|
+
themeMode: "dark",
|
|
69
70
|
plugins: R,
|
|
70
71
|
autoEnable: !0,
|
|
71
72
|
withAd: !0,
|
|
73
|
+
skipOnboarding: !0,
|
|
72
74
|
withAdNotification: !0,
|
|
75
|
+
friendsTab: "disabled",
|
|
76
|
+
hideFriends: !0,
|
|
73
77
|
webOS: !0,
|
|
74
|
-
children: /* @__PURE__ */ a(
|
|
78
|
+
children: /* @__PURE__ */ a(L, { persistent: n })
|
|
75
79
|
}
|
|
76
80
|
);
|
|
77
81
|
};
|