stormcloud-video-player 0.7.49 → 0.8.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/README.md +269 -228
- package/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +5197 -6741
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +196 -195
- package/lib/index.d.ts +196 -195
- package/lib/index.js +5326 -6862
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +4802 -3170
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +113 -70
- package/lib/players/FilePlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +4810 -3179
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +4877 -3246
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +1021 -0
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -0
- package/lib/sdk/hlsAdPlayer.d.cts +10 -0
- package/lib/sdk/pal.cjs +358 -0
- package/lib/sdk/pal.cjs.map +1 -0
- package/lib/sdk/pal.d.cts +28 -0
- package/lib/{types-CIHDHY7A.d.cts → types-DDwAfBLt.d.cts} +11 -10
- package/lib/ui/StormcloudVideoPlayer.cjs +5070 -6603
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -14
- package/lib/utils/browserCompat.cjs +10 -114
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/browserCompat.d.cts +3 -7
- package/lib/utils/polyfills.cjs.map +1 -1
- package/lib/utils/tracking.cjs +179 -150
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +11 -6
- package/package.json +1 -2
- package/lib/sdk/adstormPlayer.cjs +0 -1567
- package/lib/sdk/adstormPlayer.cjs.map +0 -1
- package/lib/sdk/adstormPlayer.d.cts +0 -23
- package/lib/sdk/vastParser.cjs +0 -517
- package/lib/sdk/vastParser.cjs.map +0 -1
- package/lib/sdk/vastParser.d.cts +0 -45
- package/lib/ui/OverlayRenderer.cjs +0 -2370
- package/lib/ui/OverlayRenderer.cjs.map +0 -1
- package/lib/ui/OverlayRenderer.d.cts +0 -17
- package/lib/utils/adcision.cjs +0 -282
- package/lib/utils/adcision.cjs.map +0 -1
- package/lib/utils/adcision.d.cts +0 -31
- package/lib/utils/overlays.cjs +0 -354
- package/lib/utils/overlays.cjs.map +0 -1
- package/lib/utils/overlays.d.cts +0 -70
package/lib/utils/adcision.cjs
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3
|
-
try {
|
|
4
|
-
var info = gen[key](arg);
|
|
5
|
-
var value = info.value;
|
|
6
|
-
} catch (error) {
|
|
7
|
-
reject(error);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (info.done) {
|
|
11
|
-
resolve(value);
|
|
12
|
-
} else {
|
|
13
|
-
Promise.resolve(value).then(_next, _throw);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _async_to_generator(fn) {
|
|
17
|
-
return function() {
|
|
18
|
-
var self = this, args = arguments;
|
|
19
|
-
return new Promise(function(resolve, reject) {
|
|
20
|
-
var gen = fn.apply(self, args);
|
|
21
|
-
function _next(value) {
|
|
22
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
23
|
-
}
|
|
24
|
-
function _throw(err) {
|
|
25
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
26
|
-
}
|
|
27
|
-
_next(undefined);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function _type_of(obj) {
|
|
32
|
-
"@swc/helpers - typeof";
|
|
33
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
34
|
-
}
|
|
35
|
-
function _ts_generator(thisArg, body) {
|
|
36
|
-
var f, y, t, _ = {
|
|
37
|
-
label: 0,
|
|
38
|
-
sent: function() {
|
|
39
|
-
if (t[0] & 1) throw t[1];
|
|
40
|
-
return t[1];
|
|
41
|
-
},
|
|
42
|
-
trys: [],
|
|
43
|
-
ops: []
|
|
44
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
45
|
-
return d(g, "next", {
|
|
46
|
-
value: verb(0)
|
|
47
|
-
}), d(g, "throw", {
|
|
48
|
-
value: verb(1)
|
|
49
|
-
}), d(g, "return", {
|
|
50
|
-
value: verb(2)
|
|
51
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
52
|
-
value: function() {
|
|
53
|
-
return this;
|
|
54
|
-
}
|
|
55
|
-
}), g;
|
|
56
|
-
function verb(n) {
|
|
57
|
-
return function(v) {
|
|
58
|
-
return step([
|
|
59
|
-
n,
|
|
60
|
-
v
|
|
61
|
-
]);
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function step(op) {
|
|
65
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
66
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
67
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
68
|
-
if (y = 0, t) op = [
|
|
69
|
-
op[0] & 2,
|
|
70
|
-
t.value
|
|
71
|
-
];
|
|
72
|
-
switch(op[0]){
|
|
73
|
-
case 0:
|
|
74
|
-
case 1:
|
|
75
|
-
t = op;
|
|
76
|
-
break;
|
|
77
|
-
case 4:
|
|
78
|
-
_.label++;
|
|
79
|
-
return {
|
|
80
|
-
value: op[1],
|
|
81
|
-
done: false
|
|
82
|
-
};
|
|
83
|
-
case 5:
|
|
84
|
-
_.label++;
|
|
85
|
-
y = op[1];
|
|
86
|
-
op = [
|
|
87
|
-
0
|
|
88
|
-
];
|
|
89
|
-
continue;
|
|
90
|
-
case 7:
|
|
91
|
-
op = _.ops.pop();
|
|
92
|
-
_.trys.pop();
|
|
93
|
-
continue;
|
|
94
|
-
default:
|
|
95
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
96
|
-
_ = 0;
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
100
|
-
_.label = op[1];
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
104
|
-
_.label = t[1];
|
|
105
|
-
t = op;
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
if (t && _.label < t[2]) {
|
|
109
|
-
_.label = t[2];
|
|
110
|
-
_.ops.push(op);
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
if (t[2]) _.ops.pop();
|
|
114
|
-
_.trys.pop();
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
op = body.call(thisArg, _);
|
|
118
|
-
} catch (e) {
|
|
119
|
-
op = [
|
|
120
|
-
6,
|
|
121
|
-
e
|
|
122
|
-
];
|
|
123
|
-
y = 0;
|
|
124
|
-
} finally{
|
|
125
|
-
f = t = 0;
|
|
126
|
-
}
|
|
127
|
-
if (op[0] & 5) throw op[1];
|
|
128
|
-
return {
|
|
129
|
-
value: op[0] ? op[1] : void 0,
|
|
130
|
-
done: true
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
var __defProp = Object.defineProperty;
|
|
135
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
136
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
137
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
138
|
-
var __export = function __export(target, all) {
|
|
139
|
-
for(var name in all)__defProp(target, name, {
|
|
140
|
-
get: all[name],
|
|
141
|
-
enumerable: true
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
var __copyProps = function __copyProps(to, from, except, desc) {
|
|
145
|
-
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
146
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
147
|
-
try {
|
|
148
|
-
var _loop = function() {
|
|
149
|
-
var key = _step.value;
|
|
150
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
151
|
-
get: function get() {
|
|
152
|
-
return from[key];
|
|
153
|
-
},
|
|
154
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
155
|
-
});
|
|
156
|
-
};
|
|
157
|
-
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
158
|
-
} catch (err) {
|
|
159
|
-
_didIteratorError = true;
|
|
160
|
-
_iteratorError = err;
|
|
161
|
-
} finally{
|
|
162
|
-
try {
|
|
163
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
164
|
-
_iterator.return();
|
|
165
|
-
}
|
|
166
|
-
} finally{
|
|
167
|
-
if (_didIteratorError) {
|
|
168
|
-
throw _iteratorError;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return to;
|
|
174
|
-
};
|
|
175
|
-
var __toCommonJS = function __toCommonJS(mod) {
|
|
176
|
-
return __copyProps(__defProp({}, "__esModule", {
|
|
177
|
-
value: true
|
|
178
|
-
}), mod);
|
|
179
|
-
};
|
|
180
|
-
// src/utils/adcision.ts
|
|
181
|
-
var adcision_exports = {};
|
|
182
|
-
__export(adcision_exports, {
|
|
183
|
-
fetchAdcisionChannel: function fetchAdcisionChannel1() {
|
|
184
|
-
return fetchAdcisionChannel;
|
|
185
|
-
},
|
|
186
|
-
fetchAdcisionChannelLiveContext: function fetchAdcisionChannelLiveContext1() {
|
|
187
|
-
return fetchAdcisionChannelLiveContext;
|
|
188
|
-
},
|
|
189
|
-
fetchAdcisionTemplates: function fetchAdcisionTemplates1() {
|
|
190
|
-
return fetchAdcisionTemplates;
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
module.exports = __toCommonJS(adcision_exports);
|
|
194
|
-
var ADCISION_API_BASE = "https://adstorm.co/api-adstorm-dev";
|
|
195
|
-
function fetchAdcisionChannel(_0) {
|
|
196
|
-
return _async_to_generator(function(channelId) {
|
|
197
|
-
var apiBaseUrl, response;
|
|
198
|
-
var _arguments = arguments;
|
|
199
|
-
return _ts_generator(this, function(_state) {
|
|
200
|
-
switch(_state.label){
|
|
201
|
-
case 0:
|
|
202
|
-
apiBaseUrl = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : ADCISION_API_BASE;
|
|
203
|
-
return [
|
|
204
|
-
4,
|
|
205
|
-
fetch("".concat(apiBaseUrl, "/adstorm/adcision/channels/").concat(channelId))
|
|
206
|
-
];
|
|
207
|
-
case 1:
|
|
208
|
-
response = _state.sent();
|
|
209
|
-
if (!response.ok) {
|
|
210
|
-
throw new Error("Failed to fetch adcision channel ".concat(channelId, ": ").concat(response.status, " ").concat(response.statusText));
|
|
211
|
-
}
|
|
212
|
-
return [
|
|
213
|
-
2,
|
|
214
|
-
response.json()
|
|
215
|
-
];
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
}).apply(this, arguments);
|
|
219
|
-
}
|
|
220
|
-
function fetchAdcisionChannelLiveContext(_0) {
|
|
221
|
-
return _async_to_generator(function(channelId) {
|
|
222
|
-
var apiBaseUrl, response;
|
|
223
|
-
var _arguments = arguments;
|
|
224
|
-
return _ts_generator(this, function(_state) {
|
|
225
|
-
switch(_state.label){
|
|
226
|
-
case 0:
|
|
227
|
-
apiBaseUrl = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : ADCISION_API_BASE;
|
|
228
|
-
return [
|
|
229
|
-
4,
|
|
230
|
-
fetch("".concat(apiBaseUrl, "/adstorm/adcision/channels/").concat(channelId, "/live-context"))
|
|
231
|
-
];
|
|
232
|
-
case 1:
|
|
233
|
-
response = _state.sent();
|
|
234
|
-
if (!response.ok) {
|
|
235
|
-
throw new Error("Failed to fetch adcision channel live context ".concat(channelId, ": ").concat(response.status, " ").concat(response.statusText));
|
|
236
|
-
}
|
|
237
|
-
return [
|
|
238
|
-
2,
|
|
239
|
-
response.json()
|
|
240
|
-
];
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}).apply(this, arguments);
|
|
244
|
-
}
|
|
245
|
-
function fetchAdcisionTemplates() {
|
|
246
|
-
return _async_to_generator(function() {
|
|
247
|
-
var apiBaseUrl, response, data;
|
|
248
|
-
var _arguments = arguments;
|
|
249
|
-
return _ts_generator(this, function(_state) {
|
|
250
|
-
switch(_state.label){
|
|
251
|
-
case 0:
|
|
252
|
-
apiBaseUrl = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : ADCISION_API_BASE;
|
|
253
|
-
return [
|
|
254
|
-
4,
|
|
255
|
-
fetch("".concat(apiBaseUrl, "/adstorm/adcision/templates"))
|
|
256
|
-
];
|
|
257
|
-
case 1:
|
|
258
|
-
response = _state.sent();
|
|
259
|
-
if (!response.ok) {
|
|
260
|
-
throw new Error("Failed to fetch adcision templates: ".concat(response.status, " ").concat(response.statusText));
|
|
261
|
-
}
|
|
262
|
-
return [
|
|
263
|
-
4,
|
|
264
|
-
response.json()
|
|
265
|
-
];
|
|
266
|
-
case 2:
|
|
267
|
-
data = _state.sent();
|
|
268
|
-
return [
|
|
269
|
-
2,
|
|
270
|
-
Array.isArray(data) ? data : []
|
|
271
|
-
];
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}).apply(this, arguments);
|
|
275
|
-
}
|
|
276
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
277
|
-
0 && (module.exports = {
|
|
278
|
-
fetchAdcisionChannel: fetchAdcisionChannel,
|
|
279
|
-
fetchAdcisionChannelLiveContext: fetchAdcisionChannelLiveContext,
|
|
280
|
-
fetchAdcisionTemplates: fetchAdcisionTemplates
|
|
281
|
-
});
|
|
282
|
-
//# sourceMappingURL=adcision.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/utils/adcision.cjs"],"names":[],"mappings":"AAAA","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/utils/adcision.ts\nvar adcision_exports = {};\n__export(adcision_exports, {\n fetchAdcisionChannel: () => fetchAdcisionChannel,\n fetchAdcisionChannelLiveContext: () => fetchAdcisionChannelLiveContext,\n fetchAdcisionTemplates: () => fetchAdcisionTemplates\n});\nmodule.exports = __toCommonJS(adcision_exports);\nvar ADCISION_API_BASE = \"https://adstorm.co/api-adstorm-dev\";\nasync function fetchAdcisionChannel(channelId, apiBaseUrl = ADCISION_API_BASE) {\n const response = await fetch(\n `${apiBaseUrl}/adstorm/adcision/channels/${channelId}`\n );\n if (!response.ok) {\n throw new Error(\n `Failed to fetch adcision channel ${channelId}: ${response.status} ${response.statusText}`\n );\n }\n return response.json();\n}\nasync function fetchAdcisionChannelLiveContext(channelId, apiBaseUrl = ADCISION_API_BASE) {\n const response = await fetch(\n `${apiBaseUrl}/adstorm/adcision/channels/${channelId}/live-context`\n );\n if (!response.ok) {\n throw new Error(\n `Failed to fetch adcision channel live context ${channelId}: ${response.status} ${response.statusText}`\n );\n }\n return response.json();\n}\nasync function fetchAdcisionTemplates(apiBaseUrl = ADCISION_API_BASE) {\n const response = await fetch(`${apiBaseUrl}/adstorm/adcision/templates`);\n if (!response.ok) {\n throw new Error(\n `Failed to fetch adcision templates: ${response.status} ${response.statusText}`\n );\n }\n const data = await response.json();\n return Array.isArray(data) ? data : [];\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n fetchAdcisionChannel,\n fetchAdcisionChannelLiveContext,\n fetchAdcisionTemplates\n});\n"]}
|
package/lib/utils/adcision.d.cts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
interface AdcisionChannel {
|
|
2
|
-
id: number;
|
|
3
|
-
template_id: number;
|
|
4
|
-
name: string;
|
|
5
|
-
stream_url: string;
|
|
6
|
-
position: number;
|
|
7
|
-
is_active: boolean;
|
|
8
|
-
created_at: string;
|
|
9
|
-
updated_at: string;
|
|
10
|
-
}
|
|
11
|
-
interface AdcisionTemplate {
|
|
12
|
-
id: number;
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
is_active: boolean;
|
|
16
|
-
created_at: string;
|
|
17
|
-
updated_at: string;
|
|
18
|
-
channels: AdcisionChannel[];
|
|
19
|
-
}
|
|
20
|
-
declare function fetchAdcisionChannel(channelId: number, apiBaseUrl?: string): Promise<AdcisionChannel>;
|
|
21
|
-
interface AdcisionChannelLiveContext {
|
|
22
|
-
id: number;
|
|
23
|
-
channel_id: number;
|
|
24
|
-
keywords: string[];
|
|
25
|
-
context: string;
|
|
26
|
-
updated_at: string;
|
|
27
|
-
}
|
|
28
|
-
declare function fetchAdcisionChannelLiveContext(channelId: number, apiBaseUrl?: string): Promise<AdcisionChannelLiveContext>;
|
|
29
|
-
declare function fetchAdcisionTemplates(apiBaseUrl?: string): Promise<AdcisionTemplate[]>;
|
|
30
|
-
|
|
31
|
-
export { type AdcisionChannel, type AdcisionChannelLiveContext, type AdcisionTemplate, fetchAdcisionChannel, fetchAdcisionChannelLiveContext, fetchAdcisionTemplates };
|
package/lib/utils/overlays.cjs
DELETED
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3
|
-
try {
|
|
4
|
-
var info = gen[key](arg);
|
|
5
|
-
var value = info.value;
|
|
6
|
-
} catch (error) {
|
|
7
|
-
reject(error);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (info.done) {
|
|
11
|
-
resolve(value);
|
|
12
|
-
} else {
|
|
13
|
-
Promise.resolve(value).then(_next, _throw);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _async_to_generator(fn) {
|
|
17
|
-
return function() {
|
|
18
|
-
var self = this, args = arguments;
|
|
19
|
-
return new Promise(function(resolve, reject) {
|
|
20
|
-
var gen = fn.apply(self, args);
|
|
21
|
-
function _next(value) {
|
|
22
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
23
|
-
}
|
|
24
|
-
function _throw(err) {
|
|
25
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
26
|
-
}
|
|
27
|
-
_next(undefined);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function _define_property(obj, key, value) {
|
|
32
|
-
if (key in obj) {
|
|
33
|
-
Object.defineProperty(obj, key, {
|
|
34
|
-
value: value,
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true
|
|
38
|
-
});
|
|
39
|
-
} else {
|
|
40
|
-
obj[key] = value;
|
|
41
|
-
}
|
|
42
|
-
return obj;
|
|
43
|
-
}
|
|
44
|
-
function _object_spread(target) {
|
|
45
|
-
for(var i = 1; i < arguments.length; i++){
|
|
46
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
47
|
-
var ownKeys = Object.keys(source);
|
|
48
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
49
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
50
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
ownKeys.forEach(function(key) {
|
|
54
|
-
_define_property(target, key, source[key]);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return target;
|
|
58
|
-
}
|
|
59
|
-
function _type_of(obj) {
|
|
60
|
-
"@swc/helpers - typeof";
|
|
61
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
62
|
-
}
|
|
63
|
-
function _ts_generator(thisArg, body) {
|
|
64
|
-
var f, y, t, _ = {
|
|
65
|
-
label: 0,
|
|
66
|
-
sent: function() {
|
|
67
|
-
if (t[0] & 1) throw t[1];
|
|
68
|
-
return t[1];
|
|
69
|
-
},
|
|
70
|
-
trys: [],
|
|
71
|
-
ops: []
|
|
72
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
73
|
-
return d(g, "next", {
|
|
74
|
-
value: verb(0)
|
|
75
|
-
}), d(g, "throw", {
|
|
76
|
-
value: verb(1)
|
|
77
|
-
}), d(g, "return", {
|
|
78
|
-
value: verb(2)
|
|
79
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
80
|
-
value: function() {
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
}), g;
|
|
84
|
-
function verb(n) {
|
|
85
|
-
return function(v) {
|
|
86
|
-
return step([
|
|
87
|
-
n,
|
|
88
|
-
v
|
|
89
|
-
]);
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function step(op) {
|
|
93
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
94
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
95
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
96
|
-
if (y = 0, t) op = [
|
|
97
|
-
op[0] & 2,
|
|
98
|
-
t.value
|
|
99
|
-
];
|
|
100
|
-
switch(op[0]){
|
|
101
|
-
case 0:
|
|
102
|
-
case 1:
|
|
103
|
-
t = op;
|
|
104
|
-
break;
|
|
105
|
-
case 4:
|
|
106
|
-
_.label++;
|
|
107
|
-
return {
|
|
108
|
-
value: op[1],
|
|
109
|
-
done: false
|
|
110
|
-
};
|
|
111
|
-
case 5:
|
|
112
|
-
_.label++;
|
|
113
|
-
y = op[1];
|
|
114
|
-
op = [
|
|
115
|
-
0
|
|
116
|
-
];
|
|
117
|
-
continue;
|
|
118
|
-
case 7:
|
|
119
|
-
op = _.ops.pop();
|
|
120
|
-
_.trys.pop();
|
|
121
|
-
continue;
|
|
122
|
-
default:
|
|
123
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
124
|
-
_ = 0;
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
128
|
-
_.label = op[1];
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
132
|
-
_.label = t[1];
|
|
133
|
-
t = op;
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
if (t && _.label < t[2]) {
|
|
137
|
-
_.label = t[2];
|
|
138
|
-
_.ops.push(op);
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
if (t[2]) _.ops.pop();
|
|
142
|
-
_.trys.pop();
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
op = body.call(thisArg, _);
|
|
146
|
-
} catch (e) {
|
|
147
|
-
op = [
|
|
148
|
-
6,
|
|
149
|
-
e
|
|
150
|
-
];
|
|
151
|
-
y = 0;
|
|
152
|
-
} finally{
|
|
153
|
-
f = t = 0;
|
|
154
|
-
}
|
|
155
|
-
if (op[0] & 5) throw op[1];
|
|
156
|
-
return {
|
|
157
|
-
value: op[0] ? op[1] : void 0,
|
|
158
|
-
done: true
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
var __defProp = Object.defineProperty;
|
|
163
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
164
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
165
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
166
|
-
var __export = function __export(target, all) {
|
|
167
|
-
for(var name in all)__defProp(target, name, {
|
|
168
|
-
get: all[name],
|
|
169
|
-
enumerable: true
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
|
-
var __copyProps = function __copyProps(to, from, except, desc) {
|
|
173
|
-
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
174
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
175
|
-
try {
|
|
176
|
-
var _loop = function() {
|
|
177
|
-
var key = _step.value;
|
|
178
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
179
|
-
get: function get() {
|
|
180
|
-
return from[key];
|
|
181
|
-
},
|
|
182
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
186
|
-
} catch (err) {
|
|
187
|
-
_didIteratorError = true;
|
|
188
|
-
_iteratorError = err;
|
|
189
|
-
} finally{
|
|
190
|
-
try {
|
|
191
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
192
|
-
_iterator.return();
|
|
193
|
-
}
|
|
194
|
-
} finally{
|
|
195
|
-
if (_didIteratorError) {
|
|
196
|
-
throw _iteratorError;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return to;
|
|
202
|
-
};
|
|
203
|
-
var __toCommonJS = function __toCommonJS(mod) {
|
|
204
|
-
return __copyProps(__defProp({}, "__esModule", {
|
|
205
|
-
value: true
|
|
206
|
-
}), mod);
|
|
207
|
-
};
|
|
208
|
-
// src/utils/overlays.ts
|
|
209
|
-
var overlays_exports = {};
|
|
210
|
-
__export(overlays_exports, {
|
|
211
|
-
OVERLAY_API_BASE: function OVERLAY_API_BASE1() {
|
|
212
|
-
return OVERLAY_API_BASE;
|
|
213
|
-
},
|
|
214
|
-
fetchProjectOverlays: function fetchProjectOverlays1() {
|
|
215
|
-
return fetchProjectOverlays;
|
|
216
|
-
},
|
|
217
|
-
isOverlayActive: function isOverlayActive1() {
|
|
218
|
-
return isOverlayActive;
|
|
219
|
-
},
|
|
220
|
-
normalizeSwirlOverlay: function normalizeSwirlOverlay1() {
|
|
221
|
-
return normalizeSwirlOverlay;
|
|
222
|
-
},
|
|
223
|
-
resolveImageUrl: function resolveImageUrl1() {
|
|
224
|
-
return resolveImageUrl;
|
|
225
|
-
},
|
|
226
|
-
timeStringToSeconds: function timeStringToSeconds1() {
|
|
227
|
-
return timeStringToSeconds;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
module.exports = __toCommonJS(overlays_exports);
|
|
231
|
-
var OVERLAY_API_BASE = "https://adstorm.co/api-adstorm-dev";
|
|
232
|
-
function timeStringToSeconds(timeStr) {
|
|
233
|
-
if (!timeStr) return 0;
|
|
234
|
-
var parts = timeStr.split(":");
|
|
235
|
-
if (parts.length >= 3) {
|
|
236
|
-
var _parts_, _parts_1, _parts_2;
|
|
237
|
-
var hours = parseInt((_parts_ = parts[0]) !== null && _parts_ !== void 0 ? _parts_ : "0", 10) || 0;
|
|
238
|
-
var minutes = parseInt((_parts_1 = parts[1]) !== null && _parts_1 !== void 0 ? _parts_1 : "0", 10) || 0;
|
|
239
|
-
var secStr = (_parts_2 = parts[2]) !== null && _parts_2 !== void 0 ? _parts_2 : "0";
|
|
240
|
-
var dotIdx = secStr.indexOf(".");
|
|
241
|
-
var seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;
|
|
242
|
-
var msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : "";
|
|
243
|
-
var ms = msFrag ? parseInt(msFrag.padEnd(3, "0").substring(0, 3), 10) || 0 : 0;
|
|
244
|
-
return hours * 3600 + minutes * 60 + seconds + ms / 1e3;
|
|
245
|
-
}
|
|
246
|
-
if (parts.length === 2) {
|
|
247
|
-
var _parts_3, _parts_4;
|
|
248
|
-
var minutes1 = parseInt((_parts_3 = parts[0]) !== null && _parts_3 !== void 0 ? _parts_3 : "0", 10) || 0;
|
|
249
|
-
var secStr1 = (_parts_4 = parts[1]) !== null && _parts_4 !== void 0 ? _parts_4 : "0";
|
|
250
|
-
var dotIdx1 = secStr1.indexOf(".");
|
|
251
|
-
var seconds1 = parseInt(dotIdx1 >= 0 ? secStr1.substring(0, dotIdx1) : secStr1, 10) || 0;
|
|
252
|
-
var msFrag1 = dotIdx1 >= 0 ? secStr1.substring(dotIdx1 + 1) : "";
|
|
253
|
-
var ms1 = msFrag1 ? parseInt(msFrag1.padEnd(3, "0").substring(0, 3), 10) || 0 : 0;
|
|
254
|
-
return minutes1 * 60 + seconds1 + ms1 / 1e3;
|
|
255
|
-
}
|
|
256
|
-
var num = parseFloat(timeStr);
|
|
257
|
-
return isFinite(num) ? Math.max(0, num) : 0;
|
|
258
|
-
}
|
|
259
|
-
function isOverlayActive(overlay, currentTime) {
|
|
260
|
-
if (!overlay.visible) return false;
|
|
261
|
-
var startSec = timeStringToSeconds(overlay.start_time);
|
|
262
|
-
var durationSec = timeStringToSeconds(overlay.duration);
|
|
263
|
-
if (durationSec <= 0) return false;
|
|
264
|
-
return currentTime >= startSec && currentTime < startSec + durationSec;
|
|
265
|
-
}
|
|
266
|
-
function normalizeScrollerConfig(raw) {
|
|
267
|
-
if (!raw || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== "object") return void 0;
|
|
268
|
-
var r = raw;
|
|
269
|
-
var merged = _object_spread({}, raw);
|
|
270
|
-
if (merged.use_custom_text === void 0 && typeof r.useCustomText === "boolean") {
|
|
271
|
-
merged.use_custom_text = r.useCustomText;
|
|
272
|
-
}
|
|
273
|
-
if ((merged.custom_text === void 0 || merged.custom_text === "") && typeof r.customText === "string") {
|
|
274
|
-
merged.custom_text = r.customText;
|
|
275
|
-
}
|
|
276
|
-
if (!merged.rss_url && typeof r.rssUrl === "string") {
|
|
277
|
-
merged.rss_url = r.rssUrl;
|
|
278
|
-
}
|
|
279
|
-
return merged;
|
|
280
|
-
}
|
|
281
|
-
function normalizeSwirlOverlay(raw) {
|
|
282
|
-
var o = _object_spread({}, raw);
|
|
283
|
-
if (o.type === "scroller") {
|
|
284
|
-
var _raw_scroller_config;
|
|
285
|
-
var sc = (_raw_scroller_config = raw.scroller_config) !== null && _raw_scroller_config !== void 0 ? _raw_scroller_config : raw.scrollerConfig;
|
|
286
|
-
var normalized = normalizeScrollerConfig(sc);
|
|
287
|
-
if (normalized) o.scroller_config = normalized;
|
|
288
|
-
}
|
|
289
|
-
return o;
|
|
290
|
-
}
|
|
291
|
-
function fetchProjectOverlays(_0) {
|
|
292
|
-
return _async_to_generator(function(projectId) {
|
|
293
|
-
var apiBaseUrl, base, response, data;
|
|
294
|
-
var _arguments = arguments;
|
|
295
|
-
return _ts_generator(this, function(_state) {
|
|
296
|
-
switch(_state.label){
|
|
297
|
-
case 0:
|
|
298
|
-
apiBaseUrl = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : OVERLAY_API_BASE;
|
|
299
|
-
base = apiBaseUrl.replace(/\/$/, "");
|
|
300
|
-
return [
|
|
301
|
-
4,
|
|
302
|
-
fetch("".concat(base, "/adstorm/swirl/projects/").concat(projectId, "/overlays"))
|
|
303
|
-
];
|
|
304
|
-
case 1:
|
|
305
|
-
response = _state.sent();
|
|
306
|
-
if (!response.ok) {
|
|
307
|
-
throw new Error("Failed to fetch overlays: ".concat(response.status, " ").concat(response.statusText));
|
|
308
|
-
}
|
|
309
|
-
return [
|
|
310
|
-
4,
|
|
311
|
-
response.json()
|
|
312
|
-
];
|
|
313
|
-
case 2:
|
|
314
|
-
data = _state.sent();
|
|
315
|
-
if (!Array.isArray(data)) return [
|
|
316
|
-
2,
|
|
317
|
-
[]
|
|
318
|
-
];
|
|
319
|
-
return [
|
|
320
|
-
2,
|
|
321
|
-
data.map(function(row) {
|
|
322
|
-
return normalizeSwirlOverlay(row);
|
|
323
|
-
})
|
|
324
|
-
];
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
}).apply(this, arguments);
|
|
328
|
-
}
|
|
329
|
-
function resolveImageUrl(imageUrl) {
|
|
330
|
-
var apiBaseUrl = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : OVERLAY_API_BASE;
|
|
331
|
-
if (!imageUrl) return "";
|
|
332
|
-
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
333
|
-
return imageUrl;
|
|
334
|
-
}
|
|
335
|
-
if (imageUrl.startsWith("/")) {
|
|
336
|
-
try {
|
|
337
|
-
var url = new URL(apiBaseUrl);
|
|
338
|
-
return "".concat(url.origin).concat(imageUrl);
|
|
339
|
-
} catch (unused) {
|
|
340
|
-
return imageUrl;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return "".concat(apiBaseUrl, "/").concat(imageUrl);
|
|
344
|
-
}
|
|
345
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
346
|
-
0 && (module.exports = {
|
|
347
|
-
OVERLAY_API_BASE: OVERLAY_API_BASE,
|
|
348
|
-
fetchProjectOverlays: fetchProjectOverlays,
|
|
349
|
-
isOverlayActive: isOverlayActive,
|
|
350
|
-
normalizeSwirlOverlay: normalizeSwirlOverlay,
|
|
351
|
-
resolveImageUrl: resolveImageUrl,
|
|
352
|
-
timeStringToSeconds: timeStringToSeconds
|
|
353
|
-
});
|
|
354
|
-
//# sourceMappingURL=overlays.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/utils/overlays.cjs"],"names":[],"mappings":"AAAA","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/utils/overlays.ts\nvar overlays_exports = {};\n__export(overlays_exports, {\n OVERLAY_API_BASE: () => OVERLAY_API_BASE,\n fetchProjectOverlays: () => fetchProjectOverlays,\n isOverlayActive: () => isOverlayActive,\n normalizeSwirlOverlay: () => normalizeSwirlOverlay,\n resolveImageUrl: () => resolveImageUrl,\n timeStringToSeconds: () => timeStringToSeconds\n});\nmodule.exports = __toCommonJS(overlays_exports);\nvar OVERLAY_API_BASE = \"https://adstorm.co/api-adstorm-dev\";\nfunction timeStringToSeconds(timeStr) {\n if (!timeStr) return 0;\n const parts = timeStr.split(\":\");\n if (parts.length >= 3) {\n const hours = parseInt(parts[0] ?? \"0\", 10) || 0;\n const minutes = parseInt(parts[1] ?? \"0\", 10) || 0;\n const secStr = parts[2] ?? \"0\";\n const dotIdx = secStr.indexOf(\".\");\n const seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;\n const msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : \"\";\n const ms = msFrag ? parseInt(msFrag.padEnd(3, \"0\").substring(0, 3), 10) || 0 : 0;\n return hours * 3600 + minutes * 60 + seconds + ms / 1e3;\n }\n if (parts.length === 2) {\n const minutes = parseInt(parts[0] ?? \"0\", 10) || 0;\n const secStr = parts[1] ?? \"0\";\n const dotIdx = secStr.indexOf(\".\");\n const seconds = parseInt(dotIdx >= 0 ? secStr.substring(0, dotIdx) : secStr, 10) || 0;\n const msFrag = dotIdx >= 0 ? secStr.substring(dotIdx + 1) : \"\";\n const ms = msFrag ? parseInt(msFrag.padEnd(3, \"0\").substring(0, 3), 10) || 0 : 0;\n return minutes * 60 + seconds + ms / 1e3;\n }\n const num = parseFloat(timeStr);\n return isFinite(num) ? Math.max(0, num) : 0;\n}\nfunction isOverlayActive(overlay, currentTime) {\n if (!overlay.visible) return false;\n const startSec = timeStringToSeconds(overlay.start_time);\n const durationSec = timeStringToSeconds(overlay.duration);\n if (durationSec <= 0) return false;\n return currentTime >= startSec && currentTime < startSec + durationSec;\n}\nfunction normalizeScrollerConfig(raw) {\n if (!raw || typeof raw !== \"object\") return void 0;\n const r = raw;\n const merged = { ...raw };\n if (merged.use_custom_text === void 0 && typeof r.useCustomText === \"boolean\") {\n merged.use_custom_text = r.useCustomText;\n }\n if ((merged.custom_text === void 0 || merged.custom_text === \"\") && typeof r.customText === \"string\") {\n merged.custom_text = r.customText;\n }\n if (!merged.rss_url && typeof r.rssUrl === \"string\") {\n merged.rss_url = r.rssUrl;\n }\n return merged;\n}\nfunction normalizeSwirlOverlay(raw) {\n const o = { ...raw };\n if (o.type === \"scroller\") {\n const sc = raw.scroller_config ?? raw.scrollerConfig;\n const normalized = normalizeScrollerConfig(sc);\n if (normalized) o.scroller_config = normalized;\n }\n return o;\n}\nasync function fetchProjectOverlays(projectId, apiBaseUrl = OVERLAY_API_BASE) {\n const base = apiBaseUrl.replace(/\\/$/, \"\");\n const response = await fetch(\n `${base}/adstorm/swirl/projects/${projectId}/overlays`\n );\n if (!response.ok) {\n throw new Error(\n `Failed to fetch overlays: ${response.status} ${response.statusText}`\n );\n }\n const data = await response.json();\n if (!Array.isArray(data)) return [];\n return data.map(\n (row) => normalizeSwirlOverlay(row)\n );\n}\nfunction resolveImageUrl(imageUrl, apiBaseUrl = OVERLAY_API_BASE) {\n if (!imageUrl) return \"\";\n if (imageUrl.startsWith(\"http://\") || imageUrl.startsWith(\"https://\")) {\n return imageUrl;\n }\n if (imageUrl.startsWith(\"/\")) {\n try {\n const url = new URL(apiBaseUrl);\n return `${url.origin}${imageUrl}`;\n } catch {\n return imageUrl;\n }\n }\n return `${apiBaseUrl}/${imageUrl}`;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n OVERLAY_API_BASE,\n fetchProjectOverlays,\n isOverlayActive,\n normalizeSwirlOverlay,\n resolveImageUrl,\n timeStringToSeconds\n});\n"]}
|