@streamlayer/react-ui 1.31.7 → 1.32.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/webos/ExposedPauseAd/PauseAd.d.ts +6 -3
- package/lib/app/webos/ExposedPauseAd/PauseAd.js +99 -77
- package/lib/app/webos/index.d.ts +5 -2
- package/lib/app/webos/index.js +22 -21
- package/lib/assets/style.css +1 -1
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.d.ts +1 -0
- package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMStatic.js +56 -31
- package/package.json +16 -16
|
@@ -1,44 +1,69 @@
|
|
|
1
1
|
import { _ as C } from "../../../../../vast-client.min-B0NUra1B.js";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { useRef as P, useCallback as k } from "react";
|
|
3
|
+
import { eventBus as l } from "@streamlayer/sdk-web-interfaces";
|
|
4
|
+
import { createLogger as I } from "@streamlayer/sdk-web-logger";
|
|
5
|
+
import { m as K } from "../../../../../index-DSi8Qgfs.js";
|
|
6
|
+
const V = {}, B = new C(), i = K(V), d = I("ui:gam-static"), b = (n) => new Promise((m, e) => {
|
|
7
|
+
const r = new Image();
|
|
8
|
+
r.onload = () => m(n), r.onerror = () => e(), r.src = n;
|
|
9
|
+
}), $ = () => {
|
|
10
|
+
const n = P(0);
|
|
11
|
+
return [k(async (e) => {
|
|
12
|
+
var p, g, f, v, y, A, T, R, S, w, h;
|
|
13
|
+
if ((p = i.get()[e]) != null && p.imageSrc)
|
|
13
14
|
return { success: !0 };
|
|
14
|
-
const
|
|
15
|
-
n.current =
|
|
15
|
+
const r = Date.now();
|
|
16
|
+
n.current = r, i.setKey(e, { id: "", url: e });
|
|
16
17
|
try {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
l.emit("exposedPauseAd", {
|
|
19
|
+
action: "load",
|
|
20
|
+
payload: {}
|
|
21
|
+
});
|
|
22
|
+
const c = await B.get(e);
|
|
23
|
+
if (d.debug(c, "parsedVAST"), n.current === r && i.get()[e].url) {
|
|
24
|
+
const t = c.ads.find((s) => s.creatives.length > 0);
|
|
25
|
+
if (t) {
|
|
26
|
+
d.debug(t, "validAd");
|
|
27
|
+
const s = t.creatives.find((o) => o.type === "nonlinear");
|
|
28
|
+
if (s) {
|
|
29
|
+
d.debug(s, "nonlinear");
|
|
30
|
+
const o = (f = (g = s.variations) == null ? void 0 : g[0]) == null ? void 0 : f.staticResource, x = (y = (v = s.variations) == null ? void 0 : v[0]) == null ? void 0 : y.nonlinearClickThroughURLTemplate;
|
|
31
|
+
if (o)
|
|
32
|
+
return await b(o), i.setKey(e, {
|
|
33
|
+
id: t.id || "",
|
|
34
|
+
url: e,
|
|
35
|
+
imageSrc: o,
|
|
36
|
+
adUrl: x
|
|
37
|
+
}), l.emit("exposedPauseAd", {
|
|
38
|
+
action: "loaded",
|
|
39
|
+
payload: {
|
|
40
|
+
id: t.id || ""
|
|
41
|
+
}
|
|
42
|
+
}), { success: !0 };
|
|
28
43
|
}
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
return await
|
|
44
|
+
const a = t.creatives.find((o) => o.type === "companion");
|
|
45
|
+
d.debug(a, "companion");
|
|
46
|
+
const u = (S = (R = (T = (A = a == null ? void 0 : a.variations) == null ? void 0 : A[0]) == null ? void 0 : T.staticResources) == null ? void 0 : R[0]) == null ? void 0 : S.url, L = (h = (w = a == null ? void 0 : a.variations) == null ? void 0 : w[0]) == null ? void 0 : h.companionClickThroughURLTemplate;
|
|
47
|
+
if (u)
|
|
48
|
+
return await b(u), i.setKey(e, {
|
|
49
|
+
id: t.id || "",
|
|
50
|
+
url: e,
|
|
51
|
+
imageSrc: u,
|
|
52
|
+
adUrl: L
|
|
53
|
+
}), l.emit("exposedPauseAd", {
|
|
54
|
+
action: "loaded",
|
|
55
|
+
payload: {
|
|
56
|
+
id: t.id || ""
|
|
57
|
+
}
|
|
58
|
+
}), { success: !0 };
|
|
34
59
|
}
|
|
35
60
|
}
|
|
36
61
|
} catch (c) {
|
|
37
62
|
console.error("Error parsing VAST", c);
|
|
38
63
|
}
|
|
39
64
|
return { success: !1 };
|
|
40
|
-
}, []),
|
|
65
|
+
}, []), i];
|
|
41
66
|
};
|
|
42
67
|
export {
|
|
43
|
-
|
|
68
|
+
$ as useLoadGAMStatic
|
|
44
69
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
],
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@lottiefiles/react-lottie-player": "^3.5.4",
|
|
79
|
-
"@streamlayer/sl-eslib": "^5.
|
|
79
|
+
"@streamlayer/sl-eslib": "^5.225.0",
|
|
80
80
|
"@types/lodash.throttle": "^4.1.9",
|
|
81
81
|
"lodash.throttle": "^4.1.1",
|
|
82
82
|
"react-infinite-scroller": "^1.2.6",
|
|
@@ -85,19 +85,19 @@
|
|
|
85
85
|
"@noriginmedia/norigin-spatial-navigation": "^2.3.0",
|
|
86
86
|
"react-window-infinite-loader": "^1.0.9",
|
|
87
87
|
"uuid": "^11.1.0",
|
|
88
|
-
"@streamlayer/feature-gamification": "^1.
|
|
89
|
-
"@streamlayer/react-polyfills": "^0.1.
|
|
90
|
-
"@streamlayer/sdk-web": "^1.
|
|
91
|
-
"@streamlayer/sdk-web
|
|
92
|
-
"@streamlayer/sdk-web-anonymous-auth": "^1.
|
|
93
|
-
"@streamlayer/sdk-web-
|
|
94
|
-
"@streamlayer/sdk-web-
|
|
95
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
96
|
-
"@streamlayer/sdk-web-interfaces": "^1.
|
|
97
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
98
|
-
"@streamlayer/sdk-web-notifications": "^1.3.
|
|
99
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
100
|
-
"@streamlayer/sdk-web-types": "^1.
|
|
88
|
+
"@streamlayer/feature-gamification": "^1.23.0",
|
|
89
|
+
"@streamlayer/react-polyfills": "^0.1.45",
|
|
90
|
+
"@streamlayer/sdk-web-analytics": "^1.13.0",
|
|
91
|
+
"@streamlayer/sdk-web": "^1.16.0",
|
|
92
|
+
"@streamlayer/sdk-web-anonymous-auth": "^1.3.0",
|
|
93
|
+
"@streamlayer/sdk-web-core": "^1.17.0",
|
|
94
|
+
"@streamlayer/sdk-web-api": "^1.14.0",
|
|
95
|
+
"@streamlayer/sdk-web-features": "^1.0.85",
|
|
96
|
+
"@streamlayer/sdk-web-interfaces": "^1.8.0",
|
|
97
|
+
"@streamlayer/sdk-web-logger": "^1.0.85",
|
|
98
|
+
"@streamlayer/sdk-web-notifications": "^1.3.47",
|
|
99
|
+
"@streamlayer/sdk-web-storage": "^1.0.85",
|
|
100
|
+
"@streamlayer/sdk-web-types": "^1.16.0"
|
|
101
101
|
},
|
|
102
102
|
"nx": {
|
|
103
103
|
"implicitDependencies": [
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"vite-plugin-svgr": "^4.2.0",
|
|
140
140
|
"vite-svg-loader": "^5.1.0",
|
|
141
141
|
"vite-tsconfig-paths": "^5.0.1",
|
|
142
|
-
"@streamlayer/react": "^1.
|
|
142
|
+
"@streamlayer/react": "^1.21.0"
|
|
143
143
|
},
|
|
144
144
|
"dependencies": {
|
|
145
145
|
"@dailymotion/vast-client": "^6.4.2",
|