@streamlayer/react 1.23.1 → 1.23.2
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/cjs/Question.js +1 -1
- package/lib/cjs/advertisement.js +28 -223
- package/lib/cjs/analytics.js +1 -1
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/feature.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -1
- package/lib/cjs/hooks-WfHlJH12.js +1 -1
- package/lib/cjs/index-eShKGO10.js +1 -5
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index10.js +1 -1
- package/lib/cjs/index11.js +3 -4
- package/lib/cjs/index12.js +1 -1
- package/lib/cjs/index13.js +3 -1
- package/lib/cjs/index14.js +1 -1
- package/lib/cjs/index15.js +1 -1
- package/lib/cjs/index16.js +3 -5
- package/lib/cjs/index2.js +1 -1
- package/lib/cjs/index3.js +1 -1
- package/lib/cjs/index4.js +3 -5
- package/lib/cjs/index5.js +1 -1
- package/lib/cjs/index6.js +1 -1
- package/lib/cjs/index7.js +1 -1
- package/lib/cjs/index8.js +1 -1
- package/lib/cjs/index9.js +1 -1
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +1 -13
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/polymarket.js +5 -15
- package/lib/cjs/sl-types.js +1 -15
- package/lib/cjs/storage.js +1 -1
- package/lib/cjs/style.css +1 -0
- package/lib/cjs/theme.js +1 -17
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +3 -17
- package/lib/cjs/utils.js +1 -47
- package/lib/classic/cjs/Question.js +1 -1
- package/lib/classic/cjs/advertisement.js +28 -223
- package/lib/classic/cjs/analytics.js +1 -1
- package/lib/classic/cjs/auth.js +1 -1
- package/lib/classic/cjs/bet-pack.js +3 -5
- package/lib/classic/cjs/feature.js +1 -1
- package/lib/classic/cjs/gamification-feature.js +1 -1
- package/lib/classic/cjs/hooks-WfHlJH12.js +1 -1
- package/lib/classic/cjs/index-eShKGO10.js +1 -5
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/index10.js +1 -1
- package/lib/classic/cjs/index11.js +1 -1
- package/lib/classic/cjs/index12.js +1 -1
- package/lib/classic/cjs/index13.js +3 -4
- package/lib/classic/cjs/index2.js +3 -5
- package/lib/classic/cjs/index3.js +1 -1
- package/lib/classic/cjs/index4.js +1 -1
- package/lib/classic/cjs/index5.js +1 -1
- package/lib/classic/cjs/index6.js +1 -1
- package/lib/classic/cjs/index7.js +1 -1
- package/lib/classic/cjs/index8.js +1 -1
- package/lib/classic/cjs/index9.js +3 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/notification2.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/polymarket.js +5 -15
- package/lib/classic/cjs/sl-types.js +1 -15
- package/lib/classic/cjs/style.css +1 -0
- package/lib/classic/cjs/useStreamLayerApp.js +1 -1
- package/lib/classic/cjs/useStreamLayerApp2.js +3 -17
- package/lib/classic/cjs/utils.js +1 -47
- package/lib/classic/es/Question.js +277 -264
- package/lib/classic/es/advertisement.js +34990 -18881
- package/lib/classic/es/analytics.js +58 -56
- package/lib/classic/es/auth.js +14 -8
- package/lib/classic/es/bet-pack.js +2448 -2419
- package/lib/classic/es/feature.js +93 -48
- package/lib/classic/es/gamification-feature.js +2 -2
- package/lib/classic/es/hooks-WfHlJH12.js +78 -78
- package/lib/classic/es/index-eShKGO10.js +948 -948
- package/lib/classic/es/index.js +13 -13
- package/lib/classic/es/index10.js +68 -67
- package/lib/classic/es/index11.js +2903 -2159
- package/lib/classic/es/index12.js +124 -119
- package/lib/classic/es/index13.js +581 -566
- package/lib/classic/es/index2.js +2098 -1763
- package/lib/classic/es/index3.js +11 -11
- package/lib/classic/es/index4.js +127 -127
- package/lib/classic/es/index5.js +3 -4
- package/lib/classic/es/index6.js +8 -3
- package/lib/classic/es/index7.js +6 -5
- package/lib/classic/es/index8.js +8 -7
- package/lib/classic/es/index9.js +225 -223
- package/lib/classic/es/insight.js +58 -53
- package/lib/classic/es/notification.js +3 -3
- package/lib/classic/es/notification2.js +764 -722
- package/lib/classic/es/pause-ad.js +190 -167
- package/lib/classic/es/points.js +55 -48
- package/lib/classic/es/polymarket.js +4209 -4031
- package/lib/classic/es/sl-types.js +193 -125
- package/lib/classic/es/useStreamLayerApp.js +2 -2
- package/lib/classic/es/useStreamLayerApp2.js +9714 -7603
- package/lib/classic/es/utils.js +28 -28
- package/lib/classic/index.d.ts +1 -0
- package/lib/classic/style.css +1 -0
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/index-eShKGO10.js +1 -5
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +3 -77
- package/lib/dist/es/gamification-feature.js +2 -2
- package/lib/dist/es/index-eShKGO10.js +948 -948
- package/lib/dist/es/index.js +7 -8
- package/lib/dist/es/masters.js +18197 -14750
- package/lib/dist/index.d.ts +12 -2
- package/lib/dist/style.css +1 -1
- package/lib/es/Question.js +108 -106
- package/lib/es/advertisement.js +34990 -18881
- package/lib/es/analytics.js +58 -56
- package/lib/es/auth.js +14 -8
- package/lib/es/bet-pack.js +29 -17
- package/lib/es/feature.js +93 -48
- package/lib/es/gamification-feature.js +2 -2
- package/lib/es/gamification-feature2.js +2 -2
- package/lib/es/hooks-WfHlJH12.js +78 -78
- package/lib/es/index-eShKGO10.js +948 -948
- package/lib/es/index.js +14 -13
- package/lib/es/index10.js +176 -166
- package/lib/es/index11.js +581 -566
- package/lib/es/index12.js +124 -119
- package/lib/es/index13.js +225 -223
- package/lib/es/index14.js +68 -67
- package/lib/es/index15.js +2903 -2159
- package/lib/es/index16.js +1005 -806
- package/lib/es/index2.js +1117 -984
- package/lib/es/index3.js +3 -4
- package/lib/es/index4.js +2424 -2407
- package/lib/es/index5.js +11 -11
- package/lib/es/index6.js +127 -127
- package/lib/es/index7.js +8 -3
- package/lib/es/index8.js +5 -5
- package/lib/es/index9.js +8 -7
- package/lib/es/insight.js +58 -53
- package/lib/es/masters.js +6 -5
- package/lib/es/masters2.js +696 -559
- package/lib/es/notification.js +696 -655
- package/lib/es/pause-ad.js +190 -167
- package/lib/es/points.js +56 -49
- package/lib/es/polymarket.js +4209 -4031
- package/lib/es/sl-types.js +200 -132
- package/lib/es/storage.js +75 -74
- package/lib/es/theme.js +177 -31
- package/lib/es/useStreamLayerApp.js +2 -2
- package/lib/es/useStreamLayerApp2.js +9714 -7603
- package/lib/es/utils.js +28 -28
- package/lib/index.d.ts +1 -0
- package/lib/style.css +1 -1
- package/package.json +23 -20
package/lib/classic/es/index5.js
CHANGED
package/lib/classic/es/index6.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import "./feature.js";
|
|
2
|
-
import "nanostores";
|
|
3
2
|
import "./sl-types.js";
|
|
4
|
-
import { Q as
|
|
5
|
-
|
|
3
|
+
import { Q as QuestionType } from "./useStreamLayerApp2.js";
|
|
4
|
+
({
|
|
5
|
+
[QuestionType.FACTOID]: "insight",
|
|
6
|
+
[QuestionType.POLL]: "poll",
|
|
7
|
+
[QuestionType.TRIVIA]: "trivia",
|
|
8
|
+
[QuestionType.PREDICTION]: "prediction",
|
|
9
|
+
[QuestionType.TWEET]: "tweet"
|
|
10
|
+
});
|
package/lib/classic/es/index7.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { c as
|
|
3
|
-
const
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as cx_default } from "./sl-types.js";
|
|
3
|
+
const m = "StreamLayerCSSReset", h$1 = "ttkj0ah";
|
|
4
|
+
const h = ({ children: r, customTheme: m2, themeMode: o, style: a }) => /* @__PURE__ */ jsx("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ jsx("div", { className: cx_default(h$1, o, m2), style: a, children: r }) });
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
h,
|
|
7
|
+
m
|
|
7
8
|
};
|
package/lib/classic/es/index8.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { s as
|
|
3
|
-
const
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { s as styled_default } from "./sl-types.js";
|
|
3
|
+
const e = /* @__PURE__ */ styled_default("div")({
|
|
4
4
|
name: "Container",
|
|
5
5
|
class: "cqg02m",
|
|
6
|
-
propsAsIs:
|
|
7
|
-
})
|
|
6
|
+
propsAsIs: false
|
|
7
|
+
});
|
|
8
|
+
const i = ({ children: r, style: o, loading: t }) => t ? /* @__PURE__ */ jsx(e, { style: o, children: r }) : r;
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
e,
|
|
11
|
+
i
|
|
11
12
|
};
|
package/lib/classic/es/index9.js
CHANGED
|
@@ -1,319 +1,321 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { s as
|
|
3
|
-
import { useState
|
|
4
|
-
import { B as
|
|
5
|
-
import { G
|
|
6
|
-
import { C as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { s as styled_default, c as cx_default } from "./sl-types.js";
|
|
3
|
+
import { useState, useEffect, useCallback, forwardRef, useRef } from "react";
|
|
4
|
+
import { B as B1 } from "./index4.js";
|
|
5
|
+
import { G, d as d$1, O as O$1 } from "./index10.js";
|
|
6
|
+
import { C as CloseTimerAuto } from "./useStreamLayerApp2.js";
|
|
7
|
+
const g = /* @__PURE__ */ styled_default("div")({
|
|
8
8
|
name: "CloseIconWrap",
|
|
9
9
|
class: "c3v6bv6",
|
|
10
|
-
propsAsIs:
|
|
11
|
-
}),
|
|
10
|
+
propsAsIs: false
|
|
11
|
+
}), h = /* @__PURE__ */ styled_default("div")({
|
|
12
12
|
name: "TimerWrap",
|
|
13
13
|
class: "teuhmro",
|
|
14
|
-
propsAsIs:
|
|
15
|
-
}),
|
|
14
|
+
propsAsIs: false
|
|
15
|
+
}), A$1 = () => B1, C$1 = /* @__PURE__ */ styled_default(A$1())({
|
|
16
16
|
name: "Icon",
|
|
17
17
|
class: "i17rfxv5",
|
|
18
|
-
propsAsIs:
|
|
19
|
-
}),
|
|
20
|
-
close:
|
|
21
|
-
className:
|
|
22
|
-
timerClassName:
|
|
23
|
-
skipIcon:
|
|
24
|
-
isPlaying:
|
|
25
|
-
duration:
|
|
26
|
-
autoClose:
|
|
18
|
+
propsAsIs: true
|
|
19
|
+
}), y$1 = ({
|
|
20
|
+
close: r2,
|
|
21
|
+
className: a2,
|
|
22
|
+
timerClassName: m,
|
|
23
|
+
skipIcon: o2,
|
|
24
|
+
isPlaying: c2 = true,
|
|
25
|
+
duration: e2 = 0,
|
|
26
|
+
autoClose: n2
|
|
27
27
|
}) => {
|
|
28
|
-
const [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
return
|
|
28
|
+
const [p2, i2] = useState(e2 === 0);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
i2(!e2);
|
|
31
|
+
}, [e2]);
|
|
32
|
+
const l2 = useCallback(() => {
|
|
33
|
+
n2 === CloseTimerAuto.ENABLED ? r2 == null || r2() : i2(true);
|
|
34
|
+
}, [n2, r2]);
|
|
35
|
+
return p2 ? /* @__PURE__ */ jsxs(g, {
|
|
36
36
|
"data-a": "intr",
|
|
37
|
-
onClick:
|
|
38
|
-
className:
|
|
39
|
-
style:
|
|
37
|
+
onClick: r2,
|
|
38
|
+
className: a2,
|
|
39
|
+
style: o2 ? {
|
|
40
40
|
width: "auto"
|
|
41
41
|
} : {},
|
|
42
|
-
children: [
|
|
42
|
+
children: [o2 && /* @__PURE__ */ jsx("span", {
|
|
43
43
|
"data-a": "intr",
|
|
44
44
|
children: "Skip"
|
|
45
|
-
}), /* @__PURE__ */
|
|
45
|
+
}), /* @__PURE__ */ jsx(C$1, {
|
|
46
46
|
"data-a": "intr",
|
|
47
|
-
name:
|
|
47
|
+
name: o2 ? "iconSkip" : "icon-cross"
|
|
48
48
|
})]
|
|
49
|
-
}) : /* @__PURE__ */
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
-
className:
|
|
52
|
-
isPlaying:
|
|
53
|
-
duration:
|
|
54
|
-
onTimerExpired:
|
|
49
|
+
}) : /* @__PURE__ */ jsx(h, {
|
|
50
|
+
children: /* @__PURE__ */ jsx(G, {
|
|
51
|
+
className: m,
|
|
52
|
+
isPlaying: c2,
|
|
53
|
+
duration: e2,
|
|
54
|
+
onTimerExpired: l2
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
|
-
}
|
|
57
|
+
};
|
|
58
|
+
const i = /* @__PURE__ */ styled_default("div")({
|
|
58
59
|
name: "Container",
|
|
59
60
|
class: "c1bgb86j",
|
|
60
|
-
propsAsIs:
|
|
61
|
-
}),
|
|
61
|
+
propsAsIs: false
|
|
62
|
+
}), A = /* @__PURE__ */ styled_default("video")({
|
|
62
63
|
name: "Player",
|
|
63
64
|
class: "p6703cq",
|
|
64
|
-
propsAsIs:
|
|
65
|
-
}),
|
|
65
|
+
propsAsIs: false
|
|
66
|
+
}), b = /* @__PURE__ */ styled_default("img")({
|
|
66
67
|
name: "Poster",
|
|
67
68
|
class: "p12ow7zo",
|
|
68
|
-
propsAsIs:
|
|
69
|
-
}),
|
|
69
|
+
propsAsIs: false
|
|
70
|
+
}), B = /* @__PURE__ */ styled_default("div")({
|
|
70
71
|
name: "Control",
|
|
71
72
|
class: "cdpal9o",
|
|
72
|
-
propsAsIs:
|
|
73
|
-
}),
|
|
73
|
+
propsAsIs: false
|
|
74
|
+
}), x = "t1xke4ml", y = "h1yzxv57", P = /* @__PURE__ */ styled_default("div")({
|
|
74
75
|
name: "VideoControls",
|
|
75
76
|
class: "vxo8xch",
|
|
76
|
-
propsAsIs:
|
|
77
|
-
}),
|
|
77
|
+
propsAsIs: false
|
|
78
|
+
}), n = /* @__PURE__ */ styled_default("button")({
|
|
78
79
|
name: "ControlBtn",
|
|
79
80
|
class: "coyuzu0",
|
|
80
|
-
propsAsIs:
|
|
81
|
-
}),
|
|
81
|
+
propsAsIs: false
|
|
82
|
+
}), t = () => n, O = /* @__PURE__ */ styled_default(t())({
|
|
82
83
|
name: "MuteIcon",
|
|
83
84
|
class: "musmi9a",
|
|
84
|
-
propsAsIs:
|
|
85
|
-
}),
|
|
85
|
+
propsAsIs: true
|
|
86
|
+
}), e = () => n, S = /* @__PURE__ */ styled_default(e())({
|
|
86
87
|
name: "PauseIcon",
|
|
87
88
|
class: "p1qe7rum",
|
|
88
|
-
propsAsIs:
|
|
89
|
-
}),
|
|
89
|
+
propsAsIs: true
|
|
90
|
+
}), c = () => n, W = /* @__PURE__ */ styled_default(c())({
|
|
90
91
|
name: "PlayIcon",
|
|
91
92
|
class: "psevery",
|
|
92
|
-
propsAsIs:
|
|
93
|
-
}),
|
|
93
|
+
propsAsIs: true
|
|
94
|
+
}), a = /* @__PURE__ */ styled_default("button")({
|
|
94
95
|
name: "WebOSIconButton",
|
|
95
96
|
class: "w1q3u7py",
|
|
96
|
-
propsAsIs:
|
|
97
|
-
}),
|
|
97
|
+
propsAsIs: false
|
|
98
|
+
}), p = () => a, o = /* @__PURE__ */ styled_default(p())({
|
|
98
99
|
name: "WebOSIconButtonAnimation",
|
|
99
100
|
class: "wdlqvum",
|
|
100
|
-
propsAsIs:
|
|
101
|
-
}),
|
|
101
|
+
propsAsIs: true
|
|
102
|
+
}), l = () => o, d = /* @__PURE__ */ styled_default(l())({
|
|
102
103
|
name: "WebOSIconButtonPlay",
|
|
103
104
|
class: "w1ylz9ea",
|
|
104
|
-
propsAsIs:
|
|
105
|
-
}),
|
|
105
|
+
propsAsIs: true
|
|
106
|
+
}), r = () => o, C = /* @__PURE__ */ styled_default(r())({
|
|
106
107
|
name: "WebOSIconButtonPause",
|
|
107
108
|
class: "w1iylt55",
|
|
108
|
-
propsAsIs:
|
|
109
|
-
}),
|
|
109
|
+
propsAsIs: true
|
|
110
|
+
}), u = () => o, f = /* @__PURE__ */ styled_default(u())({
|
|
110
111
|
name: "WebOSIconButtonMute",
|
|
111
112
|
class: "w8h4h7",
|
|
112
|
-
propsAsIs:
|
|
113
|
-
}),
|
|
113
|
+
propsAsIs: true
|
|
114
|
+
}), I = () => o, v = /* @__PURE__ */ styled_default(I())({
|
|
114
115
|
name: "WebOSIconButtonUnmute",
|
|
115
116
|
class: "w12l12kt",
|
|
116
|
-
propsAsIs:
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
117
|
+
propsAsIs: true
|
|
118
|
+
});
|
|
119
|
+
const It = (r2) => {
|
|
120
|
+
for (const s of r2)
|
|
121
|
+
s.isIntersecting ? s.target instanceof HTMLVideoElement && s.target.autoplay && s.target.play() : s.target instanceof HTMLVideoElement && !s.target.paused && s.target.pause();
|
|
122
|
+
}, $ = new IntersectionObserver(It, { threshold: 0.5 }), D = /* @__PURE__ */ new Set(), Bt = (r2) => {
|
|
123
|
+
$.observe(r2), D.add(r2);
|
|
124
|
+
}, Ot = (r2) => {
|
|
125
|
+
$.unobserve(r2), D.delete(r2);
|
|
126
|
+
}, wt = () => {
|
|
127
|
+
for (const r2 of D)
|
|
128
|
+
r2 instanceof HTMLVideoElement && !r2.paused && r2.pause();
|
|
127
129
|
};
|
|
128
|
-
function
|
|
129
|
-
return
|
|
130
|
+
function yt(...r2) {
|
|
131
|
+
return useCallback(
|
|
130
132
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
|
-
(
|
|
132
|
-
for (const
|
|
133
|
-
|
|
133
|
+
(s) => {
|
|
134
|
+
for (const c2 of r2)
|
|
135
|
+
c2 !== null && (typeof c2 == "function" ? c2(s) : c2 && (c2.current = s));
|
|
134
136
|
},
|
|
135
137
|
// Re-run the callback if the array of refs changes
|
|
136
138
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
137
|
-
[...
|
|
139
|
+
[...r2]
|
|
138
140
|
);
|
|
139
141
|
}
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
] }) : null,
|
|
144
|
-
loading:
|
|
145
|
-
autoPlay:
|
|
146
|
-
playMuted:
|
|
147
|
-
playing:
|
|
148
|
-
played:
|
|
149
|
-
unmute:
|
|
150
|
-
mute:
|
|
151
|
-
isMuted:
|
|
152
|
-
hasNotPausedVideo:
|
|
153
|
-
hasInteractedWithAudio:
|
|
154
|
-
}) => /* @__PURE__ */
|
|
155
|
-
!
|
|
156
|
-
!
|
|
157
|
-
] }),
|
|
142
|
+
const Lt = O$1(i), Pt = ({ loading: r2, autoPlay: s, played: c2, playing: i2, isMuted: f2, unmute: d2, mute: h2, togglePlaying: l2 }) => !r2 && !s && !c2 ? /* @__PURE__ */ jsx(B, { children: i2 ? /* @__PURE__ */ jsx(B1, { name: "icon-pause" }) : /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) : c2 ? /* @__PURE__ */ jsxs(P, { children: [
|
|
143
|
+
i2 ? /* @__PURE__ */ jsx(S, { onClick: l2 }) : /* @__PURE__ */ jsx(W, { onClick: l2 }),
|
|
144
|
+
/* @__PURE__ */ jsx(O, { className: cx_default(!f2 && "muted"), onClick: f2 ? d2 : h2 })
|
|
145
|
+
] }) : null, Tt = ({
|
|
146
|
+
loading: r2,
|
|
147
|
+
autoPlay: s,
|
|
148
|
+
playMuted: c2,
|
|
149
|
+
playing: i2,
|
|
150
|
+
played: f$1,
|
|
151
|
+
unmute: d$12,
|
|
152
|
+
mute: h2,
|
|
153
|
+
isMuted: l2,
|
|
154
|
+
hasNotPausedVideo: p2,
|
|
155
|
+
hasInteractedWithAudio: w
|
|
156
|
+
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
157
|
+
!r2 && !(s && c2) && /* @__PURE__ */ jsx(B, { "data-control-btn": "true", children: i2 ? p2 ? null : /* @__PURE__ */ jsx(d, { children: /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) : f$1 ? /* @__PURE__ */ jsx(C, { children: /* @__PURE__ */ jsx(B1, { name: "icon-pause" }) }) : /* @__PURE__ */ jsx(a, { "data-control-icon": "true", children: /* @__PURE__ */ jsx(B1, { name: "icon-play" }) }) }),
|
|
158
|
+
!r2 && s && c2 && w && /* @__PURE__ */ jsx(B, { children: l2 ? /* @__PURE__ */ jsx(f, { onClick: d$12, children: /* @__PURE__ */ jsx(B1, { name: "iconMute" }) }) : /* @__PURE__ */ jsx(v, { onClick: h2, children: /* @__PURE__ */ jsx(B1, { name: "iconUnMute" }) }) })
|
|
159
|
+
] }), Et = forwardRef(
|
|
158
160
|
({
|
|
159
|
-
poster:
|
|
160
|
-
source:
|
|
161
|
-
aspectRatio:
|
|
162
|
-
controlVideo:
|
|
163
|
-
onReplay:
|
|
164
|
-
onPlay:
|
|
165
|
-
onPause:
|
|
166
|
-
onEnd:
|
|
167
|
-
onRender:
|
|
168
|
-
onMute:
|
|
169
|
-
onQuartile:
|
|
170
|
-
autoPlay:
|
|
171
|
-
playMuted:
|
|
172
|
-
className:
|
|
173
|
-
muted:
|
|
174
|
-
webos:
|
|
175
|
-
hasNotPausedVideo:
|
|
176
|
-
},
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}, [
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
}, [
|
|
184
|
-
|
|
185
|
-
}, [
|
|
186
|
-
|
|
187
|
-
}, []),
|
|
188
|
-
(
|
|
189
|
-
|
|
161
|
+
poster: r2,
|
|
162
|
+
source: s,
|
|
163
|
+
aspectRatio: c2,
|
|
164
|
+
controlVideo: i2,
|
|
165
|
+
onReplay: f2,
|
|
166
|
+
onPlay: d2,
|
|
167
|
+
onPause: h2,
|
|
168
|
+
onEnd: l2,
|
|
169
|
+
onRender: p2,
|
|
170
|
+
onMute: w,
|
|
171
|
+
onQuartile: u2,
|
|
172
|
+
autoPlay: v2,
|
|
173
|
+
playMuted: S2,
|
|
174
|
+
className: K,
|
|
175
|
+
muted: y$12,
|
|
176
|
+
webos: T,
|
|
177
|
+
hasNotPausedVideo: V
|
|
178
|
+
}, R) => {
|
|
179
|
+
const n2 = useRef(null), Q = yt(n2, R), x$1 = useRef(false), E = useRef(false), m = useRef(/* @__PURE__ */ new Set()), [z, G2] = useState(false), [W2, k] = useState(false), [j, J] = useState(false), [X, H] = useState(true), [A$12, U] = useState(S2), [q, tt] = useState(false);
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
s && (U(S2), G2(false));
|
|
182
|
+
}, [s]);
|
|
183
|
+
const C2 = useCallback(() => {
|
|
184
|
+
i2 == null || i2({ muted: false });
|
|
185
|
+
}, [i2]), Y = useCallback(() => {
|
|
186
|
+
i2 == null || i2({ muted: true });
|
|
187
|
+
}, [i2]), I2 = useCallback((t2) => {
|
|
188
|
+
t2 == null || t2.stopPropagation(), n2.current && (n2.current.muted = true), U(true);
|
|
189
|
+
}, []), L = useCallback(
|
|
190
|
+
(t2) => {
|
|
191
|
+
t2 == null || t2.stopPropagation(), n2.current && (n2.current.muted = false), U(false), q || tt(true);
|
|
190
192
|
},
|
|
191
|
-
[
|
|
193
|
+
[q]
|
|
192
194
|
);
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}, [
|
|
196
|
-
const
|
|
197
|
-
var
|
|
198
|
-
(
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
if (
|
|
202
|
-
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
y$12 !== void 0 && (y$12 ? I2() : L());
|
|
197
|
+
}, [I2, y$12, L]);
|
|
198
|
+
const Z = (t2) => {
|
|
199
|
+
var b2;
|
|
200
|
+
(b2 = t2.stopPropagation) == null || b2.call(t2);
|
|
201
|
+
const o2 = n2 == null ? void 0 : n2.current;
|
|
202
|
+
if (o2)
|
|
203
|
+
if (W2)
|
|
204
|
+
o2.pause();
|
|
203
205
|
else {
|
|
204
|
-
const
|
|
205
|
-
if (!
|
|
206
|
+
const a2 = n2 == null ? void 0 : n2.current;
|
|
207
|
+
if (!a2)
|
|
206
208
|
return;
|
|
207
|
-
|
|
209
|
+
wt(), a2.play().catch((rt) => console.log(rt)), H(false);
|
|
208
210
|
}
|
|
209
|
-
},
|
|
210
|
-
var
|
|
211
|
-
(
|
|
211
|
+
}, et = () => {
|
|
212
|
+
var t2;
|
|
213
|
+
(t2 = n2 == null ? void 0 : n2.current) == null || t2.load(), H(true);
|
|
212
214
|
};
|
|
213
|
-
return
|
|
214
|
-
|
|
215
|
-
}, [
|
|
216
|
-
const
|
|
217
|
-
return
|
|
218
|
-
|
|
215
|
+
return useEffect(() => () => {
|
|
216
|
+
C2();
|
|
217
|
+
}, [C2]), useEffect(() => {
|
|
218
|
+
const t2 = n2.current;
|
|
219
|
+
return t2 ? (E.current = t2.muted, U(t2.muted), Bt(t2), () => {
|
|
220
|
+
Ot(t2);
|
|
219
221
|
}) : () => {
|
|
220
222
|
};
|
|
221
|
-
}, []),
|
|
222
|
-
|
|
223
|
-
}, [
|
|
224
|
-
|
|
225
|
-
}, [
|
|
226
|
-
|
|
223
|
+
}, []), useEffect(() => {
|
|
224
|
+
p2 == null || p2();
|
|
225
|
+
}, [p2]), useEffect(() => {
|
|
226
|
+
m.current.clear(), x$1.current = false;
|
|
227
|
+
}, [s]), /* @__PURE__ */ jsxs(
|
|
228
|
+
Lt,
|
|
227
229
|
{
|
|
228
|
-
webos:
|
|
229
|
-
onClick:
|
|
230
|
+
webos: T,
|
|
231
|
+
onClick: v2 && S2 ? A$12 ? L : I2 : Z,
|
|
230
232
|
"data-a": "intr",
|
|
231
|
-
autoFocus:
|
|
233
|
+
autoFocus: true,
|
|
232
234
|
options: { focusKey: "video-play-btn" },
|
|
233
|
-
className:
|
|
234
|
-
style:
|
|
235
|
+
className: cx_default(W2 && !T && x, v2 && y, K),
|
|
236
|
+
style: c2 ? { aspectRatio: c2 } : {},
|
|
235
237
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
|
|
238
|
+
/* @__PURE__ */ jsx(
|
|
239
|
+
A,
|
|
238
240
|
{
|
|
239
|
-
ref:
|
|
240
|
-
src:
|
|
241
|
-
autoPlay:
|
|
241
|
+
ref: Q,
|
|
242
|
+
src: s,
|
|
243
|
+
autoPlay: v2,
|
|
242
244
|
onPlay: () => {
|
|
243
|
-
|
|
245
|
+
G2(true), x$1.current && (f2 == null || f2(), m.current.clear()), k(true), H(false), d2 == null || d2(), S2 ? I2() : Y();
|
|
244
246
|
},
|
|
245
|
-
onTimeUpdate: (
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
|
|
247
|
+
onTimeUpdate: (t2) => {
|
|
248
|
+
const o2 = t2.target.duration, b2 = t2.target.currentTime;
|
|
249
|
+
if (o2 && b2) {
|
|
250
|
+
const a2 = Math.floor(b2 / o2 * 100);
|
|
251
|
+
a2 >= 25 && a2 < 50 && !m.current.has(25) ? (u2 == null || u2(25), m.current.add(25)) : a2 >= 50 && a2 < 75 && !m.current.has(50) ? (u2 == null || u2(50), m.current.add(50)) : a2 >= 75 && !m.current.has(75) && (u2 == null || u2(75), m.current.add(75));
|
|
250
252
|
}
|
|
251
253
|
},
|
|
252
|
-
onVolumeChange: (
|
|
253
|
-
const
|
|
254
|
-
|
|
254
|
+
onVolumeChange: (t2) => {
|
|
255
|
+
const o2 = t2.target.muted;
|
|
256
|
+
E.current !== o2 && (w == null || w(o2), E.current = o2, (o2 !== y$12 || y$12 === void 0) && (o2 ? C2() : Y()));
|
|
255
257
|
},
|
|
256
|
-
onError: async (
|
|
258
|
+
onError: async (t2) => {
|
|
257
259
|
try {
|
|
258
|
-
if (
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
|
|
260
|
+
if (t2.target instanceof HTMLVideoElement) {
|
|
261
|
+
J(true);
|
|
262
|
+
const b2 = await (await fetch(t2.target.src)).blob(), a2 = URL.createObjectURL(b2);
|
|
263
|
+
t2.target.src = a2;
|
|
262
264
|
}
|
|
263
|
-
} catch (
|
|
264
|
-
console.error("video fallback fetch failed",
|
|
265
|
+
} catch (o2) {
|
|
266
|
+
console.error("video fallback fetch failed", o2), k(true), H(true);
|
|
265
267
|
} finally {
|
|
266
|
-
|
|
268
|
+
J(false), C2();
|
|
267
269
|
}
|
|
268
270
|
},
|
|
269
271
|
onPause: () => {
|
|
270
|
-
|
|
272
|
+
k(false), h2 == null || h2(), C2();
|
|
271
273
|
},
|
|
272
274
|
onEnded: () => {
|
|
273
|
-
|
|
275
|
+
k(false), x$1.current = true, et(), l2 == null || l2(), C2();
|
|
274
276
|
},
|
|
275
|
-
style: { visibility:
|
|
276
|
-
controls:
|
|
277
|
-
playsInline:
|
|
277
|
+
style: { visibility: X ? "hidden" : "visible" },
|
|
278
|
+
controls: false,
|
|
279
|
+
playsInline: true
|
|
278
280
|
}
|
|
279
281
|
),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
!
|
|
282
|
-
|
|
282
|
+
/* @__PURE__ */ jsx(b, { src: r2, style: { visibility: X ? "visible" : "hidden" } }),
|
|
283
|
+
!T && /* @__PURE__ */ jsx(
|
|
284
|
+
Pt,
|
|
283
285
|
{
|
|
284
|
-
loading:
|
|
285
|
-
autoPlay:
|
|
286
|
-
played:
|
|
287
|
-
playing:
|
|
288
|
-
isMuted:
|
|
289
|
-
unmute:
|
|
290
|
-
mute:
|
|
291
|
-
togglePlaying:
|
|
286
|
+
loading: j,
|
|
287
|
+
autoPlay: v2,
|
|
288
|
+
played: z,
|
|
289
|
+
playing: W2,
|
|
290
|
+
isMuted: A$12,
|
|
291
|
+
unmute: L,
|
|
292
|
+
mute: I2,
|
|
293
|
+
togglePlaying: Z
|
|
292
294
|
}
|
|
293
295
|
),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
+
T && /* @__PURE__ */ jsx(
|
|
297
|
+
Tt,
|
|
296
298
|
{
|
|
297
|
-
loading:
|
|
298
|
-
autoPlay:
|
|
299
|
-
playMuted:
|
|
300
|
-
playing:
|
|
301
|
-
played:
|
|
302
|
-
unmute:
|
|
303
|
-
mute:
|
|
304
|
-
isMuted:
|
|
305
|
-
hasNotPausedVideo:
|
|
306
|
-
hasInteractedWithAudio:
|
|
299
|
+
loading: j,
|
|
300
|
+
autoPlay: v2,
|
|
301
|
+
playMuted: S2,
|
|
302
|
+
playing: W2,
|
|
303
|
+
played: z,
|
|
304
|
+
unmute: L,
|
|
305
|
+
mute: I2,
|
|
306
|
+
isMuted: A$12,
|
|
307
|
+
hasNotPausedVideo: V,
|
|
308
|
+
hasInteractedWithAudio: q
|
|
307
309
|
}
|
|
308
310
|
),
|
|
309
|
-
|
|
311
|
+
j && /* @__PURE__ */ jsx(B, { children: /* @__PURE__ */ jsx(d$1, {}) })
|
|
310
312
|
]
|
|
311
313
|
}
|
|
312
314
|
);
|
|
313
315
|
}
|
|
314
316
|
);
|
|
315
317
|
export {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
318
|
+
Et as E,
|
|
319
|
+
wt as w,
|
|
320
|
+
y$1 as y
|
|
319
321
|
};
|