stormcloud-video-player 0.8.59 → 0.8.60
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/LICENSE +21 -21
- package/README.md +1369 -1369
- package/dist/stormcloud-vp.min.js +3 -1
- package/lib/Player.cjs +548 -0
- package/lib/Player.cjs.map +1 -0
- package/lib/Player.d.cts +146 -0
- package/lib/{index.js → StormcloudPlayer.cjs} +1108 -1877
- package/lib/StormcloudPlayer.cjs.map +1 -0
- package/lib/{index.d.ts → StormcloudPlayer.d.cts} +7 -400
- package/lib/index.cjs +979 -251
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +18 -4032
- package/lib/patterns.cjs +111 -0
- package/lib/patterns.cjs.map +1 -0
- package/lib/patterns.d.cts +14 -0
- package/lib/player/AdBreakOrchestrator.cjs +48 -14
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +3 -1
- package/lib/player/AdConfigManager.cjs +155 -17
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +1 -1
- package/lib/player/AdTimingService.cjs.map +1 -1
- package/lib/player/AdTimingService.d.cts +1 -1
- package/lib/player/HlsEngine.cjs.map +1 -1
- package/lib/player/HlsEngine.d.cts +1 -1
- package/lib/player/PlaceholderLayer.cjs.map +1 -1
- package/lib/player/PlayerControls.cjs.map +1 -1
- package/lib/player/PlayerControls.d.cts +1 -1
- package/lib/player/Scte35CueManager.cjs.map +1 -1
- package/lib/player/Scte35CueManager.d.cts +1 -1
- package/lib/player/Scte35Parser.cjs.map +1 -1
- package/lib/player/Scte35Parser.d.cts +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +979 -251
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/player/playerTypes.cjs.map +1 -1
- package/lib/player/playerTypes.d.cts +1 -1
- package/lib/players/FilePlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +979 -251
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +979 -251
- package/lib/players/index.cjs.map +1 -1
- package/lib/props.cjs +186 -0
- package/lib/props.cjs.map +1 -0
- package/lib/props.d.cts +62 -0
- package/lib/sdk/hlsAdPlayer.cjs +884 -234
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/sdk/pal.cjs.map +1 -1
- package/lib/types.cjs +49 -0
- package/lib/types.cjs.map +1 -0
- package/lib/{types-52ASml2N.d.cts → types.d.cts} +47 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +979 -251
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/ctvVastSignals.cjs +155 -17
- package/lib/utils/ctvVastSignals.cjs.map +1 -1
- package/lib/utils/devUrl.cjs.map +1 -1
- package/lib/utils/polyfills.cjs.map +1 -1
- package/lib/utils/tracking.cjs +42 -14
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +1 -1
- package/lib/utils/trackingIngest.cjs.map +1 -1
- package/lib/utils/vastEnvironmentSignals.cjs +167 -17
- package/lib/utils/vastEnvironmentSignals.cjs.map +1 -1
- package/lib/utils/vastEnvironmentSignals.d.cts +12 -1
- package/lib/utils/vastMacros.cjs +26 -0
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastTrackingMacros.cjs +5 -0
- package/lib/utils/vastTrackingMacros.cjs.map +1 -1
- package/lib/utils/vastTrackingMacros.d.cts +2 -0
- package/lib/utils.cjs +292 -0
- package/lib/utils.cjs.map +1 -0
- package/lib/utils.d.cts +17 -0
- package/package.json +91 -91
- package/rollup.config.js +90 -90
- package/lib/index.js.map +0 -1
package/lib/utils.cjs
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _array_without_holes(arr) {
|
|
11
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
12
|
+
}
|
|
13
|
+
function _define_property(obj, key, value) {
|
|
14
|
+
if (key in obj) {
|
|
15
|
+
Object.defineProperty(obj, key, {
|
|
16
|
+
value: value,
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true
|
|
20
|
+
});
|
|
21
|
+
} else obj[key] = value;
|
|
22
|
+
return obj;
|
|
23
|
+
}
|
|
24
|
+
function _instanceof(left, right) {
|
|
25
|
+
"@swc/helpers - instanceof";
|
|
26
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
27
|
+
return !!right[Symbol.hasInstance](left);
|
|
28
|
+
} else return left instanceof right;
|
|
29
|
+
}
|
|
30
|
+
function _iterable_to_array(iter) {
|
|
31
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
|
32
|
+
return Array.from(iter);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function _iterable_to_array_limit(arr, i) {
|
|
36
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
37
|
+
if (_i == null) return;
|
|
38
|
+
var _arr = [];
|
|
39
|
+
var _n = true;
|
|
40
|
+
var _d = false;
|
|
41
|
+
var _s, _e;
|
|
42
|
+
try {
|
|
43
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
44
|
+
_arr.push(_s.value);
|
|
45
|
+
if (i && _arr.length === i) break;
|
|
46
|
+
}
|
|
47
|
+
} catch (err) {
|
|
48
|
+
_d = true;
|
|
49
|
+
_e = err;
|
|
50
|
+
} finally{
|
|
51
|
+
try {
|
|
52
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
53
|
+
} finally{
|
|
54
|
+
if (_d) throw _e;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return _arr;
|
|
58
|
+
}
|
|
59
|
+
function _non_iterable_rest() {
|
|
60
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
61
|
+
}
|
|
62
|
+
function _non_iterable_spread() {
|
|
63
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
64
|
+
}
|
|
65
|
+
function _object_spread(target) {
|
|
66
|
+
for(var i = 1; i < arguments.length; i++){
|
|
67
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
68
|
+
var ownKeys = Object.keys(source);
|
|
69
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
70
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
71
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
ownKeys.forEach(function(key) {
|
|
75
|
+
_define_property(target, key, source[key]);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
80
|
+
function _sliced_to_array(arr, i) {
|
|
81
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
82
|
+
}
|
|
83
|
+
function _to_consumable_array(arr) {
|
|
84
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
85
|
+
}
|
|
86
|
+
function _type_of(obj) {
|
|
87
|
+
"@swc/helpers - typeof";
|
|
88
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
89
|
+
}
|
|
90
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
91
|
+
if (!o) return;
|
|
92
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
93
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
94
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
95
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
96
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
97
|
+
}
|
|
98
|
+
var __defProp = Object.defineProperty;
|
|
99
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
100
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
101
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
102
|
+
var __export = function __export(target, all) {
|
|
103
|
+
for(var name in all)__defProp(target, name, {
|
|
104
|
+
get: all[name],
|
|
105
|
+
enumerable: true
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
var __copyProps = function __copyProps(to, from, except, desc) {
|
|
109
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
110
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
111
|
+
try {
|
|
112
|
+
var _loop = function() {
|
|
113
|
+
var key = _step.value;
|
|
114
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
115
|
+
get: function get() {
|
|
116
|
+
return from[key];
|
|
117
|
+
},
|
|
118
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
122
|
+
} catch (err) {
|
|
123
|
+
_didIteratorError = true;
|
|
124
|
+
_iteratorError = err;
|
|
125
|
+
} finally{
|
|
126
|
+
try {
|
|
127
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
128
|
+
_iterator.return();
|
|
129
|
+
}
|
|
130
|
+
} finally{
|
|
131
|
+
if (_didIteratorError) {
|
|
132
|
+
throw _iteratorError;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return to;
|
|
138
|
+
};
|
|
139
|
+
var __toCommonJS = function __toCommonJS(mod) {
|
|
140
|
+
return __copyProps(__defProp({}, "__esModule", {
|
|
141
|
+
value: true
|
|
142
|
+
}), mod);
|
|
143
|
+
};
|
|
144
|
+
// src/utils.ts
|
|
145
|
+
var utils_exports = {};
|
|
146
|
+
__export(utils_exports, {
|
|
147
|
+
IS_BROWSER: function IS_BROWSER1() {
|
|
148
|
+
return IS_BROWSER;
|
|
149
|
+
},
|
|
150
|
+
IS_GLOBAL: function IS_GLOBAL1() {
|
|
151
|
+
return IS_GLOBAL;
|
|
152
|
+
},
|
|
153
|
+
IS_IOS: function IS_IOS1() {
|
|
154
|
+
return IS_IOS;
|
|
155
|
+
},
|
|
156
|
+
IS_SAFARI: function IS_SAFARI1() {
|
|
157
|
+
return IS_SAFARI;
|
|
158
|
+
},
|
|
159
|
+
SUPPORTS_DASH: function SUPPORTS_DASH1() {
|
|
160
|
+
return SUPPORTS_DASH;
|
|
161
|
+
},
|
|
162
|
+
SUPPORTS_HLS: function SUPPORTS_HLS1() {
|
|
163
|
+
return SUPPORTS_HLS;
|
|
164
|
+
},
|
|
165
|
+
isMediaStream: function isMediaStream1() {
|
|
166
|
+
return isMediaStream;
|
|
167
|
+
},
|
|
168
|
+
lazy: function lazy1() {
|
|
169
|
+
return lazy;
|
|
170
|
+
},
|
|
171
|
+
merge: function merge1() {
|
|
172
|
+
return merge;
|
|
173
|
+
},
|
|
174
|
+
omit: function omit1() {
|
|
175
|
+
return omit;
|
|
176
|
+
},
|
|
177
|
+
parseQuery: function parseQuery1() {
|
|
178
|
+
return parseQuery;
|
|
179
|
+
},
|
|
180
|
+
randomString: function randomString1() {
|
|
181
|
+
return randomString;
|
|
182
|
+
},
|
|
183
|
+
supportsWebKitPresentationMode: function supportsWebKitPresentationMode1() {
|
|
184
|
+
return supportsWebKitPresentationMode;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
module.exports = __toCommonJS(utils_exports);
|
|
188
|
+
var import_react = require("react");
|
|
189
|
+
var lazy = import_react.lazy;
|
|
190
|
+
var omit = function omit(object, keys) {
|
|
191
|
+
var result = _object_spread({}, object);
|
|
192
|
+
keys.forEach(function(key) {
|
|
193
|
+
delete result[key];
|
|
194
|
+
});
|
|
195
|
+
return result;
|
|
196
|
+
};
|
|
197
|
+
var isMediaStream = function isMediaStream(url) {
|
|
198
|
+
return typeof window !== "undefined" && window.MediaStream && _instanceof(url, window.MediaStream);
|
|
199
|
+
};
|
|
200
|
+
var supportsWebKitPresentationMode = function supportsWebKitPresentationMode() {
|
|
201
|
+
if (typeof window === "undefined") return false;
|
|
202
|
+
var video = document.createElement("video");
|
|
203
|
+
return "webkitSupportsPresentationMode" in video;
|
|
204
|
+
};
|
|
205
|
+
var randomString = function randomString() {
|
|
206
|
+
return Math.random().toString(36).substr(2, 9);
|
|
207
|
+
};
|
|
208
|
+
var parseQuery = function parseQuery(url) {
|
|
209
|
+
var query = {};
|
|
210
|
+
var queryString = url.split("?")[1] || "";
|
|
211
|
+
if (!queryString) return query;
|
|
212
|
+
var manualParse = function manualParse(qs) {
|
|
213
|
+
qs.split("&").forEach(function(param) {
|
|
214
|
+
var _param_split = _sliced_to_array(param.split("="), 2), key = _param_split[0], value = _param_split[1];
|
|
215
|
+
if (key) {
|
|
216
|
+
try {
|
|
217
|
+
query[decodeURIComponent(key)] = value ? decodeURIComponent(value.replace(/\+/g, " ")) : "";
|
|
218
|
+
} catch (e) {
|
|
219
|
+
query[key] = value || "";
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
if (typeof URLSearchParams !== "undefined") {
|
|
225
|
+
try {
|
|
226
|
+
var params = new URLSearchParams(queryString);
|
|
227
|
+
params.forEach(function(value, key) {
|
|
228
|
+
query[key] = value;
|
|
229
|
+
});
|
|
230
|
+
return query;
|
|
231
|
+
} catch (e) {
|
|
232
|
+
manualParse(queryString);
|
|
233
|
+
}
|
|
234
|
+
} else {
|
|
235
|
+
manualParse(queryString);
|
|
236
|
+
}
|
|
237
|
+
return query;
|
|
238
|
+
};
|
|
239
|
+
var merge = function merge1(target) {
|
|
240
|
+
for(var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
241
|
+
sources[_key - 1] = arguments[_key];
|
|
242
|
+
}
|
|
243
|
+
if (!sources.length) return target;
|
|
244
|
+
var source = sources.shift();
|
|
245
|
+
if (isObject(target) && isObject(source)) {
|
|
246
|
+
for(var key in source){
|
|
247
|
+
if (isObject(source[key])) {
|
|
248
|
+
if (!target[key]) Object.assign(target, _define_property({}, key, {}));
|
|
249
|
+
merge(target[key], source[key]);
|
|
250
|
+
} else {
|
|
251
|
+
Object.assign(target, _define_property({}, key, source[key]));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return merge.apply(void 0, [
|
|
256
|
+
target
|
|
257
|
+
].concat(_to_consumable_array(sources)));
|
|
258
|
+
};
|
|
259
|
+
var isObject = function isObject(item) {
|
|
260
|
+
return item && (typeof item === "undefined" ? "undefined" : _type_of(item)) === "object" && !Array.isArray(item);
|
|
261
|
+
};
|
|
262
|
+
var IS_BROWSER = typeof window !== "undefined" && window.document;
|
|
263
|
+
var IS_GLOBAL = typeof globalThis !== "undefined" && globalThis.window && globalThis.window.document;
|
|
264
|
+
var IS_IOS = IS_BROWSER && /iPad|iPhone|iPod/.test(navigator.userAgent);
|
|
265
|
+
var IS_SAFARI = IS_BROWSER && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
266
|
+
var SUPPORTS_HLS = function SUPPORTS_HLS() {
|
|
267
|
+
if (!IS_BROWSER) return false;
|
|
268
|
+
var video = document.createElement("video");
|
|
269
|
+
return Boolean(video.canPlayType("application/vnd.apple.mpegurl"));
|
|
270
|
+
};
|
|
271
|
+
var SUPPORTS_DASH = function SUPPORTS_DASH() {
|
|
272
|
+
if (!IS_BROWSER) return false;
|
|
273
|
+
var video = document.createElement("video");
|
|
274
|
+
return Boolean(video.canPlayType("application/dash+xml"));
|
|
275
|
+
};
|
|
276
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
277
|
+
0 && (module.exports = {
|
|
278
|
+
IS_BROWSER: IS_BROWSER,
|
|
279
|
+
IS_GLOBAL: IS_GLOBAL,
|
|
280
|
+
IS_IOS: IS_IOS,
|
|
281
|
+
IS_SAFARI: IS_SAFARI,
|
|
282
|
+
SUPPORTS_DASH: SUPPORTS_DASH,
|
|
283
|
+
SUPPORTS_HLS: SUPPORTS_HLS,
|
|
284
|
+
isMediaStream: isMediaStream,
|
|
285
|
+
lazy: lazy,
|
|
286
|
+
merge: merge,
|
|
287
|
+
omit: omit,
|
|
288
|
+
parseQuery: parseQuery,
|
|
289
|
+
randomString: randomString,
|
|
290
|
+
supportsWebKitPresentationMode: supportsWebKitPresentationMode
|
|
291
|
+
});
|
|
292
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["d:\\project\\stormcloud-vp\\lib\\utils.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.ts\nvar utils_exports = {};\n__export(utils_exports, {\n IS_BROWSER: () => IS_BROWSER,\n IS_GLOBAL: () => IS_GLOBAL,\n IS_IOS: () => IS_IOS,\n IS_SAFARI: () => IS_SAFARI,\n SUPPORTS_DASH: () => SUPPORTS_DASH,\n SUPPORTS_HLS: () => SUPPORTS_HLS,\n isMediaStream: () => isMediaStream,\n lazy: () => lazy,\n merge: () => merge,\n omit: () => omit,\n parseQuery: () => parseQuery,\n randomString: () => randomString,\n supportsWebKitPresentationMode: () => supportsWebKitPresentationMode\n});\nmodule.exports = __toCommonJS(utils_exports);\nvar import_react = require(\"react\");\nvar lazy = import_react.lazy;\nvar omit = (object, keys) => {\n const result = { ...object };\n keys.forEach((key) => {\n delete result[key];\n });\n return result;\n};\nvar isMediaStream = (url) => {\n return typeof window !== \"undefined\" && window.MediaStream && url instanceof window.MediaStream;\n};\nvar supportsWebKitPresentationMode = () => {\n if (typeof window === \"undefined\") return false;\n const video = document.createElement(\"video\");\n return \"webkitSupportsPresentationMode\" in video;\n};\nvar randomString = () => {\n return Math.random().toString(36).substr(2, 9);\n};\nvar parseQuery = (url) => {\n const query = {};\n const queryString = url.split(\"?\")[1] || \"\";\n if (!queryString) return query;\n const manualParse = (qs) => {\n qs.split(\"&\").forEach((param) => {\n const [key, value] = param.split(\"=\");\n if (key) {\n try {\n query[decodeURIComponent(key)] = value ? decodeURIComponent(value.replace(/\\+/g, \" \")) : \"\";\n } catch (e) {\n query[key] = value || \"\";\n }\n }\n });\n };\n if (typeof URLSearchParams !== \"undefined\") {\n try {\n const params = new URLSearchParams(queryString);\n params.forEach((value, key) => {\n query[key] = value;\n });\n return query;\n } catch (e) {\n manualParse(queryString);\n }\n } else {\n manualParse(queryString);\n }\n return query;\n};\nvar merge = (target, ...sources) => {\n if (!sources.length) return target;\n const source = sources.shift();\n if (isObject(target) && isObject(source)) {\n for (const key in source) {\n if (isObject(source[key])) {\n if (!target[key]) Object.assign(target, { [key]: {} });\n merge(target[key], source[key]);\n } else {\n Object.assign(target, { [key]: source[key] });\n }\n }\n }\n return merge(target, ...sources);\n};\nvar isObject = (item) => {\n return item && typeof item === \"object\" && !Array.isArray(item);\n};\nvar IS_BROWSER = typeof window !== \"undefined\" && window.document;\nvar IS_GLOBAL = typeof globalThis !== \"undefined\" && globalThis.window && globalThis.window.document;\nvar IS_IOS = IS_BROWSER && /iPad|iPhone|iPod/.test(navigator.userAgent);\nvar IS_SAFARI = IS_BROWSER && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\nvar SUPPORTS_HLS = () => {\n if (!IS_BROWSER) return false;\n const video = document.createElement(\"video\");\n return Boolean(video.canPlayType(\"application/vnd.apple.mpegurl\"));\n};\nvar SUPPORTS_DASH = () => {\n if (!IS_BROWSER) return false;\n const video = document.createElement(\"video\");\n return Boolean(video.canPlayType(\"application/dash+xml\"));\n};\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n IS_BROWSER,\n IS_GLOBAL,\n IS_IOS,\n IS_SAFARI,\n SUPPORTS_DASH,\n SUPPORTS_HLS,\n isMediaStream,\n lazy,\n merge,\n omit,\n parseQuery,\n randomString,\n supportsWebKitPresentationMode\n});\n"]}
|
package/lib/utils.d.cts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { lazy as lazy$1 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const lazy: typeof lazy$1;
|
|
4
|
+
declare const omit: <T extends Record<string, any>, K extends keyof T>(object: T, keys: K[]) => Omit<T, K>;
|
|
5
|
+
declare const isMediaStream: (url: any) => url is MediaStream;
|
|
6
|
+
declare const supportsWebKitPresentationMode: () => boolean;
|
|
7
|
+
declare const randomString: () => string;
|
|
8
|
+
declare const parseQuery: (url: string) => Record<string, string>;
|
|
9
|
+
declare const merge: <T extends Record<string, any>>(target: T, ...sources: Partial<T>[]) => T;
|
|
10
|
+
declare const IS_BROWSER: false | Document;
|
|
11
|
+
declare const IS_GLOBAL: false | Document;
|
|
12
|
+
declare const IS_IOS: boolean;
|
|
13
|
+
declare const IS_SAFARI: boolean;
|
|
14
|
+
declare const SUPPORTS_HLS: () => boolean;
|
|
15
|
+
declare const SUPPORTS_DASH: () => boolean;
|
|
16
|
+
|
|
17
|
+
export { IS_BROWSER, IS_GLOBAL, IS_IOS, IS_SAFARI, SUPPORTS_DASH, SUPPORTS_HLS, isMediaStream, lazy, merge, omit, parseQuery, randomString, supportsWebKitPresentationMode };
|
package/package.json
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "stormcloud-video-player",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"main": "lib/index.js",
|
|
5
|
-
"typings": "lib/index.d.ts",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"clean": "rimraf lib dist *.d.ts",
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"build": "tsup src/index.ts --format esm,cjs --dts --sourcemap --out-dir lib",
|
|
10
|
-
"build:lib": "tsup src/**/*.ts src/**/*.tsx --format cjs --dts --sourcemap --out-dir lib",
|
|
11
|
-
"build:minified": "rollup -c rollup.config.js",
|
|
12
|
-
"build:dist": "rollup -c rollup.config.js --environment BUILD:production",
|
|
13
|
-
"build:all": "npm run clean && npm run build && npm run build:lib && npm run build:minified && npm run build:dist",
|
|
14
|
-
"dev": "tsup src/index.ts --format esm,cjs --dts --watch --out-dir lib",
|
|
15
|
-
"prepublishOnly": "npm run build:lib && npm run build:dist",
|
|
16
|
-
"postpublish": "npm run clean"
|
|
17
|
-
},
|
|
18
|
-
"description": "Ad-first HLS video player with SCTE-35 support and Google IMA integration for precise ad break alignment",
|
|
19
|
-
"keywords": [
|
|
20
|
-
"video",
|
|
21
|
-
"player",
|
|
22
|
-
"hls",
|
|
23
|
-
"streaming",
|
|
24
|
-
"ads",
|
|
25
|
-
"advertising",
|
|
26
|
-
"scte-35",
|
|
27
|
-
"ima",
|
|
28
|
-
"vast",
|
|
29
|
-
"vpaid",
|
|
30
|
-
"live-streaming",
|
|
31
|
-
"video-ads",
|
|
32
|
-
"ad-insertion",
|
|
33
|
-
"broadcast",
|
|
34
|
-
"ott",
|
|
35
|
-
"connected-tv",
|
|
36
|
-
"ctv",
|
|
37
|
-
"react",
|
|
38
|
-
"typescript"
|
|
39
|
-
],
|
|
40
|
-
"author": "Showfer Media LLC",
|
|
41
|
-
"license": "MIT",
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"hls.js": "^1.6.11",
|
|
44
|
-
"react-icons": "^5.5.0"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@babel/core": "^7.28.5",
|
|
48
|
-
"@babel/preset-env": "^7.28.5",
|
|
49
|
-
"@rollup/plugin-babel": "^6.1.0",
|
|
50
|
-
"@rollup/plugin-commonjs": "^28.0.6",
|
|
51
|
-
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
52
|
-
"@rollup/plugin-replace": "^6.0.2",
|
|
53
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
54
|
-
"@rollup/plugin-typescript": "^12.1.4",
|
|
55
|
-
"@swc/core": "^1.15.3",
|
|
56
|
-
"@types/react": "^18.3.4",
|
|
57
|
-
"@types/react-dom": "^18.3.0",
|
|
58
|
-
"rimraf": "^3.0.2",
|
|
59
|
-
"rollup-plugin-swc3": "^0.12.1",
|
|
60
|
-
"tslib": "^2.8.1",
|
|
61
|
-
"tsup": "^8.5.0",
|
|
62
|
-
"typescript": "^5.9.2"
|
|
63
|
-
},
|
|
64
|
-
"type": "module",
|
|
65
|
-
"module": "lib/index.js",
|
|
66
|
-
"types": "lib/index.d.ts",
|
|
67
|
-
"exports": {
|
|
68
|
-
".": {
|
|
69
|
-
"import": "./lib/index.js",
|
|
70
|
-
"require": "./lib/index.cjs"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"peerDependencies": {
|
|
74
|
-
"react": ">=17",
|
|
75
|
-
"react-dom": ">=17"
|
|
76
|
-
},
|
|
77
|
-
"engines": {
|
|
78
|
-
"node": ">=16"
|
|
79
|
-
},
|
|
80
|
-
"files": [
|
|
81
|
-
"lib/**/*",
|
|
82
|
-
"dist/**/*",
|
|
83
|
-
"*.js",
|
|
84
|
-
"*.d.ts",
|
|
85
|
-
"README.md",
|
|
86
|
-
"LICENSE"
|
|
87
|
-
],
|
|
88
|
-
"publishConfig": {
|
|
89
|
-
"access": "public"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "stormcloud-video-player",
|
|
3
|
+
"version": "0.8.60",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"typings": "lib/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"clean": "rimraf lib dist *.d.ts",
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --sourcemap --out-dir lib",
|
|
10
|
+
"build:lib": "tsup src/**/*.ts src/**/*.tsx --format cjs --dts --sourcemap --out-dir lib",
|
|
11
|
+
"build:minified": "rollup -c rollup.config.js",
|
|
12
|
+
"build:dist": "rollup -c rollup.config.js --environment BUILD:production",
|
|
13
|
+
"build:all": "npm run clean && npm run build && npm run build:lib && npm run build:minified && npm run build:dist",
|
|
14
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --watch --out-dir lib",
|
|
15
|
+
"prepublishOnly": "npm run build:lib && npm run build:dist",
|
|
16
|
+
"postpublish": "npm run clean"
|
|
17
|
+
},
|
|
18
|
+
"description": "Ad-first HLS video player with SCTE-35 support and Google IMA integration for precise ad break alignment",
|
|
19
|
+
"keywords": [
|
|
20
|
+
"video",
|
|
21
|
+
"player",
|
|
22
|
+
"hls",
|
|
23
|
+
"streaming",
|
|
24
|
+
"ads",
|
|
25
|
+
"advertising",
|
|
26
|
+
"scte-35",
|
|
27
|
+
"ima",
|
|
28
|
+
"vast",
|
|
29
|
+
"vpaid",
|
|
30
|
+
"live-streaming",
|
|
31
|
+
"video-ads",
|
|
32
|
+
"ad-insertion",
|
|
33
|
+
"broadcast",
|
|
34
|
+
"ott",
|
|
35
|
+
"connected-tv",
|
|
36
|
+
"ctv",
|
|
37
|
+
"react",
|
|
38
|
+
"typescript"
|
|
39
|
+
],
|
|
40
|
+
"author": "Showfer Media LLC",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"hls.js": "^1.6.11",
|
|
44
|
+
"react-icons": "^5.5.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@babel/core": "^7.28.5",
|
|
48
|
+
"@babel/preset-env": "^7.28.5",
|
|
49
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
50
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
51
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
52
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
53
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
54
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
55
|
+
"@swc/core": "^1.15.3",
|
|
56
|
+
"@types/react": "^18.3.4",
|
|
57
|
+
"@types/react-dom": "^18.3.0",
|
|
58
|
+
"rimraf": "^3.0.2",
|
|
59
|
+
"rollup-plugin-swc3": "^0.12.1",
|
|
60
|
+
"tslib": "^2.8.1",
|
|
61
|
+
"tsup": "^8.5.0",
|
|
62
|
+
"typescript": "^5.9.2"
|
|
63
|
+
},
|
|
64
|
+
"type": "module",
|
|
65
|
+
"module": "lib/index.js",
|
|
66
|
+
"types": "lib/index.d.ts",
|
|
67
|
+
"exports": {
|
|
68
|
+
".": {
|
|
69
|
+
"import": "./lib/index.js",
|
|
70
|
+
"require": "./lib/index.cjs"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"react": ">=17",
|
|
75
|
+
"react-dom": ">=17"
|
|
76
|
+
},
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=16"
|
|
79
|
+
},
|
|
80
|
+
"files": [
|
|
81
|
+
"lib/**/*",
|
|
82
|
+
"dist/**/*",
|
|
83
|
+
"*.js",
|
|
84
|
+
"*.d.ts",
|
|
85
|
+
"README.md",
|
|
86
|
+
"LICENSE"
|
|
87
|
+
],
|
|
88
|
+
"publishConfig": {
|
|
89
|
+
"access": "public"
|
|
90
|
+
}
|
|
91
|
+
}
|