stormcloud-video-player 0.7.17 → 0.7.18
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/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +67 -13
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +68 -14
- package/lib/index.js.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +67 -13
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/utils/adcision.cjs +253 -0
- package/lib/utils/adcision.cjs.map +1 -0
- package/lib/utils/adcision.d.cts +23 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ type StormcloudVideoPlayerProps = Omit<StormcloudVideoPlayerConfig, "videoElemen
|
|
|
8
8
|
wrapperStyle?: React.CSSProperties;
|
|
9
9
|
licenseKey?: string;
|
|
10
10
|
swirlProjectId?: number;
|
|
11
|
+
adcisionChannelId?: number;
|
|
11
12
|
disableOverlays?: boolean;
|
|
12
13
|
showAdsControl?: boolean;
|
|
13
14
|
showOverlaysControl?: boolean;
|
|
@@ -0,0 +1,253 @@
|
|
|
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
|
+
fetchAdcisionTemplates: function fetchAdcisionTemplates1() {
|
|
187
|
+
return fetchAdcisionTemplates;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
module.exports = __toCommonJS(adcision_exports);
|
|
191
|
+
var ADCISION_API_BASE = "https://adstorm.co/api-adstorm-dev";
|
|
192
|
+
function fetchAdcisionChannel(_0) {
|
|
193
|
+
return _async_to_generator(function(channelId) {
|
|
194
|
+
var apiBaseUrl, response;
|
|
195
|
+
var _arguments = arguments;
|
|
196
|
+
return _ts_generator(this, function(_state) {
|
|
197
|
+
switch(_state.label){
|
|
198
|
+
case 0:
|
|
199
|
+
apiBaseUrl = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : ADCISION_API_BASE;
|
|
200
|
+
return [
|
|
201
|
+
4,
|
|
202
|
+
fetch("".concat(apiBaseUrl, "/adstorm/adcision/channels/").concat(channelId))
|
|
203
|
+
];
|
|
204
|
+
case 1:
|
|
205
|
+
response = _state.sent();
|
|
206
|
+
if (!response.ok) {
|
|
207
|
+
throw new Error("Failed to fetch adcision channel ".concat(channelId, ": ").concat(response.status, " ").concat(response.statusText));
|
|
208
|
+
}
|
|
209
|
+
return [
|
|
210
|
+
2,
|
|
211
|
+
response.json()
|
|
212
|
+
];
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}).apply(this, arguments);
|
|
216
|
+
}
|
|
217
|
+
function fetchAdcisionTemplates() {
|
|
218
|
+
return _async_to_generator(function() {
|
|
219
|
+
var apiBaseUrl, response, data;
|
|
220
|
+
var _arguments = arguments;
|
|
221
|
+
return _ts_generator(this, function(_state) {
|
|
222
|
+
switch(_state.label){
|
|
223
|
+
case 0:
|
|
224
|
+
apiBaseUrl = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : ADCISION_API_BASE;
|
|
225
|
+
return [
|
|
226
|
+
4,
|
|
227
|
+
fetch("".concat(apiBaseUrl, "/adstorm/adcision/templates"))
|
|
228
|
+
];
|
|
229
|
+
case 1:
|
|
230
|
+
response = _state.sent();
|
|
231
|
+
if (!response.ok) {
|
|
232
|
+
throw new Error("Failed to fetch adcision templates: ".concat(response.status, " ").concat(response.statusText));
|
|
233
|
+
}
|
|
234
|
+
return [
|
|
235
|
+
4,
|
|
236
|
+
response.json()
|
|
237
|
+
];
|
|
238
|
+
case 2:
|
|
239
|
+
data = _state.sent();
|
|
240
|
+
return [
|
|
241
|
+
2,
|
|
242
|
+
Array.isArray(data) ? data : []
|
|
243
|
+
];
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}).apply(this, arguments);
|
|
247
|
+
}
|
|
248
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
249
|
+
0 && (module.exports = {
|
|
250
|
+
fetchAdcisionChannel: fetchAdcisionChannel,
|
|
251
|
+
fetchAdcisionTemplates: fetchAdcisionTemplates
|
|
252
|
+
});
|
|
253
|
+
//# sourceMappingURL=adcision.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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 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 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 fetchAdcisionTemplates\n});\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
declare function fetchAdcisionTemplates(apiBaseUrl?: string): Promise<AdcisionTemplate[]>;
|
|
22
|
+
|
|
23
|
+
export { type AdcisionChannel, type AdcisionTemplate, fetchAdcisionChannel, fetchAdcisionTemplates };
|