stormcloud-video-player 0.5.3 → 0.5.5
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 +526 -379
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +356 -221
- package/lib/index.d.ts +356 -221
- package/lib/index.js +485 -338
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +255 -117
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +8 -1
- package/lib/players/FilePlayer.cjs +99 -116
- package/lib/players/FilePlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +307 -169
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +386 -248
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +21 -11
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/ima.cjs +28 -20
- package/lib/sdk/ima.cjs.map +1 -1
- package/lib/sdk/prebid.cjs +17 -9
- package/lib/sdk/prebid.cjs.map +1 -1
- package/lib/sdk/prebidController.cjs +24 -12
- package/lib/sdk/prebidController.cjs.map +1 -1
- package/lib/sdk/vastParser.cjs +19 -11
- package/lib/sdk/vastParser.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +346 -199
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/browserCompat.cjs +11 -11
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/polyfills.cjs +13 -13
- package/lib/utils/polyfills.cjs.map +1 -1
- package/lib/utils/tracking.cjs +19 -11
- package/lib/utils/tracking.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -152,12 +152,22 @@ function _object_spread_props(target, source) {
|
|
|
152
152
|
}
|
|
153
153
|
function _object_without_properties(source, excluded) {
|
|
154
154
|
if (source == null) return {};
|
|
155
|
-
var target =
|
|
156
|
-
|
|
155
|
+
var target = {}, sourceKeys, key, i;
|
|
156
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
157
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
158
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
159
|
+
key = sourceKeys[i];
|
|
160
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
161
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
162
|
+
target[key] = source[key];
|
|
163
|
+
}
|
|
164
|
+
return target;
|
|
165
|
+
}
|
|
166
|
+
target = _object_without_properties_loose(source, excluded);
|
|
157
167
|
if (Object.getOwnPropertySymbols) {
|
|
158
|
-
|
|
159
|
-
for(i = 0; i <
|
|
160
|
-
key =
|
|
168
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
169
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
170
|
+
key = sourceKeys[i];
|
|
161
171
|
if (excluded.indexOf(key) >= 0) continue;
|
|
162
172
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
163
173
|
target[key] = source[key];
|
|
@@ -167,12 +177,11 @@ function _object_without_properties(source, excluded) {
|
|
|
167
177
|
}
|
|
168
178
|
function _object_without_properties_loose(source, excluded) {
|
|
169
179
|
if (source == null) return {};
|
|
170
|
-
var target = {};
|
|
171
|
-
var sourceKeys = Object.keys(source);
|
|
172
|
-
var key, i;
|
|
180
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
173
181
|
for(i = 0; i < sourceKeys.length; i++){
|
|
174
182
|
key = sourceKeys[i];
|
|
175
183
|
if (excluded.indexOf(key) >= 0) continue;
|
|
184
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
176
185
|
target[key] = source[key];
|
|
177
186
|
}
|
|
178
187
|
return target;
|
|
@@ -204,9 +213,17 @@ function _ts_generator(thisArg, body) {
|
|
|
204
213
|
},
|
|
205
214
|
trys: [],
|
|
206
215
|
ops: []
|
|
207
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
208
|
-
return
|
|
209
|
-
|
|
216
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
217
|
+
return d(g, "next", {
|
|
218
|
+
value: verb(0)
|
|
219
|
+
}), d(g, "throw", {
|
|
220
|
+
value: verb(1)
|
|
221
|
+
}), d(g, "return", {
|
|
222
|
+
value: verb(2)
|
|
223
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
224
|
+
value: function() {
|
|
225
|
+
return this;
|
|
226
|
+
}
|
|
210
227
|
}), g;
|
|
211
228
|
function verb(n) {
|
|
212
229
|
return function(v) {
|
|
@@ -306,20 +323,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
306
323
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
307
324
|
var __getProtoOf = Object.getPrototypeOf;
|
|
308
325
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
309
|
-
var __export = function(target, all) {
|
|
326
|
+
var __export = function __export(target, all) {
|
|
310
327
|
for(var name in all)__defProp(target, name, {
|
|
311
328
|
get: all[name],
|
|
312
329
|
enumerable: true
|
|
313
330
|
});
|
|
314
331
|
};
|
|
315
|
-
var __copyProps = function(to, from, except, desc) {
|
|
332
|
+
var __copyProps = function __copyProps(to, from, except, desc) {
|
|
316
333
|
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
317
334
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
318
335
|
try {
|
|
319
336
|
var _loop = function() {
|
|
320
337
|
var key = _step.value;
|
|
321
338
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
322
|
-
get: function() {
|
|
339
|
+
get: function get() {
|
|
323
340
|
return from[key];
|
|
324
341
|
},
|
|
325
342
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
@@ -343,7 +360,7 @@ var __copyProps = function(to, from, except, desc) {
|
|
|
343
360
|
}
|
|
344
361
|
return to;
|
|
345
362
|
};
|
|
346
|
-
var __toESM = function(mod, isNodeMode, target) {
|
|
363
|
+
var __toESM = function __toESM(mod, isNodeMode, target) {
|
|
347
364
|
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
348
365
|
// file that has been converted to a CommonJS file using a Babel-
|
|
349
366
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
@@ -353,7 +370,7 @@ var __toESM = function(mod, isNodeMode, target) {
|
|
|
353
370
|
enumerable: true
|
|
354
371
|
}) : target, mod);
|
|
355
372
|
};
|
|
356
|
-
var __toCommonJS = function(mod) {
|
|
373
|
+
var __toCommonJS = function __toCommonJS(mod) {
|
|
357
374
|
return __copyProps(__defProp({}, "__esModule", {
|
|
358
375
|
value: true
|
|
359
376
|
}), mod);
|
|
@@ -361,7 +378,7 @@ var __toCommonJS = function(mod) {
|
|
|
361
378
|
// src/ui/StormcloudVideoPlayer.tsx
|
|
362
379
|
var StormcloudVideoPlayer_exports = {};
|
|
363
380
|
__export(StormcloudVideoPlayer_exports, {
|
|
364
|
-
StormcloudVideoPlayerComponent: function() {
|
|
381
|
+
StormcloudVideoPlayerComponent: function StormcloudVideoPlayerComponent1() {
|
|
365
382
|
return StormcloudVideoPlayerComponent;
|
|
366
383
|
}
|
|
367
384
|
});
|
|
@@ -696,7 +713,7 @@ function createImaController(video, options) {
|
|
|
696
713
|
var fn = _step.value;
|
|
697
714
|
try {
|
|
698
715
|
fn(payload);
|
|
699
|
-
} catch (
|
|
716
|
+
} catch (unused) {}
|
|
700
717
|
}
|
|
701
718
|
} catch (err) {
|
|
702
719
|
_didIteratorError = true;
|
|
@@ -734,7 +751,7 @@ function createImaController(video, options) {
|
|
|
734
751
|
console.error("StormcloudVideoPlayer: The host page is inside a sandboxed iframe without 'allow-scripts'. Google IMA cannot run ads within sandboxed frames. Remove the sandbox attribute or include 'allow-scripts allow-same-origin'.");
|
|
735
752
|
}
|
|
736
753
|
}
|
|
737
|
-
} catch (
|
|
754
|
+
} catch (unused) {}
|
|
738
755
|
if (typeof window !== "undefined" && ((_window_google = window.google) === null || _window_google === void 0 ? void 0 : _window_google.ima)) return Promise.resolve();
|
|
739
756
|
var existing = document.querySelector('script[data-ima="true"]');
|
|
740
757
|
if (existing) {
|
|
@@ -982,7 +999,7 @@ function createImaController(video, options) {
|
|
|
982
999
|
if (adsManager) {
|
|
983
1000
|
try {
|
|
984
1001
|
adsManager.destroy();
|
|
985
|
-
} catch (
|
|
1002
|
+
} catch (unused) {}
|
|
986
1003
|
adsManager = void 0;
|
|
987
1004
|
}
|
|
988
1005
|
if (adVideoElement) {
|
|
@@ -993,7 +1010,7 @@ function createImaController(video, options) {
|
|
|
993
1010
|
if (adsLoader) {
|
|
994
1011
|
try {
|
|
995
1012
|
adsLoader.destroy();
|
|
996
|
-
} catch (
|
|
1013
|
+
} catch (unused) {}
|
|
997
1014
|
adsLoader = void 0;
|
|
998
1015
|
}
|
|
999
1016
|
}
|
|
@@ -1011,7 +1028,7 @@ function createImaController(video, options) {
|
|
|
1011
1028
|
try {
|
|
1012
1029
|
var _adDisplayContainer_initialize;
|
|
1013
1030
|
(_adDisplayContainer_initialize = adDisplayContainer.initialize) === null || _adDisplayContainer_initialize === void 0 ? void 0 : _adDisplayContainer_initialize.call(adDisplayContainer);
|
|
1014
|
-
} catch (
|
|
1031
|
+
} catch (unused) {}
|
|
1015
1032
|
}
|
|
1016
1033
|
}).catch(function() {});
|
|
1017
1034
|
},
|
|
@@ -1170,7 +1187,7 @@ function createImaController(video, options) {
|
|
|
1170
1187
|
window.setTimeout(function() {
|
|
1171
1188
|
try {
|
|
1172
1189
|
makeAdsRequest(google, lastAdTagUrl);
|
|
1173
|
-
} catch (
|
|
1190
|
+
} catch (unused) {}
|
|
1174
1191
|
}, delay);
|
|
1175
1192
|
} else {
|
|
1176
1193
|
emit("ad_error", {
|
|
@@ -1202,7 +1219,7 @@ function createImaController(video, options) {
|
|
|
1202
1219
|
if (adsManager) {
|
|
1203
1220
|
try {
|
|
1204
1221
|
adsManager.setVolume(adVolume);
|
|
1205
|
-
} catch (
|
|
1222
|
+
} catch (unused) {}
|
|
1206
1223
|
}
|
|
1207
1224
|
emit("content_pause");
|
|
1208
1225
|
});
|
|
@@ -1216,7 +1233,7 @@ function createImaController(video, options) {
|
|
|
1216
1233
|
if (adsManager) {
|
|
1217
1234
|
try {
|
|
1218
1235
|
adsManager.setVolume(originalMutedState ? 0 : adVolume);
|
|
1219
|
-
} catch (
|
|
1236
|
+
} catch (unused) {}
|
|
1220
1237
|
}
|
|
1221
1238
|
}
|
|
1222
1239
|
if (adContainerEl) {
|
|
@@ -1377,7 +1394,7 @@ function createImaController(video, options) {
|
|
|
1377
1394
|
}
|
|
1378
1395
|
try {
|
|
1379
1396
|
adsManager.setVolume(originalMutedState ? 0 : adVolume);
|
|
1380
|
-
} catch (
|
|
1397
|
+
} catch (unused) {}
|
|
1381
1398
|
adsManager.start();
|
|
1382
1399
|
return [
|
|
1383
1400
|
2,
|
|
@@ -1459,7 +1476,7 @@ function createImaController(video, options) {
|
|
|
1459
1476
|
try {
|
|
1460
1477
|
;
|
|
1461
1478
|
adsManager === null || adsManager === void 0 ? void 0 : (_adsManager_stop = adsManager.stop) === null || _adsManager_stop === void 0 ? void 0 : _adsManager_stop.call(adsManager);
|
|
1462
|
-
} catch (
|
|
1479
|
+
} catch (unused) {}
|
|
1463
1480
|
destroyAdsManager();
|
|
1464
1481
|
return [
|
|
1465
1482
|
2
|
|
@@ -1490,7 +1507,7 @@ function createImaController(video, options) {
|
|
|
1490
1507
|
try {
|
|
1491
1508
|
var _adsLoader_destroy;
|
|
1492
1509
|
adsLoader === null || adsLoader === void 0 ? void 0 : (_adsLoader_destroy = adsLoader.destroy) === null || _adsLoader_destroy === void 0 ? void 0 : _adsLoader_destroy.call(adsLoader);
|
|
1493
|
-
} catch (
|
|
1510
|
+
} catch (unused) {}
|
|
1494
1511
|
adDisplayContainer = void 0;
|
|
1495
1512
|
adsLoader = void 0;
|
|
1496
1513
|
contentVideoHidden = false;
|
|
@@ -1539,7 +1556,7 @@ function createImaController(video, options) {
|
|
|
1539
1556
|
if (adsManager && adPlaying) {
|
|
1540
1557
|
try {
|
|
1541
1558
|
adsManager.setVolume(clampedVolume);
|
|
1542
|
-
} catch (
|
|
1559
|
+
} catch (unused) {}
|
|
1543
1560
|
}
|
|
1544
1561
|
},
|
|
1545
1562
|
getAdVolume: function getAdVolume() {
|
|
@@ -2027,10 +2044,10 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
2027
2044
|
if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
|
|
2028
2045
|
if (contentVideo.paused) {
|
|
2029
2046
|
console.log("[HlsAdPlayer] Content video paused in live mode, resuming playback");
|
|
2030
|
-
contentVideo.play().catch(function() {});
|
|
2031
2047
|
} else {
|
|
2032
2048
|
console.log("[HlsAdPlayer] Content video already playing in live mode");
|
|
2033
2049
|
}
|
|
2050
|
+
contentVideo.play().catch(function() {});
|
|
2034
2051
|
}
|
|
2035
2052
|
emit("content_resume");
|
|
2036
2053
|
}
|
|
@@ -2303,8 +2320,8 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
2303
2320
|
if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
|
|
2304
2321
|
if (contentVideo.paused) {
|
|
2305
2322
|
console.log("[HlsAdPlayer] Content video paused in live mode, resuming playback on stop");
|
|
2306
|
-
contentVideo.play().catch(function() {});
|
|
2307
2323
|
}
|
|
2324
|
+
contentVideo.play().catch(function() {});
|
|
2308
2325
|
}
|
|
2309
2326
|
if (adHls) {
|
|
2310
2327
|
adHls.destroy();
|
|
@@ -2313,6 +2330,8 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
2313
2330
|
if (adVideoElement) {
|
|
2314
2331
|
adVideoElement.pause();
|
|
2315
2332
|
adVideoElement.src = "";
|
|
2333
|
+
adVideoElement.remove();
|
|
2334
|
+
adVideoElement = void 0;
|
|
2316
2335
|
}
|
|
2317
2336
|
currentAd = void 0;
|
|
2318
2337
|
return [
|
|
@@ -2455,8 +2474,8 @@ var DEFAULT_TIMEOUT_MS = 3e3;
|
|
|
2455
2474
|
var AUCTION_URL = "https://sspproxy.adstorm.co/openrtb2/auction/adstorm";
|
|
2456
2475
|
function createPrebidManager() {
|
|
2457
2476
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2458
|
-
var initialized = false;
|
|
2459
2477
|
var _options_debug;
|
|
2478
|
+
var initialized = false;
|
|
2460
2479
|
var debug = (_options_debug = options.debug) !== null && _options_debug !== void 0 ? _options_debug : false;
|
|
2461
2480
|
function log() {
|
|
2462
2481
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
@@ -2958,13 +2977,15 @@ function createPrebidController(contentVideo, options) {
|
|
|
2958
2977
|
adContainerEl.style.display = "none";
|
|
2959
2978
|
adContainerEl.style.pointerEvents = "none";
|
|
2960
2979
|
}
|
|
2980
|
+
contentVideo.style.visibility = "visible";
|
|
2981
|
+
contentVideo.style.opacity = "1";
|
|
2961
2982
|
if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
|
|
2962
2983
|
if (contentVideo.paused) {
|
|
2963
2984
|
console.log("".concat(LOG, " Content video paused in live mode, resuming playback"));
|
|
2964
|
-
contentVideo.play().catch(function() {});
|
|
2965
2985
|
} else {
|
|
2966
2986
|
console.log("".concat(LOG, " Content video already playing in live mode"));
|
|
2967
2987
|
}
|
|
2988
|
+
contentVideo.play().catch(function() {});
|
|
2968
2989
|
}
|
|
2969
2990
|
emit("content_resume");
|
|
2970
2991
|
}
|
|
@@ -3330,8 +3351,8 @@ function createPrebidController(contentVideo, options) {
|
|
|
3330
3351
|
if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
|
|
3331
3352
|
if (contentVideo.paused) {
|
|
3332
3353
|
console.log("".concat(LOG, " Content video paused in live mode, resuming playback on stop"));
|
|
3333
|
-
contentVideo.play().catch(function() {});
|
|
3334
3354
|
}
|
|
3355
|
+
contentVideo.play().catch(function() {});
|
|
3335
3356
|
}
|
|
3336
3357
|
if (adHls) {
|
|
3337
3358
|
adHls.destroy();
|
|
@@ -3340,6 +3361,8 @@ function createPrebidController(contentVideo, options) {
|
|
|
3340
3361
|
if (adVideoElement) {
|
|
3341
3362
|
adVideoElement.pause();
|
|
3342
3363
|
adVideoElement.src = "";
|
|
3364
|
+
adVideoElement.remove();
|
|
3365
|
+
adVideoElement = void 0;
|
|
3343
3366
|
}
|
|
3344
3367
|
currentAd = void 0;
|
|
3345
3368
|
return [
|
|
@@ -4108,6 +4131,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4108
4131
|
this.minAdRequestIntervalMs = 2500;
|
|
4109
4132
|
this.backoffBaseMs = 1e3;
|
|
4110
4133
|
this.maxBackoffMs = 15e3;
|
|
4134
|
+
this.continuousFetchWallClockBufferMs = 3e4;
|
|
4135
|
+
this.continuousFetchMaxIterations = 500;
|
|
4136
|
+
this.continuousFetchQueueFullConsecutiveWaits = 0;
|
|
4111
4137
|
this.preloadPool = [];
|
|
4112
4138
|
this.maxPreloadPoolSize = 3;
|
|
4113
4139
|
this.preloadPoolActive = false;
|
|
@@ -4167,6 +4193,15 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4167
4193
|
}
|
|
4168
4194
|
}
|
|
4169
4195
|
},
|
|
4196
|
+
{
|
|
4197
|
+
key: "getAdPlayerTypeLabel",
|
|
4198
|
+
value: function getAdPlayerTypeLabel() {
|
|
4199
|
+
var t = this.config.adPlayerType;
|
|
4200
|
+
if (t === "prebid") return "Prebid";
|
|
4201
|
+
if (t === "hls") return "HLS";
|
|
4202
|
+
return "IMA";
|
|
4203
|
+
}
|
|
4204
|
+
},
|
|
4170
4205
|
{
|
|
4171
4206
|
key: "load",
|
|
4172
4207
|
value: function load() {
|
|
@@ -4266,7 +4301,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4266
4301
|
});
|
|
4267
4302
|
this.hls.on(import_hls3.default.Events.MANIFEST_PARSED, function(_, data) {
|
|
4268
4303
|
return _async_to_generator(function() {
|
|
4269
|
-
var
|
|
4304
|
+
var _this_config_minSegmentsBeforePlay, _ref, _this_hls_levels, _this_hls, adBehavior, minSegments, _this_video_play;
|
|
4270
4305
|
return _ts_generator(this, function(_state) {
|
|
4271
4306
|
switch(_state.label){
|
|
4272
4307
|
case 0:
|
|
@@ -4275,10 +4310,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4275
4310
|
} else {
|
|
4276
4311
|
;
|
|
4277
4312
|
;
|
|
4278
|
-
this.isLiveStream = (
|
|
4313
|
+
this.isLiveStream = (_ref = (_this_hls = this.hls) === null || _this_hls === void 0 ? void 0 : (_this_hls_levels = _this_hls.levels) === null || _this_hls_levels === void 0 ? void 0 : _this_hls_levels.some(function(level) {
|
|
4279
4314
|
var _level_details, _level_details1;
|
|
4280
4315
|
return (level === null || level === void 0 ? void 0 : (_level_details = level.details) === null || _level_details === void 0 ? void 0 : _level_details.live) === true || (level === null || level === void 0 ? void 0 : (_level_details1 = level.details) === null || _level_details1 === void 0 ? void 0 : _level_details1.type) === "LIVE";
|
|
4281
|
-
})) !== null &&
|
|
4316
|
+
})) !== null && _ref !== void 0 ? _ref : false;
|
|
4282
4317
|
}
|
|
4283
4318
|
if (this.config.debugAdTiming) {
|
|
4284
4319
|
adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
|
|
@@ -4342,9 +4377,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4342
4377
|
var tag = "";
|
|
4343
4378
|
var value = "";
|
|
4344
4379
|
if (Array.isArray(entry)) {
|
|
4345
|
-
var _entry_;
|
|
4380
|
+
var _entry_, _entry_1;
|
|
4346
4381
|
tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
|
|
4347
|
-
var _entry_1;
|
|
4348
4382
|
value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
|
|
4349
4383
|
} else if (typeof entry === "string") {
|
|
4350
4384
|
var idx = entry.indexOf(":");
|
|
@@ -4467,9 +4501,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4467
4501
|
var tag = "";
|
|
4468
4502
|
var value = "";
|
|
4469
4503
|
if (Array.isArray(entry)) {
|
|
4470
|
-
var _entry_;
|
|
4504
|
+
var _entry_, _entry_1;
|
|
4471
4505
|
tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
|
|
4472
|
-
var _entry_1;
|
|
4473
4506
|
value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
|
|
4474
4507
|
} else if (typeof entry === "string") {
|
|
4475
4508
|
var idx = entry.indexOf(":");
|
|
@@ -4519,10 +4552,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4519
4552
|
}
|
|
4520
4553
|
});
|
|
4521
4554
|
} else if (tag.includes("EXT-X-DATERANGE")) {
|
|
4555
|
+
var _attrs_CLASS;
|
|
4522
4556
|
var attrs = _this.parseAttributeList(value);
|
|
4523
4557
|
var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
|
|
4524
4558
|
var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
|
|
4525
|
-
var _attrs_CLASS;
|
|
4526
4559
|
var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
|
|
4527
4560
|
var duration = _this.toNumber(attrs["DURATION"]);
|
|
4528
4561
|
if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
|
|
@@ -4658,6 +4691,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4658
4691
|
}
|
|
4659
4692
|
});
|
|
4660
4693
|
this.ima.on("content_resume", function() {
|
|
4694
|
+
console.log("[StormcloudVideoPlayer] content_resume received, inAdBreak=%s, remaining=%s", _this.inAdBreak, _this.getRemainingAdMs());
|
|
4661
4695
|
if (!_this.video.muted) {
|
|
4662
4696
|
_this.video.muted = true;
|
|
4663
4697
|
_this.video.volume = 0;
|
|
@@ -4688,15 +4722,16 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4688
4722
|
}
|
|
4689
4723
|
},
|
|
4690
4724
|
{
|
|
4691
|
-
key: "
|
|
4692
|
-
value: function
|
|
4725
|
+
key: "recreateAdController",
|
|
4726
|
+
value: function recreateAdController() {
|
|
4727
|
+
var label = this.getAdPlayerTypeLabel();
|
|
4693
4728
|
if (this.config.debugAdTiming) {
|
|
4694
|
-
console.log("[StormcloudVideoPlayer] Recreating
|
|
4729
|
+
console.log("[StormcloudVideoPlayer] Recreating ad controller (".concat(label, ") for new ad"));
|
|
4695
4730
|
}
|
|
4696
4731
|
var shouldShowPlaceholder = this.inAdBreak && this.showAds;
|
|
4697
4732
|
if (shouldShowPlaceholder && this.ima) {
|
|
4698
4733
|
if (this.config.debugAdTiming) {
|
|
4699
|
-
console.log("[StormcloudVideoPlayer] Showing placeholder before destroying old
|
|
4734
|
+
console.log("[StormcloudVideoPlayer] Showing placeholder before destroying old ".concat(label, " controller"));
|
|
4700
4735
|
}
|
|
4701
4736
|
this.showPlaceholderLayer();
|
|
4702
4737
|
this.ima.showPlaceholder();
|
|
@@ -4709,7 +4744,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4709
4744
|
this.video.volume = 0;
|
|
4710
4745
|
} catch (error) {
|
|
4711
4746
|
if (this.config.debugAdTiming) {
|
|
4712
|
-
console.warn("[StormcloudVideoPlayer] Error destroying old
|
|
4747
|
+
console.warn("[StormcloudVideoPlayer] Error destroying old ".concat(label, " controller:"), error);
|
|
4713
4748
|
}
|
|
4714
4749
|
}
|
|
4715
4750
|
}
|
|
@@ -4789,7 +4824,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4789
4824
|
});
|
|
4790
4825
|
}
|
|
4791
4826
|
if (this.config.debugAdTiming) {
|
|
4792
|
-
console.log("[StormcloudVideoPlayer] Showing placeholder layer (between content and
|
|
4827
|
+
console.log("[StormcloudVideoPlayer] Showing placeholder layer (between content and ".concat(this.getAdPlayerTypeLabel(), ")"));
|
|
4793
4828
|
}
|
|
4794
4829
|
}
|
|
4795
4830
|
},
|
|
@@ -4924,11 +4959,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4924
4959
|
}
|
|
4925
4960
|
var daterangeMatch = text.match(/EXT-X-DATERANGE:([^\r\n]*)/i);
|
|
4926
4961
|
if (daterangeMatch) {
|
|
4927
|
-
var _daterangeMatch_;
|
|
4962
|
+
var _daterangeMatch_, _attrs_CLASS;
|
|
4928
4963
|
var attrs = this.parseAttributeList((_daterangeMatch_ = daterangeMatch[1]) !== null && _daterangeMatch_ !== void 0 ? _daterangeMatch_ : "");
|
|
4929
4964
|
var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
|
|
4930
4965
|
var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
|
|
4931
|
-
var _attrs_CLASS;
|
|
4932
4966
|
var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
|
|
4933
4967
|
var duration = this.toNumber(attrs["DURATION"]);
|
|
4934
4968
|
if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
|
|
@@ -5004,7 +5038,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5004
5038
|
var out = "";
|
|
5005
5039
|
for(var i = 0; i < value.length; i++)out += String.fromCharCode(value[i]);
|
|
5006
5040
|
return out;
|
|
5007
|
-
} catch (
|
|
5041
|
+
} catch (unused) {
|
|
5008
5042
|
return void 0;
|
|
5009
5043
|
}
|
|
5010
5044
|
}
|
|
@@ -5023,6 +5057,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5023
5057
|
});
|
|
5024
5058
|
}
|
|
5025
5059
|
if (marker.type === "start") {
|
|
5060
|
+
var _this_config_immediateManifestAds;
|
|
5026
5061
|
var _this_pendingAdBreak;
|
|
5027
5062
|
if (!this.video.muted) {
|
|
5028
5063
|
this.video.muted = true;
|
|
@@ -5047,7 +5082,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5047
5082
|
this.expectedAdBreakDurationMs = durationMs;
|
|
5048
5083
|
this.currentAdBreakStartWallClockMs = Date.now();
|
|
5049
5084
|
var isManifestMarker = this.isManifestBasedMarker(marker);
|
|
5050
|
-
var _this_config_immediateManifestAds;
|
|
5051
5085
|
var forceImmediate = (_this_config_immediateManifestAds = this.config.immediateManifestAds) !== null && _this_config_immediateManifestAds !== void 0 ? _this_config_immediateManifestAds : true;
|
|
5052
5086
|
if (this.config.debugAdTiming) {
|
|
5053
5087
|
console.log("[StormcloudVideoPlayer] Ad start decision:", {
|
|
@@ -5202,9 +5236,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5202
5236
|
var regex = /([A-Z0-9-]+)=(("[^"]*")|([^",]*))(?:,|$)/gi;
|
|
5203
5237
|
var match;
|
|
5204
5238
|
while((match = regex.exec(value)) !== null){
|
|
5205
|
-
var _match_;
|
|
5239
|
+
var _match_, _ref, _match_1;
|
|
5206
5240
|
var key = (_match_ = match[1]) !== null && _match_ !== void 0 ? _match_ : "";
|
|
5207
|
-
var _match_1, _ref;
|
|
5208
5241
|
var rawVal = (_ref = (_match_1 = match[3]) !== null && _match_1 !== void 0 ? _match_1 : match[4]) !== null && _ref !== void 0 ? _ref : "";
|
|
5209
5242
|
if (rawVal.startsWith('"') && rawVal.endsWith('"')) {
|
|
5210
5243
|
rawVal = rawVal.slice(1, -1);
|
|
@@ -5503,6 +5536,14 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5503
5536
|
return this.config.adPlayerType === "prebid";
|
|
5504
5537
|
}
|
|
5505
5538
|
},
|
|
5539
|
+
{
|
|
5540
|
+
key: "isLgStbDevice",
|
|
5541
|
+
value: function isLgStbDevice() {
|
|
5542
|
+
if (typeof navigator === "undefined" || !navigator.userAgent) return false;
|
|
5543
|
+
var ua = navigator.userAgent;
|
|
5544
|
+
return /Web0S|webOS|LG Browser|LGSTB/i.test(ua);
|
|
5545
|
+
}
|
|
5546
|
+
},
|
|
5506
5547
|
{
|
|
5507
5548
|
key: "getCurrentAdIndex",
|
|
5508
5549
|
value: function getCurrentAdIndex() {
|
|
@@ -5563,13 +5604,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5563
5604
|
{
|
|
5564
5605
|
key: "shouldShowNativeControls",
|
|
5565
5606
|
value: function shouldShowNativeControls() {
|
|
5607
|
+
var _this_config_showCustomControls;
|
|
5566
5608
|
var streamType = this.getStreamType();
|
|
5567
5609
|
if (streamType === "other") {
|
|
5568
|
-
var
|
|
5569
|
-
return !((
|
|
5610
|
+
var _this_config_showCustomControls1;
|
|
5611
|
+
return !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false);
|
|
5570
5612
|
}
|
|
5571
|
-
|
|
5572
|
-
return !!(this.config.allowNativeHls && !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false));
|
|
5613
|
+
return !!(this.config.allowNativeHls && !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false));
|
|
5573
5614
|
}
|
|
5574
5615
|
},
|
|
5575
5616
|
{
|
|
@@ -5728,12 +5769,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5728
5769
|
continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
|
|
5729
5770
|
preloadIma = this.createAdPlayer(continueLiveStreamDuringAds);
|
|
5730
5771
|
preloadIma.initialize();
|
|
5731
|
-
errorListener = function(payload) {
|
|
5772
|
+
errorListener = function errorListener(payload) {
|
|
5732
5773
|
hasAdError = true;
|
|
5733
5774
|
adErrorPayload = payload;
|
|
5734
5775
|
};
|
|
5735
5776
|
preloadIma.on("ad_error", errorListener);
|
|
5736
|
-
errorListenerCleanup = function() {
|
|
5777
|
+
errorListenerCleanup = function errorListenerCleanup() {
|
|
5737
5778
|
return preloadIma.off("ad_error", errorListener);
|
|
5738
5779
|
};
|
|
5739
5780
|
return [
|
|
@@ -5784,7 +5825,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5784
5825
|
isReady: true,
|
|
5785
5826
|
loadPromise: Promise.resolve()
|
|
5786
5827
|
};
|
|
5787
|
-
lateErrorListener = function(payload) {
|
|
5828
|
+
lateErrorListener = function lateErrorListener(payload) {
|
|
5788
5829
|
var index = _this.preloadPool.findIndex(function(entry) {
|
|
5789
5830
|
return entry.vastUrl === vastUrl;
|
|
5790
5831
|
});
|
|
@@ -5795,7 +5836,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5795
5836
|
}
|
|
5796
5837
|
try {
|
|
5797
5838
|
preloadIma.destroy();
|
|
5798
|
-
} catch (
|
|
5839
|
+
} catch (unused) {}
|
|
5799
5840
|
}
|
|
5800
5841
|
};
|
|
5801
5842
|
preloadIma.on("ad_error", lateErrorListener);
|
|
@@ -6317,15 +6358,34 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6317
6358
|
key: "continuousFetchLoop",
|
|
6318
6359
|
value: function continuousFetchLoop(baseVastUrl) {
|
|
6319
6360
|
return _async_to_generator(function() {
|
|
6320
|
-
var _this, _loop, _ret;
|
|
6361
|
+
var loopIterations, _this, _loop, _ret;
|
|
6321
6362
|
return _ts_generator(this, function(_state) {
|
|
6322
6363
|
switch(_state.label){
|
|
6323
6364
|
case 0:
|
|
6365
|
+
loopIterations = 0;
|
|
6366
|
+
_state.label = 1;
|
|
6367
|
+
case 1:
|
|
6368
|
+
_state.trys.push([
|
|
6369
|
+
1,
|
|
6370
|
+
,
|
|
6371
|
+
5,
|
|
6372
|
+
6
|
|
6373
|
+
]);
|
|
6324
6374
|
_loop = function() {
|
|
6325
|
-
var remaining, maxQueueSize, newAdUrl, queuedUrlsPreview, generationDelay;
|
|
6375
|
+
var remaining, elapsedMs, maxLoopMs, maxQueueSize, newAdUrl, queuedUrlsPreview, generationDelay;
|
|
6326
6376
|
return _ts_generator(this, function(_state) {
|
|
6327
6377
|
switch(_state.label){
|
|
6328
6378
|
case 0:
|
|
6379
|
+
loopIterations++;
|
|
6380
|
+
if (loopIterations > _this.continuousFetchMaxIterations) {
|
|
6381
|
+
if (_this.config.debugAdTiming) {
|
|
6382
|
+
console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Max iterations reached (".concat(_this.continuousFetchMaxIterations, "), stopping URL generation"));
|
|
6383
|
+
}
|
|
6384
|
+
return [
|
|
6385
|
+
2,
|
|
6386
|
+
"break"
|
|
6387
|
+
];
|
|
6388
|
+
}
|
|
6329
6389
|
remaining = _this.getRemainingAdMs();
|
|
6330
6390
|
if (remaining <= 0) {
|
|
6331
6391
|
if (_this.config.debugAdTiming) {
|
|
@@ -6336,6 +6396,19 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6336
6396
|
"break"
|
|
6337
6397
|
];
|
|
6338
6398
|
}
|
|
6399
|
+
if (_this.currentAdBreakStartWallClockMs != null && _this.expectedAdBreakDurationMs != null) {
|
|
6400
|
+
elapsedMs = Date.now() - _this.currentAdBreakStartWallClockMs;
|
|
6401
|
+
maxLoopMs = _this.expectedAdBreakDurationMs + _this.continuousFetchWallClockBufferMs;
|
|
6402
|
+
if (elapsedMs >= maxLoopMs) {
|
|
6403
|
+
if (_this.config.debugAdTiming) {
|
|
6404
|
+
console.log("[CONTINUOUS-FETCH] ⏹️ Wall-clock limit reached (".concat(elapsedMs, "ms >= ").concat(maxLoopMs, "ms), stopping URL generation"));
|
|
6405
|
+
}
|
|
6406
|
+
return [
|
|
6407
|
+
2,
|
|
6408
|
+
"break"
|
|
6409
|
+
];
|
|
6410
|
+
}
|
|
6411
|
+
}
|
|
6339
6412
|
if (_this.consecutiveFailures >= _this.maxConsecutiveFailures) {
|
|
6340
6413
|
if (_this.config.debugAdTiming) {
|
|
6341
6414
|
console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Too many consecutive failures (".concat(_this.consecutiveFailures, "), stopping URL generation"));
|
|
@@ -6357,46 +6430,63 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6357
6430
|
maxQueueSize = 5;
|
|
6358
6431
|
if (!(_this.adRequestQueue.length >= maxQueueSize)) return [
|
|
6359
6432
|
3,
|
|
6360
|
-
|
|
6433
|
+
4
|
|
6434
|
+
];
|
|
6435
|
+
if (!(_this.isPrebidMode() && _this.isLgStbDevice())) return [
|
|
6436
|
+
3,
|
|
6437
|
+
1
|
|
6361
6438
|
];
|
|
6439
|
+
_this.adRequestQueue.shift();
|
|
6440
|
+
_this.adRequestQueue.push("");
|
|
6441
|
+
_this.totalAdsInBreak++;
|
|
6442
|
+
_this.continuousFetchQueueFullConsecutiveWaits = 0;
|
|
6362
6443
|
if (_this.config.debugAdTiming) {
|
|
6363
|
-
console.log("[CONTINUOUS-FETCH]
|
|
6444
|
+
console.log("[CONTINUOUS-FETCH] Prebid slot rotated (queue full, dropped oldest); queue: ".concat(_this.adRequestQueue.length));
|
|
6364
6445
|
}
|
|
6365
6446
|
return [
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
return setTimeout(resolve, 1e3);
|
|
6369
|
-
})
|
|
6447
|
+
3,
|
|
6448
|
+
3
|
|
6370
6449
|
];
|
|
6371
6450
|
case 1:
|
|
6451
|
+
return [
|
|
6452
|
+
4,
|
|
6453
|
+
_this.waitForQueueWithBackoff()
|
|
6454
|
+
];
|
|
6455
|
+
case 2:
|
|
6372
6456
|
_state.sent();
|
|
6373
6457
|
return [
|
|
6374
6458
|
2,
|
|
6375
6459
|
"continue"
|
|
6376
6460
|
];
|
|
6377
|
-
case
|
|
6461
|
+
case 3:
|
|
6462
|
+
return [
|
|
6463
|
+
3,
|
|
6464
|
+
8
|
|
6465
|
+
];
|
|
6466
|
+
case 4:
|
|
6378
6467
|
if (!_this.isPrebidMode()) return [
|
|
6379
6468
|
3,
|
|
6380
|
-
|
|
6469
|
+
5
|
|
6381
6470
|
];
|
|
6382
6471
|
_this.adRequestQueue.push("");
|
|
6383
6472
|
_this.totalAdsInBreak++;
|
|
6473
|
+
_this.continuousFetchQueueFullConsecutiveWaits = 0;
|
|
6384
6474
|
if (_this.config.debugAdTiming) {
|
|
6385
6475
|
console.log("[CONTINUOUS-FETCH] Prebid auction slot queued (queue: ".concat(_this.adRequestQueue.length, ")"));
|
|
6386
6476
|
}
|
|
6387
6477
|
return [
|
|
6388
6478
|
3,
|
|
6389
|
-
|
|
6479
|
+
8
|
|
6390
6480
|
];
|
|
6391
|
-
case
|
|
6481
|
+
case 5:
|
|
6392
6482
|
if (!baseVastUrl) return [
|
|
6393
6483
|
3,
|
|
6394
|
-
|
|
6484
|
+
8
|
|
6395
6485
|
];
|
|
6396
6486
|
newAdUrl = _this.generateVastUrlsWithCorrelators(baseVastUrl, 1)[0];
|
|
6397
6487
|
if (!(!newAdUrl || _this.failedVastUrls.has(newAdUrl) || _this.isUrlInCooldown(newAdUrl))) return [
|
|
6398
6488
|
3,
|
|
6399
|
-
|
|
6489
|
+
7
|
|
6400
6490
|
];
|
|
6401
6491
|
return [
|
|
6402
6492
|
4,
|
|
@@ -6404,13 +6494,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6404
6494
|
return setTimeout(resolve, 500);
|
|
6405
6495
|
})
|
|
6406
6496
|
];
|
|
6407
|
-
case
|
|
6497
|
+
case 6:
|
|
6408
6498
|
_state.sent();
|
|
6409
6499
|
return [
|
|
6410
6500
|
2,
|
|
6411
6501
|
"continue"
|
|
6412
6502
|
];
|
|
6413
|
-
case
|
|
6503
|
+
case 7:
|
|
6414
6504
|
if (_this.config.debugAdTiming) {
|
|
6415
6505
|
queuedUrlsPreview = _to_consumable_array(_this.adRequestQueue).concat([
|
|
6416
6506
|
newAdUrl
|
|
@@ -6421,8 +6511,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6421
6511
|
}
|
|
6422
6512
|
_this.adRequestQueue.push(newAdUrl);
|
|
6423
6513
|
_this.totalAdsInBreak++;
|
|
6424
|
-
|
|
6425
|
-
|
|
6514
|
+
_this.continuousFetchQueueFullConsecutiveWaits = 0;
|
|
6515
|
+
_state.label = 8;
|
|
6516
|
+
case 8:
|
|
6426
6517
|
generationDelay = _this.consecutiveFailures > 0 ? Math.min(1e3 * Math.pow(2, _this.consecutiveFailures), 5e3) : 500;
|
|
6427
6518
|
return [
|
|
6428
6519
|
4,
|
|
@@ -6430,7 +6521,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6430
6521
|
return setTimeout(resolve, generationDelay);
|
|
6431
6522
|
})
|
|
6432
6523
|
];
|
|
6433
|
-
case
|
|
6524
|
+
case 9:
|
|
6434
6525
|
_state.sent();
|
|
6435
6526
|
return [
|
|
6436
6527
|
2
|
|
@@ -6438,34 +6529,72 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6438
6529
|
}
|
|
6439
6530
|
});
|
|
6440
6531
|
};
|
|
6441
|
-
_state.label =
|
|
6442
|
-
case
|
|
6532
|
+
_state.label = 2;
|
|
6533
|
+
case 2:
|
|
6443
6534
|
if (!(this.continuousFetchingActive && this.inAdBreak)) return [
|
|
6444
6535
|
3,
|
|
6445
|
-
|
|
6536
|
+
4
|
|
6446
6537
|
];
|
|
6447
6538
|
_this = this;
|
|
6448
6539
|
return [
|
|
6449
6540
|
5,
|
|
6450
6541
|
_ts_values(_loop())
|
|
6451
6542
|
];
|
|
6452
|
-
case
|
|
6543
|
+
case 3:
|
|
6453
6544
|
_ret = _state.sent();
|
|
6454
6545
|
if (_ret === "break") return [
|
|
6455
6546
|
3,
|
|
6456
|
-
|
|
6547
|
+
4
|
|
6457
6548
|
];
|
|
6458
6549
|
return [
|
|
6459
6550
|
3,
|
|
6460
|
-
|
|
6551
|
+
2
|
|
6461
6552
|
];
|
|
6462
|
-
case
|
|
6553
|
+
case 4:
|
|
6554
|
+
return [
|
|
6555
|
+
3,
|
|
6556
|
+
6
|
|
6557
|
+
];
|
|
6558
|
+
case 5:
|
|
6463
6559
|
this.continuousFetchLoopRunning = false;
|
|
6560
|
+
this.continuousFetchQueueFullConsecutiveWaits = 0;
|
|
6561
|
+
return [
|
|
6562
|
+
7
|
|
6563
|
+
];
|
|
6564
|
+
case 6:
|
|
6464
6565
|
if (this.config.debugAdTiming) {
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6566
|
+
this.logQueueState("URL generation loop ended");
|
|
6567
|
+
}
|
|
6568
|
+
return [
|
|
6569
|
+
2
|
|
6570
|
+
];
|
|
6571
|
+
}
|
|
6572
|
+
});
|
|
6573
|
+
}).call(this);
|
|
6574
|
+
}
|
|
6575
|
+
},
|
|
6576
|
+
{
|
|
6577
|
+
key: "waitForQueueWithBackoff",
|
|
6578
|
+
value: function waitForQueueWithBackoff() {
|
|
6579
|
+
return _async_to_generator(function() {
|
|
6580
|
+
var delayMs, shouldLog;
|
|
6581
|
+
return _ts_generator(this, function(_state) {
|
|
6582
|
+
switch(_state.label){
|
|
6583
|
+
case 0:
|
|
6584
|
+
this.continuousFetchQueueFullConsecutiveWaits++;
|
|
6585
|
+
delayMs = Math.min(1e3 * Math.pow(2, this.continuousFetchQueueFullConsecutiveWaits - 1), 5e3);
|
|
6586
|
+
shouldLog = this.config.debugAdTiming && (this.continuousFetchQueueFullConsecutiveWaits <= 2 || this.continuousFetchQueueFullConsecutiveWaits % 4 === 0);
|
|
6587
|
+
if (shouldLog) {
|
|
6588
|
+
console.log("[CONTINUOUS-FETCH] ⏸️ URL queue full (".concat(this.adRequestQueue.length, "), waiting ").concat(delayMs, "ms (wait #").concat(this.continuousFetchQueueFullConsecutiveWaits, ")"));
|
|
6468
6589
|
}
|
|
6590
|
+
return [
|
|
6591
|
+
4,
|
|
6592
|
+
new Promise(function(resolve) {
|
|
6593
|
+
return setTimeout(resolve, delayMs);
|
|
6594
|
+
})
|
|
6595
|
+
];
|
|
6596
|
+
case 1:
|
|
6597
|
+
_state.sent();
|
|
6469
6598
|
return [
|
|
6470
6599
|
2
|
|
6471
6600
|
];
|
|
@@ -6474,6 +6603,21 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6474
6603
|
}).call(this);
|
|
6475
6604
|
}
|
|
6476
6605
|
},
|
|
6606
|
+
{
|
|
6607
|
+
key: "logQueueState",
|
|
6608
|
+
value: function logQueueState(reason) {
|
|
6609
|
+
if (!this.config.debugAdTiming) return;
|
|
6610
|
+
console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 ".concat(reason), {
|
|
6611
|
+
queueLength: this.adRequestQueue.length,
|
|
6612
|
+
totalAdsInBreak: this.totalAdsInBreak,
|
|
6613
|
+
totalAdRequestsInBreak: this.totalAdRequestsInBreak,
|
|
6614
|
+
consecutiveFailures: this.consecutiveFailures,
|
|
6615
|
+
continuousFetchingActive: this.continuousFetchingActive,
|
|
6616
|
+
continuousFetchLoopRunning: this.continuousFetchLoopRunning,
|
|
6617
|
+
inAdBreak: this.inAdBreak
|
|
6618
|
+
});
|
|
6619
|
+
}
|
|
6620
|
+
},
|
|
6477
6621
|
{
|
|
6478
6622
|
key: "stopContinuousFetching",
|
|
6479
6623
|
value: function stopContinuousFetching() {
|
|
@@ -6620,7 +6764,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6620
6764
|
10
|
|
6621
6765
|
];
|
|
6622
6766
|
nextAdUrl = this.adRequestQueue.shift();
|
|
6623
|
-
if (
|
|
6767
|
+
if (nextAdUrl == null) {
|
|
6624
6768
|
return [
|
|
6625
6769
|
3,
|
|
6626
6770
|
4
|
|
@@ -6644,8 +6788,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6644
6788
|
4
|
|
6645
6789
|
];
|
|
6646
6790
|
}
|
|
6791
|
+
console.log("[StormcloudVideoPlayer] Requesting next ad (%s), queue remaining=%s", nextAdUrl === "" ? "Prebid" : "VAST", this.adRequestQueue.length);
|
|
6647
6792
|
if (this.config.debugAdTiming) {
|
|
6648
|
-
console.log("[CONTINUOUS-FETCH] \uD83C\uDFAC Requesting next ad via
|
|
6793
|
+
console.log("[CONTINUOUS-FETCH] \uD83C\uDFAC Requesting next ad via ".concat(this.getAdPlayerTypeLabel(), " (").concat(this.currentAdIndex + 1, "/").concat(this.totalAdsInBreak, ", ").concat(this.adRequestQueue.length, " remaining in queue)"));
|
|
6649
6794
|
}
|
|
6650
6795
|
currentMuted1 = this.video.muted;
|
|
6651
6796
|
currentVolume1 = this.video.volume;
|
|
@@ -6806,7 +6951,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6806
6951
|
9
|
|
6807
6952
|
];
|
|
6808
6953
|
nextAdUrl = this.adRequestQueue.shift();
|
|
6809
|
-
if (
|
|
6954
|
+
if (nextAdUrl == null) {
|
|
6810
6955
|
return [
|
|
6811
6956
|
3,
|
|
6812
6957
|
3
|
|
@@ -6825,7 +6970,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6825
6970
|
];
|
|
6826
6971
|
}
|
|
6827
6972
|
if (this.config.debugAdTiming) {
|
|
6828
|
-
console.log("[CONTINUOUS-FETCH]
|
|
6973
|
+
console.log("[CONTINUOUS-FETCH] ✅ Ad URL available, requesting via ".concat(this.getAdPlayerTypeLabel()));
|
|
6829
6974
|
}
|
|
6830
6975
|
this.isShowingPlaceholder = false;
|
|
6831
6976
|
this.ima.hidePlaceholder();
|
|
@@ -7011,11 +7156,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7011
7156
|
{
|
|
7012
7157
|
key: "ensureAdStoppedByTimer",
|
|
7013
7158
|
value: function ensureAdStoppedByTimer() {
|
|
7159
|
+
var _this_config_adBreakCheckIntervalMs, _this_expectedAdBreakDurationMs;
|
|
7014
7160
|
if (!this.inAdBreak) return;
|
|
7015
7161
|
this.adStopTimerId = void 0;
|
|
7016
7162
|
var adPlaying = this.ima.isAdPlaying();
|
|
7017
7163
|
var pendingAds = this.adPodQueue.length > 0;
|
|
7018
|
-
var _this_config_adBreakCheckIntervalMs;
|
|
7019
7164
|
var checkIntervalMs = Math.max(250, Math.floor((_this_config_adBreakCheckIntervalMs = this.config.adBreakCheckIntervalMs) !== null && _this_config_adBreakCheckIntervalMs !== void 0 ? _this_config_adBreakCheckIntervalMs : 1e3));
|
|
7020
7165
|
var maxExtensionMsConfig = this.config.maxAdBreakExtensionMs;
|
|
7021
7166
|
var maxExtensionMs = typeof maxExtensionMsConfig === "number" && maxExtensionMsConfig > 0 ? maxExtensionMsConfig : 6e4;
|
|
@@ -7023,7 +7168,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7023
7168
|
if (this.currentAdBreakStartWallClockMs != null) {
|
|
7024
7169
|
elapsedSinceStartMs = Date.now() - this.currentAdBreakStartWallClockMs;
|
|
7025
7170
|
}
|
|
7026
|
-
var _this_expectedAdBreakDurationMs;
|
|
7027
7171
|
var expectedDurationMs = (_this_expectedAdBreakDurationMs = this.expectedAdBreakDurationMs) !== null && _this_expectedAdBreakDurationMs !== void 0 ? _this_expectedAdBreakDurationMs : 0;
|
|
7028
7172
|
var overrunMs = Math.max(0, elapsedSinceStartMs - expectedDurationMs);
|
|
7029
7173
|
var shouldExtendAdBreak = (adPlaying || pendingAds || this.showAds) && overrunMs < maxExtensionMs;
|
|
@@ -7168,7 +7312,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7168
7312
|
}
|
|
7169
7313
|
throw new Error("Too many consecutive failures");
|
|
7170
7314
|
}
|
|
7171
|
-
this.
|
|
7315
|
+
this.recreateAdController();
|
|
7172
7316
|
requestToken = ++this.adRequestTokenCounter;
|
|
7173
7317
|
this.activeAdRequestToken = requestToken;
|
|
7174
7318
|
this.startAdRequestWatchdog(requestToken);
|
|
@@ -7280,15 +7424,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7280
7424
|
9
|
|
7281
7425
|
];
|
|
7282
7426
|
case 9:
|
|
7283
|
-
if (
|
|
7284
|
-
this.
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7427
|
+
if (vastTagUrl) {
|
|
7428
|
+
if (this.isTemporaryAdError(playError)) {
|
|
7429
|
+
this.temporaryFailureUrls.set(vastTagUrl, Date.now());
|
|
7430
|
+
if (this.config.debugAdTiming) {
|
|
7431
|
+
console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
|
|
7432
|
+
}
|
|
7433
|
+
} else {
|
|
7434
|
+
this.failedVastUrls.add(vastTagUrl);
|
|
7435
|
+
if (this.config.debugAdTiming) {
|
|
7436
|
+
console.log("[AD-ERROR] Permanent play error - URL blacklisted");
|
|
7437
|
+
}
|
|
7292
7438
|
}
|
|
7293
7439
|
}
|
|
7294
7440
|
this.clearAdFailsafeTimer();
|
|
@@ -7357,15 +7503,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7357
7503
|
15
|
|
7358
7504
|
];
|
|
7359
7505
|
case 15:
|
|
7360
|
-
if (
|
|
7361
|
-
this.
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7506
|
+
if (vastTagUrl) {
|
|
7507
|
+
if (this.isTemporaryAdError(error)) {
|
|
7508
|
+
this.temporaryFailureUrls.set(vastTagUrl, Date.now());
|
|
7509
|
+
if (this.config.debugAdTiming) {
|
|
7510
|
+
console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
|
|
7511
|
+
}
|
|
7512
|
+
} else {
|
|
7513
|
+
this.failedVastUrls.add(vastTagUrl);
|
|
7514
|
+
if (this.config.debugAdTiming) {
|
|
7515
|
+
console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
|
|
7516
|
+
}
|
|
7369
7517
|
}
|
|
7370
7518
|
}
|
|
7371
7519
|
this.clearAdRequestWatchdog();
|
|
@@ -7409,6 +7557,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7409
7557
|
this.showAds = false;
|
|
7410
7558
|
this.currentAdIndex = 0;
|
|
7411
7559
|
this.totalAdsInBreak = 0;
|
|
7560
|
+
this.totalAdRequestsInBreak = 0;
|
|
7412
7561
|
this.consecutiveFailures = 0;
|
|
7413
7562
|
this.ima.stop().catch(function() {});
|
|
7414
7563
|
var restoredMuted = this.ima.getOriginalMutedState();
|
|
@@ -7420,17 +7569,15 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7420
7569
|
this.video.volume = restoredVolume;
|
|
7421
7570
|
}
|
|
7422
7571
|
if (this.shouldContinueLiveStreamDuringAds()) {
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
if (this.
|
|
7572
|
+
var _this_video_play;
|
|
7573
|
+
if (this.config.debugAdTiming) {
|
|
7574
|
+
if (this.video.paused) {
|
|
7426
7575
|
console.log("[StormcloudVideoPlayer] Content video paused in live mode after ads, resuming playback");
|
|
7427
|
-
}
|
|
7428
|
-
(_this_video_play = this.video.play()) === null || _this_video_play === void 0 ? void 0 : _this_video_play.catch(function() {});
|
|
7429
|
-
} else {
|
|
7430
|
-
if (this.config.debugAdTiming) {
|
|
7576
|
+
} else {
|
|
7431
7577
|
console.log("[StormcloudVideoPlayer] Content video already playing in live mode after ads");
|
|
7432
7578
|
}
|
|
7433
7579
|
}
|
|
7580
|
+
(_this_video_play = this.video.play()) === null || _this_video_play === void 0 ? void 0 : _this_video_play.catch(function() {});
|
|
7434
7581
|
} else if (this.video.paused) {
|
|
7435
7582
|
var _this_video_play1;
|
|
7436
7583
|
(_this_video_play1 = this.video.play()) === null || _this_video_play1 === void 0 ? void 0 : _this_video_play1.catch(function() {});
|
|
@@ -7468,8 +7615,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7468
7615
|
key: "startAdRequestWatchdog",
|
|
7469
7616
|
value: function startAdRequestWatchdog(token) {
|
|
7470
7617
|
var _this = this;
|
|
7471
|
-
this.clearAdRequestWatchdog();
|
|
7472
7618
|
var _this_config_adFailsafeTimeoutMs;
|
|
7619
|
+
this.clearAdRequestWatchdog();
|
|
7473
7620
|
var timeoutMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
|
|
7474
7621
|
this.adRequestWatchdogToken = token;
|
|
7475
7622
|
this.adRequestWatchdogId = window.setTimeout(function() {
|
|
@@ -7512,8 +7659,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7512
7659
|
key: "startAdFailsafeTimer",
|
|
7513
7660
|
value: function startAdFailsafeTimer(token) {
|
|
7514
7661
|
var _this = this;
|
|
7515
|
-
this.clearAdFailsafeTimer();
|
|
7516
7662
|
var _this_config_adFailsafeTimeoutMs;
|
|
7663
|
+
this.clearAdFailsafeTimer();
|
|
7517
7664
|
var failsafeMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
|
|
7518
7665
|
this.adFailsafeToken = token;
|
|
7519
7666
|
this.adFailsafeTimerId = window.setTimeout(function() {
|
|
@@ -7894,21 +8041,21 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7894
8041
|
var _import_react_default_useState14 = _sliced_to_array(import_react.default.useState(false), 2), showLicenseWarning = _import_react_default_useState14[0], setShowLicenseWarning = _import_react_default_useState14[1];
|
|
7895
8042
|
var _import_react_default_useState15 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _import_react_default_useState15[0], setViewportWidth = _import_react_default_useState15[1];
|
|
7896
8043
|
var _import_react_default_useState16 = _sliced_to_array(import_react.default.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _import_react_default_useState16[0], setIsPortrait = _import_react_default_useState16[1];
|
|
7897
|
-
var getResponsiveScale = function() {
|
|
8044
|
+
var getResponsiveScale = function getResponsiveScale() {
|
|
7898
8045
|
if (viewportWidth < 480) return 0.7;
|
|
7899
8046
|
if (viewportWidth < 768) return 0.8;
|
|
7900
8047
|
if (viewportWidth < 1024) return 0.9;
|
|
7901
8048
|
return 1;
|
|
7902
8049
|
};
|
|
7903
8050
|
var responsiveScale = getResponsiveScale();
|
|
7904
|
-
var formatTime = function(seconds) {
|
|
8051
|
+
var formatTime = function formatTime(seconds) {
|
|
7905
8052
|
if (!isFinite(seconds)) return "0:00:00";
|
|
7906
8053
|
var hours = Math.floor(seconds / 3600);
|
|
7907
8054
|
var minutes = Math.floor(seconds % 3600 / 60);
|
|
7908
8055
|
var remainingSeconds = Math.floor(seconds % 60);
|
|
7909
8056
|
return "".concat(hours, ":").concat(minutes.toString().padStart(2, "0"), ":").concat(remainingSeconds.toString().padStart(2, "0"));
|
|
7910
8057
|
};
|
|
7911
|
-
var handlePlayPause = function() {
|
|
8058
|
+
var handlePlayPause = function handlePlayPause() {
|
|
7912
8059
|
if (videoRef.current) {
|
|
7913
8060
|
if (videoRef.current.paused) {
|
|
7914
8061
|
var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
|
|
@@ -7927,7 +8074,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7927
8074
|
}
|
|
7928
8075
|
}
|
|
7929
8076
|
};
|
|
7930
|
-
var handleCenterPlayClick = function() {
|
|
8077
|
+
var handleCenterPlayClick = function handleCenterPlayClick() {
|
|
7931
8078
|
if (videoRef.current && videoRef.current.paused) {
|
|
7932
8079
|
var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
|
|
7933
8080
|
if (hasValidSource) {
|
|
@@ -7941,7 +8088,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7941
8088
|
}
|
|
7942
8089
|
}
|
|
7943
8090
|
};
|
|
7944
|
-
var handleTimelineSeek = function(e) {
|
|
8091
|
+
var handleTimelineSeek = function handleTimelineSeek(e) {
|
|
7945
8092
|
if (videoRef.current && duration > 0 && isFinite(duration)) {
|
|
7946
8093
|
var rect = e.currentTarget.getBoundingClientRect();
|
|
7947
8094
|
var clickX = e.clientX - rect.left;
|
|
@@ -7952,13 +8099,13 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7952
8099
|
}
|
|
7953
8100
|
}
|
|
7954
8101
|
};
|
|
7955
|
-
var handleVolumeChange = function(newVolume) {
|
|
8102
|
+
var handleVolumeChange = function handleVolumeChange(newVolume) {
|
|
7956
8103
|
if (playerRef.current && isFinite(newVolume)) {
|
|
7957
8104
|
var clampedVolume = Math.max(0, Math.min(1, newVolume));
|
|
7958
8105
|
playerRef.current.setVolume(clampedVolume);
|
|
7959
8106
|
}
|
|
7960
8107
|
};
|
|
7961
|
-
var handlePlaybackRateChange = function(rate) {
|
|
8108
|
+
var handlePlaybackRateChange = function handlePlaybackRateChange(rate) {
|
|
7962
8109
|
if (videoRef.current && isFinite(rate) && rate > 0) {
|
|
7963
8110
|
videoRef.current.playbackRate = rate;
|
|
7964
8111
|
}
|
|
@@ -7996,7 +8143,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
7996
8143
|
if (playerRef.current) {
|
|
7997
8144
|
try {
|
|
7998
8145
|
playerRef.current.destroy();
|
|
7999
|
-
} catch (
|
|
8146
|
+
} catch (unused) {}
|
|
8000
8147
|
playerRef.current = null;
|
|
8001
8148
|
}
|
|
8002
8149
|
var cfg = {
|
|
@@ -8036,7 +8183,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8036
8183
|
return function() {
|
|
8037
8184
|
try {
|
|
8038
8185
|
player.destroy();
|
|
8039
|
-
} catch (
|
|
8186
|
+
} catch (unused) {}
|
|
8040
8187
|
playerRef.current = null;
|
|
8041
8188
|
};
|
|
8042
8189
|
}, [
|
|
@@ -8060,7 +8207,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8060
8207
|
]);
|
|
8061
8208
|
(0, import_react.useEffect)(function() {
|
|
8062
8209
|
if (!playerRef.current) return;
|
|
8063
|
-
var checkAdStatus = function() {
|
|
8210
|
+
var checkAdStatus = function checkAdStatus() {
|
|
8064
8211
|
if (playerRef.current) {
|
|
8065
8212
|
var _videoRef_current_dataset, _videoRef_current;
|
|
8066
8213
|
var showAdsFromMethod = playerRef.current.isShowingAds();
|
|
@@ -8090,7 +8237,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8090
8237
|
}, []);
|
|
8091
8238
|
(0, import_react.useEffect)(function() {
|
|
8092
8239
|
if (typeof window === "undefined" || !playerRef.current) return;
|
|
8093
|
-
var handleResize = function() {
|
|
8240
|
+
var handleResize = function handleResize() {
|
|
8094
8241
|
if (playerRef.current && videoRef.current) {
|
|
8095
8242
|
if (typeof playerRef.current.resize === "function") {
|
|
8096
8243
|
playerRef.current.resize();
|
|
@@ -8106,7 +8253,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8106
8253
|
}, []);
|
|
8107
8254
|
(0, import_react.useEffect)(function() {
|
|
8108
8255
|
if (!playerRef.current || !videoRef.current) return;
|
|
8109
|
-
var updateStates = function() {
|
|
8256
|
+
var updateStates = function updateStates() {
|
|
8110
8257
|
var _videoRef_current;
|
|
8111
8258
|
if (playerRef.current && videoRef.current) {
|
|
8112
8259
|
setIsMuted(playerRef.current.isMuted());
|
|
@@ -8123,7 +8270,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8123
8270
|
setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
|
|
8124
8271
|
};
|
|
8125
8272
|
var interval = setInterval(updateStates, 200);
|
|
8126
|
-
var handleFullscreenChange = function() {
|
|
8273
|
+
var handleFullscreenChange = function handleFullscreenChange() {
|
|
8127
8274
|
var _videoRef_current;
|
|
8128
8275
|
setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
|
|
8129
8276
|
};
|
|
@@ -8135,7 +8282,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8135
8282
|
}, []);
|
|
8136
8283
|
(0, import_react.useEffect)(function() {
|
|
8137
8284
|
if (!videoRef.current) return;
|
|
8138
|
-
var handleLoadedMetadata = function() {
|
|
8285
|
+
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
8139
8286
|
if (videoRef.current) {
|
|
8140
8287
|
var video2 = videoRef.current;
|
|
8141
8288
|
void video2.offsetHeight;
|
|
@@ -8145,19 +8292,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8145
8292
|
console.log("[StormcloudUI] Video event: loadedmetadata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
|
|
8146
8293
|
}
|
|
8147
8294
|
};
|
|
8148
|
-
var handleLoadedData = function() {
|
|
8295
|
+
var handleLoadedData = function handleLoadedData() {
|
|
8149
8296
|
if (debugAdTiming) {
|
|
8150
8297
|
var _videoRef_current;
|
|
8151
8298
|
console.log("[StormcloudUI] Video event: loadeddata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
|
|
8152
8299
|
}
|
|
8153
8300
|
};
|
|
8154
|
-
var handleLoadStart = function() {
|
|
8301
|
+
var handleLoadStart = function handleLoadStart() {
|
|
8155
8302
|
if (debugAdTiming) {
|
|
8156
8303
|
var _videoRef_current;
|
|
8157
8304
|
console.log("[StormcloudUI] Video event: loadstart, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
|
|
8158
8305
|
}
|
|
8159
8306
|
};
|
|
8160
|
-
var handleCanPlay = function() {
|
|
8307
|
+
var handleCanPlay = function handleCanPlay() {
|
|
8161
8308
|
setIsLoading(false);
|
|
8162
8309
|
if (bufferingTimeoutRef.current) {
|
|
8163
8310
|
clearTimeout(bufferingTimeoutRef.current);
|
|
@@ -8169,7 +8316,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8169
8316
|
console.log("[StormcloudUI] Video event: canplay, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState, "- clearing loading state, isLoading=false");
|
|
8170
8317
|
}
|
|
8171
8318
|
};
|
|
8172
|
-
var handleCanPlayThrough = function() {
|
|
8319
|
+
var handleCanPlayThrough = function handleCanPlayThrough() {
|
|
8173
8320
|
setIsLoading(false);
|
|
8174
8321
|
if (bufferingTimeoutRef.current) {
|
|
8175
8322
|
clearTimeout(bufferingTimeoutRef.current);
|
|
@@ -8181,7 +8328,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8181
8328
|
console.log("[StormcloudUI] Video event: canplaythrough, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState, "- clearing loading state, isLoading=false");
|
|
8182
8329
|
}
|
|
8183
8330
|
};
|
|
8184
|
-
var handleWaiting = function() {
|
|
8331
|
+
var handleWaiting = function handleWaiting() {
|
|
8185
8332
|
if (bufferingTimeoutRef.current) {
|
|
8186
8333
|
clearTimeout(bufferingTimeoutRef.current);
|
|
8187
8334
|
}
|
|
@@ -8197,7 +8344,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8197
8344
|
console.log("[StormcloudUI] Video event: waiting, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState, "- buffering delay started (300ms)");
|
|
8198
8345
|
}
|
|
8199
8346
|
};
|
|
8200
|
-
var handlePlaying = function() {
|
|
8347
|
+
var handlePlaying = function handlePlaying() {
|
|
8201
8348
|
setIsLoading(false);
|
|
8202
8349
|
if (bufferingTimeoutRef.current) {
|
|
8203
8350
|
clearTimeout(bufferingTimeoutRef.current);
|
|
@@ -8210,7 +8357,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8210
8357
|
console.log("[StormcloudUI] Video event: playing, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState, "- playback started, isLoading=false, isBuffering=false");
|
|
8211
8358
|
}
|
|
8212
8359
|
};
|
|
8213
|
-
var handlePause = function() {
|
|
8360
|
+
var handlePause = function handlePause() {
|
|
8214
8361
|
var _playerRef_current, _videoRef_current_dataset, _videoRef_current;
|
|
8215
8362
|
var isAdActive = ((_playerRef_current = playerRef.current) === null || _playerRef_current === void 0 ? void 0 : _playerRef_current.isShowingAds()) || ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : (_videoRef_current_dataset = _videoRef_current.dataset) === null || _videoRef_current_dataset === void 0 ? void 0 : _videoRef_current_dataset.stormcloudAdPlaying) === "true";
|
|
8216
8363
|
if (playerRef.current && !isAdActive) {
|
|
@@ -8219,7 +8366,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8219
8366
|
setShowCenterPlay(false);
|
|
8220
8367
|
}
|
|
8221
8368
|
};
|
|
8222
|
-
var handleEnded = function() {
|
|
8369
|
+
var handleEnded = function handleEnded() {
|
|
8223
8370
|
setShowCenterPlay(true);
|
|
8224
8371
|
};
|
|
8225
8372
|
var video = videoRef.current;
|
|
@@ -8377,14 +8524,14 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8377
8524
|
boxShadow: "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)",
|
|
8378
8525
|
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
8379
8526
|
},
|
|
8380
|
-
onMouseEnter: function(e) {
|
|
8527
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8381
8528
|
var target = e.currentTarget;
|
|
8382
8529
|
target.style.transform = "translate(-50%, -50%)";
|
|
8383
8530
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(40, 40, 40, 0.9) 100%)";
|
|
8384
8531
|
target.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
|
|
8385
8532
|
target.style.borderColor = "rgba(255, 255, 255, 0.9)";
|
|
8386
8533
|
},
|
|
8387
|
-
onMouseLeave: function(e) {
|
|
8534
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8388
8535
|
var target = e.currentTarget;
|
|
8389
8536
|
target.style.transform = "translate(-50%, -50%)";
|
|
8390
8537
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)";
|
|
@@ -8491,12 +8638,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8491
8638
|
minWidth: "".concat(48 * responsiveScale, "px"),
|
|
8492
8639
|
minHeight: "".concat(48 * responsiveScale, "px")
|
|
8493
8640
|
},
|
|
8494
|
-
onMouseEnter: function(e) {
|
|
8641
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8495
8642
|
var target = e.target;
|
|
8496
8643
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
|
|
8497
8644
|
target.style.boxShadow = "0 12px 48px rgba(0, 0, 0, 0.6), 0 6px 24px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
|
|
8498
8645
|
},
|
|
8499
|
-
onMouseLeave: function(e) {
|
|
8646
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8500
8647
|
var target = e.target;
|
|
8501
8648
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
|
|
8502
8649
|
target.style.boxShadow = "0 8px 32px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3)";
|
|
@@ -8522,15 +8669,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8522
8669
|
padding: "8px",
|
|
8523
8670
|
margin: "-8px"
|
|
8524
8671
|
},
|
|
8525
|
-
onMouseEnter: function() {
|
|
8672
|
+
onMouseEnter: function onMouseEnter() {
|
|
8526
8673
|
return setShowVolumeSlider(true);
|
|
8527
8674
|
},
|
|
8528
|
-
onMouseLeave: function() {
|
|
8675
|
+
onMouseLeave: function onMouseLeave() {
|
|
8529
8676
|
return setShowVolumeSlider(false);
|
|
8530
8677
|
},
|
|
8531
8678
|
children: [
|
|
8532
8679
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
8533
|
-
onClick: function() {
|
|
8680
|
+
onClick: function onClick() {
|
|
8534
8681
|
if (playerRef.current) {
|
|
8535
8682
|
playerRef.current.toggleMute();
|
|
8536
8683
|
}
|
|
@@ -8554,12 +8701,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8554
8701
|
minWidth: "".concat(44 * responsiveScale, "px"),
|
|
8555
8702
|
minHeight: "".concat(44 * responsiveScale, "px")
|
|
8556
8703
|
},
|
|
8557
|
-
onMouseEnter: function(e) {
|
|
8704
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8558
8705
|
var target = e.target;
|
|
8559
8706
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
|
|
8560
8707
|
target.style.boxShadow = "0 10px 36px rgba(0, 0, 0, 0.6), 0 5px 16px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35)";
|
|
8561
8708
|
},
|
|
8562
|
-
onMouseLeave: function(e) {
|
|
8709
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8563
8710
|
var target = e.target;
|
|
8564
8711
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
|
|
8565
8712
|
target.style.boxShadow = "0 6px 28px rgba(0, 0, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25)";
|
|
@@ -8595,10 +8742,10 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8595
8742
|
marginBottom: "-16px",
|
|
8596
8743
|
zIndex: 9
|
|
8597
8744
|
},
|
|
8598
|
-
onMouseEnter: function() {
|
|
8745
|
+
onMouseEnter: function onMouseEnter() {
|
|
8599
8746
|
return setShowVolumeSlider(true);
|
|
8600
8747
|
},
|
|
8601
|
-
onMouseLeave: function() {
|
|
8748
|
+
onMouseLeave: function onMouseLeave() {
|
|
8602
8749
|
return setShowVolumeSlider(false);
|
|
8603
8750
|
}
|
|
8604
8751
|
}),
|
|
@@ -8623,12 +8770,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8623
8770
|
zIndex: 10,
|
|
8624
8771
|
transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
|
|
8625
8772
|
},
|
|
8626
|
-
onMouseEnter: function(e) {
|
|
8773
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8627
8774
|
setShowVolumeSlider(true);
|
|
8628
8775
|
e.currentTarget.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.6), 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 24px rgba(59, 130, 246, 0.3)";
|
|
8629
8776
|
e.currentTarget.style.borderColor = "rgba(59, 130, 246, 0.4)";
|
|
8630
8777
|
},
|
|
8631
|
-
onMouseLeave: function(e) {
|
|
8778
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8632
8779
|
setShowVolumeSlider(false);
|
|
8633
8780
|
e.currentTarget.style.boxShadow = "0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15)";
|
|
8634
8781
|
e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.15)";
|
|
@@ -8641,19 +8788,19 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8641
8788
|
cursor: "pointer",
|
|
8642
8789
|
transition: "transform 0.2s ease-in-out"
|
|
8643
8790
|
},
|
|
8644
|
-
onMouseEnter: function(e) {},
|
|
8645
|
-
onMouseLeave: function(e) {},
|
|
8646
|
-
onMouseDown: function(e) {
|
|
8791
|
+
onMouseEnter: function onMouseEnter(e) {},
|
|
8792
|
+
onMouseLeave: function onMouseLeave(e) {},
|
|
8793
|
+
onMouseDown: function onMouseDown(e) {
|
|
8647
8794
|
e.preventDefault();
|
|
8648
8795
|
var sliderElement = e.currentTarget;
|
|
8649
|
-
var handleMouseMove = function(moveEvent) {
|
|
8796
|
+
var handleMouseMove = function handleMouseMove(moveEvent) {
|
|
8650
8797
|
if (!sliderElement) return;
|
|
8651
8798
|
var rect2 = sliderElement.getBoundingClientRect();
|
|
8652
8799
|
var y2 = moveEvent.clientY - rect2.top;
|
|
8653
8800
|
var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
|
|
8654
8801
|
handleVolumeChange(percentage2);
|
|
8655
8802
|
};
|
|
8656
|
-
var handleMouseUp = function() {
|
|
8803
|
+
var handleMouseUp = function handleMouseUp1() {
|
|
8657
8804
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
8658
8805
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
8659
8806
|
};
|
|
@@ -8664,7 +8811,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8664
8811
|
var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
|
|
8665
8812
|
handleVolumeChange(percentage);
|
|
8666
8813
|
},
|
|
8667
|
-
onClick: function(e) {
|
|
8814
|
+
onClick: function onClick(e) {
|
|
8668
8815
|
e.stopPropagation();
|
|
8669
8816
|
var rect = e.currentTarget.getBoundingClientRect();
|
|
8670
8817
|
var y = e.clientY - rect.top;
|
|
@@ -8711,17 +8858,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8711
8858
|
transition: "bottom 0.15s ease-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, width 0.2s ease-in-out, height 0.2s ease-in-out",
|
|
8712
8859
|
cursor: "grab"
|
|
8713
8860
|
},
|
|
8714
|
-
onMouseEnter: function(e) {
|
|
8861
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8715
8862
|
e.currentTarget.style.boxShadow = "0 3px 10px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.6)";
|
|
8716
8863
|
e.currentTarget.style.cursor = "grab";
|
|
8717
8864
|
},
|
|
8718
|
-
onMouseLeave: function(e) {
|
|
8865
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8719
8866
|
e.currentTarget.style.boxShadow = "0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(59, 130, 246, 0.3), 0 0 12px rgba(59, 130, 246, 0.4)";
|
|
8720
8867
|
},
|
|
8721
|
-
onMouseDown: function(e) {
|
|
8868
|
+
onMouseDown: function onMouseDown(e) {
|
|
8722
8869
|
e.currentTarget.style.cursor = "grabbing";
|
|
8723
8870
|
},
|
|
8724
|
-
onMouseUp: function(e) {
|
|
8871
|
+
onMouseUp: function onMouseUp(e) {
|
|
8725
8872
|
e.currentTarget.style.cursor = "grab";
|
|
8726
8873
|
}
|
|
8727
8874
|
})
|
|
@@ -8761,7 +8908,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8761
8908
|
},
|
|
8762
8909
|
children: [
|
|
8763
8910
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
8764
|
-
onClick: function() {
|
|
8911
|
+
onClick: function onClick() {
|
|
8765
8912
|
return setShowSpeedMenu(!showSpeedMenu);
|
|
8766
8913
|
},
|
|
8767
8914
|
style: {
|
|
@@ -8780,12 +8927,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8780
8927
|
minWidth: "".concat(56 * responsiveScale, "px"),
|
|
8781
8928
|
minHeight: "".concat(40 * responsiveScale, "px")
|
|
8782
8929
|
},
|
|
8783
|
-
onMouseEnter: function(e) {
|
|
8930
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8784
8931
|
var target = e.target;
|
|
8785
8932
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
|
|
8786
8933
|
target.style.boxShadow = "0 10px 32px rgba(0, 0, 0, 0.6), 0 5px 16px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35)";
|
|
8787
8934
|
},
|
|
8788
|
-
onMouseLeave: function(e) {
|
|
8935
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8789
8936
|
var target = e.target;
|
|
8790
8937
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
|
|
8791
8938
|
target.style.boxShadow = "0 6px 24px rgba(0, 0, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25)";
|
|
@@ -8821,7 +8968,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8821
8968
|
2
|
|
8822
8969
|
].map(function(speed) {
|
|
8823
8970
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
8824
|
-
onClick: function() {
|
|
8971
|
+
onClick: function onClick() {
|
|
8825
8972
|
return handlePlaybackRateChange(speed);
|
|
8826
8973
|
},
|
|
8827
8974
|
style: {
|
|
@@ -8839,12 +8986,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8839
8986
|
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
8840
8987
|
borderBottom: speed !== 2 ? "1px solid rgba(255, 255, 255, 0.05)" : "none"
|
|
8841
8988
|
},
|
|
8842
|
-
onMouseEnter: function(e) {
|
|
8989
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8843
8990
|
if (playbackRate !== speed) {
|
|
8844
8991
|
e.target.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%)";
|
|
8845
8992
|
}
|
|
8846
8993
|
},
|
|
8847
|
-
onMouseLeave: function(e) {
|
|
8994
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8848
8995
|
if (playbackRate !== speed) {
|
|
8849
8996
|
e.target.style.background = "transparent";
|
|
8850
8997
|
}
|
|
@@ -8859,7 +9006,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8859
9006
|
]
|
|
8860
9007
|
}),
|
|
8861
9008
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
8862
|
-
onClick: function() {
|
|
9009
|
+
onClick: function onClick() {
|
|
8863
9010
|
if (onFullscreenToggle) {
|
|
8864
9011
|
onFullscreenToggle();
|
|
8865
9012
|
} else if (playerRef.current) {
|
|
@@ -8884,12 +9031,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8884
9031
|
minWidth: "".concat(44 * responsiveScale, "px"),
|
|
8885
9032
|
minHeight: "".concat(44 * responsiveScale, "px")
|
|
8886
9033
|
},
|
|
8887
|
-
onMouseEnter: function(e) {
|
|
9034
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8888
9035
|
var target = e.target;
|
|
8889
9036
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
|
|
8890
9037
|
target.style.boxShadow = "0 10px 36px rgba(0, 0, 0, 0.6), 0 5px 16px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.35)";
|
|
8891
9038
|
},
|
|
8892
|
-
onMouseLeave: function(e) {
|
|
9039
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8893
9040
|
var target = e.target;
|
|
8894
9041
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
|
|
8895
9042
|
target.style.boxShadow = "0 6px 28px rgba(0, 0, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25)";
|
|
@@ -8933,15 +9080,15 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8933
9080
|
padding: "8px",
|
|
8934
9081
|
margin: "-8px"
|
|
8935
9082
|
},
|
|
8936
|
-
onMouseEnter: function() {
|
|
9083
|
+
onMouseEnter: function onMouseEnter() {
|
|
8937
9084
|
return setShowVolumeSlider(true);
|
|
8938
9085
|
},
|
|
8939
|
-
onMouseLeave: function() {
|
|
9086
|
+
onMouseLeave: function onMouseLeave() {
|
|
8940
9087
|
return setShowVolumeSlider(false);
|
|
8941
9088
|
},
|
|
8942
9089
|
children: [
|
|
8943
9090
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
8944
|
-
onClick: function() {
|
|
9091
|
+
onClick: function onClick() {
|
|
8945
9092
|
if (playerRef.current) {
|
|
8946
9093
|
playerRef.current.toggleMute();
|
|
8947
9094
|
}
|
|
@@ -8949,12 +9096,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8949
9096
|
onVolumeToggle();
|
|
8950
9097
|
}
|
|
8951
9098
|
},
|
|
8952
|
-
onMouseEnter: function(e) {
|
|
9099
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8953
9100
|
var target = e.currentTarget;
|
|
8954
9101
|
target.style.boxShadow = "0 14px 48px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(255, 255, 255, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
|
|
8955
9102
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
|
|
8956
9103
|
},
|
|
8957
|
-
onMouseLeave: function(e) {
|
|
9104
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8958
9105
|
var target = e.currentTarget;
|
|
8959
9106
|
target.style.boxShadow = "0 10px 36px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3)";
|
|
8960
9107
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
|
|
@@ -9009,10 +9156,10 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9009
9156
|
marginBottom: "-16px",
|
|
9010
9157
|
zIndex: 9
|
|
9011
9158
|
},
|
|
9012
|
-
onMouseEnter: function() {
|
|
9159
|
+
onMouseEnter: function onMouseEnter() {
|
|
9013
9160
|
return setShowVolumeSlider(true);
|
|
9014
9161
|
},
|
|
9015
|
-
onMouseLeave: function() {
|
|
9162
|
+
onMouseLeave: function onMouseLeave() {
|
|
9016
9163
|
return setShowVolumeSlider(false);
|
|
9017
9164
|
}
|
|
9018
9165
|
}),
|
|
@@ -9037,12 +9184,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9037
9184
|
zIndex: 10,
|
|
9038
9185
|
transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
|
|
9039
9186
|
},
|
|
9040
|
-
onMouseEnter: function(e) {
|
|
9187
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
9041
9188
|
setShowVolumeSlider(true);
|
|
9042
9189
|
e.currentTarget.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), 0 6px 16px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 24px rgba(96, 165, 250, 0.4)";
|
|
9043
9190
|
e.currentTarget.style.borderColor = "rgba(96, 165, 250, 0.8)";
|
|
9044
9191
|
},
|
|
9045
|
-
onMouseLeave: function(e) {
|
|
9192
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
9046
9193
|
setShowVolumeSlider(false);
|
|
9047
9194
|
e.currentTarget.style.boxShadow = "0 12px 40px rgba(0, 0, 0, 0.85), 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35)";
|
|
9048
9195
|
e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.7)";
|
|
@@ -9055,17 +9202,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9055
9202
|
cursor: "pointer",
|
|
9056
9203
|
transition: "transform 0.2s ease-in-out"
|
|
9057
9204
|
},
|
|
9058
|
-
onMouseDown: function(e) {
|
|
9205
|
+
onMouseDown: function onMouseDown(e) {
|
|
9059
9206
|
e.preventDefault();
|
|
9060
9207
|
var sliderElement = e.currentTarget;
|
|
9061
|
-
var handleMouseMove = function(moveEvent) {
|
|
9208
|
+
var handleMouseMove = function handleMouseMove(moveEvent) {
|
|
9062
9209
|
if (!sliderElement) return;
|
|
9063
9210
|
var rect2 = sliderElement.getBoundingClientRect();
|
|
9064
9211
|
var y2 = moveEvent.clientY - rect2.top;
|
|
9065
9212
|
var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
|
|
9066
9213
|
handleVolumeChange(percentage2);
|
|
9067
9214
|
};
|
|
9068
|
-
var handleMouseUp = function() {
|
|
9215
|
+
var handleMouseUp = function handleMouseUp1() {
|
|
9069
9216
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
9070
9217
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
9071
9218
|
};
|
|
@@ -9076,7 +9223,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9076
9223
|
var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
|
|
9077
9224
|
handleVolumeChange(percentage);
|
|
9078
9225
|
},
|
|
9079
|
-
onClick: function(e) {
|
|
9226
|
+
onClick: function onClick(e) {
|
|
9080
9227
|
e.stopPropagation();
|
|
9081
9228
|
var rect = e.currentTarget.getBoundingClientRect();
|
|
9082
9229
|
var y = e.clientY - rect.top;
|
|
@@ -9125,17 +9272,17 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9125
9272
|
transition: "bottom 0.15s ease-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, width 0.2s ease-in-out, height 0.2s ease-in-out",
|
|
9126
9273
|
cursor: "grab"
|
|
9127
9274
|
},
|
|
9128
|
-
onMouseEnter: function(e) {
|
|
9275
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
9129
9276
|
e.currentTarget.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(96, 165, 250, 0.6), 0 0 24px rgba(96, 165, 250, 0.7)";
|
|
9130
9277
|
e.currentTarget.style.cursor = "grab";
|
|
9131
9278
|
},
|
|
9132
|
-
onMouseLeave: function(e) {
|
|
9279
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
9133
9280
|
e.currentTarget.style.boxShadow = "0 3px 8px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(96, 165, 250, 0.4), 0 0 16px rgba(96, 165, 250, 0.5)";
|
|
9134
9281
|
},
|
|
9135
|
-
onMouseDown: function(e) {
|
|
9282
|
+
onMouseDown: function onMouseDown(e) {
|
|
9136
9283
|
e.currentTarget.style.cursor = "grabbing";
|
|
9137
9284
|
},
|
|
9138
|
-
onMouseUp: function(e) {
|
|
9285
|
+
onMouseUp: function onMouseUp(e) {
|
|
9139
9286
|
e.currentTarget.style.cursor = "grab";
|
|
9140
9287
|
}
|
|
9141
9288
|
})
|
|
@@ -9147,7 +9294,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9147
9294
|
]
|
|
9148
9295
|
}),
|
|
9149
9296
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
9150
|
-
onClick: function() {
|
|
9297
|
+
onClick: function onClick() {
|
|
9151
9298
|
if (onFullscreenToggle) {
|
|
9152
9299
|
onFullscreenToggle();
|
|
9153
9300
|
} else if (playerRef.current) {
|
|
@@ -9156,12 +9303,12 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9156
9303
|
});
|
|
9157
9304
|
}
|
|
9158
9305
|
},
|
|
9159
|
-
onMouseEnter: function(e) {
|
|
9306
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
9160
9307
|
var target = e.currentTarget;
|
|
9161
9308
|
target.style.boxShadow = "0 14px 48px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(255, 255, 255, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
|
|
9162
9309
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
|
|
9163
9310
|
},
|
|
9164
|
-
onMouseLeave: function(e) {
|
|
9311
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
9165
9312
|
var target = e.currentTarget;
|
|
9166
9313
|
target.style.boxShadow = "0 10px 36px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3)";
|
|
9167
9314
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
|