stormcloud-video-player 0.5.3 → 0.5.4
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 +348 -330
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +348 -220
- package/lib/index.d.ts +348 -220
- package/lib/index.js +307 -289
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +77 -68
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/FilePlayer.cjs +99 -116
- package/lib/players/FilePlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +129 -120
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +208 -199
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +17 -9
- 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 +20 -10
- 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 +168 -150
- 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
package/lib/index.js
CHANGED
|
@@ -180,12 +180,22 @@ function _object_spread_props(target, source) {
|
|
|
180
180
|
}
|
|
181
181
|
function _object_without_properties(source, excluded) {
|
|
182
182
|
if (source == null) return {};
|
|
183
|
-
var target =
|
|
184
|
-
|
|
183
|
+
var target = {}, sourceKeys, key, i;
|
|
184
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
185
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
186
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
187
|
+
key = sourceKeys[i];
|
|
188
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
189
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
190
|
+
target[key] = source[key];
|
|
191
|
+
}
|
|
192
|
+
return target;
|
|
193
|
+
}
|
|
194
|
+
target = _object_without_properties_loose(source, excluded);
|
|
185
195
|
if (Object.getOwnPropertySymbols) {
|
|
186
|
-
|
|
187
|
-
for(i = 0; i <
|
|
188
|
-
key =
|
|
196
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
197
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
198
|
+
key = sourceKeys[i];
|
|
189
199
|
if (excluded.indexOf(key) >= 0) continue;
|
|
190
200
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
191
201
|
target[key] = source[key];
|
|
@@ -195,12 +205,11 @@ function _object_without_properties(source, excluded) {
|
|
|
195
205
|
}
|
|
196
206
|
function _object_without_properties_loose(source, excluded) {
|
|
197
207
|
if (source == null) return {};
|
|
198
|
-
var target = {};
|
|
199
|
-
var sourceKeys = Object.keys(source);
|
|
200
|
-
var key, i;
|
|
208
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
201
209
|
for(i = 0; i < sourceKeys.length; i++){
|
|
202
210
|
key = sourceKeys[i];
|
|
203
211
|
if (excluded.indexOf(key) >= 0) continue;
|
|
212
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
204
213
|
target[key] = source[key];
|
|
205
214
|
}
|
|
206
215
|
return target;
|
|
@@ -253,9 +262,17 @@ function _ts_generator(thisArg, body) {
|
|
|
253
262
|
},
|
|
254
263
|
trys: [],
|
|
255
264
|
ops: []
|
|
256
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
257
|
-
return
|
|
258
|
-
|
|
265
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
266
|
+
return d(g, "next", {
|
|
267
|
+
value: verb(0)
|
|
268
|
+
}), d(g, "throw", {
|
|
269
|
+
value: verb(1)
|
|
270
|
+
}), d(g, "return", {
|
|
271
|
+
value: verb(2)
|
|
272
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
273
|
+
value: function() {
|
|
274
|
+
return this;
|
|
275
|
+
}
|
|
259
276
|
}), g;
|
|
260
277
|
function verb(n) {
|
|
261
278
|
return function(v) {
|
|
@@ -709,7 +726,7 @@ function createImaController(video, options) {
|
|
|
709
726
|
var fn = _step.value;
|
|
710
727
|
try {
|
|
711
728
|
fn(payload);
|
|
712
|
-
} catch (
|
|
729
|
+
} catch (unused) {}
|
|
713
730
|
}
|
|
714
731
|
} catch (err) {
|
|
715
732
|
_didIteratorError = true;
|
|
@@ -747,7 +764,7 @@ function createImaController(video, options) {
|
|
|
747
764
|
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'.");
|
|
748
765
|
}
|
|
749
766
|
}
|
|
750
|
-
} catch (
|
|
767
|
+
} catch (unused) {}
|
|
751
768
|
if (typeof window !== "undefined" && ((_window_google = window.google) === null || _window_google === void 0 ? void 0 : _window_google.ima)) return Promise.resolve();
|
|
752
769
|
var existing = document.querySelector('script[data-ima="true"]');
|
|
753
770
|
if (existing) {
|
|
@@ -995,7 +1012,7 @@ function createImaController(video, options) {
|
|
|
995
1012
|
if (adsManager) {
|
|
996
1013
|
try {
|
|
997
1014
|
adsManager.destroy();
|
|
998
|
-
} catch (
|
|
1015
|
+
} catch (unused) {}
|
|
999
1016
|
adsManager = void 0;
|
|
1000
1017
|
}
|
|
1001
1018
|
if (adVideoElement) {
|
|
@@ -1006,7 +1023,7 @@ function createImaController(video, options) {
|
|
|
1006
1023
|
if (adsLoader) {
|
|
1007
1024
|
try {
|
|
1008
1025
|
adsLoader.destroy();
|
|
1009
|
-
} catch (
|
|
1026
|
+
} catch (unused) {}
|
|
1010
1027
|
adsLoader = void 0;
|
|
1011
1028
|
}
|
|
1012
1029
|
}
|
|
@@ -1024,7 +1041,7 @@ function createImaController(video, options) {
|
|
|
1024
1041
|
try {
|
|
1025
1042
|
var _adDisplayContainer_initialize;
|
|
1026
1043
|
(_adDisplayContainer_initialize = adDisplayContainer.initialize) === null || _adDisplayContainer_initialize === void 0 ? void 0 : _adDisplayContainer_initialize.call(adDisplayContainer);
|
|
1027
|
-
} catch (
|
|
1044
|
+
} catch (unused) {}
|
|
1028
1045
|
}
|
|
1029
1046
|
}).catch(function() {});
|
|
1030
1047
|
},
|
|
@@ -1183,7 +1200,7 @@ function createImaController(video, options) {
|
|
|
1183
1200
|
window.setTimeout(function() {
|
|
1184
1201
|
try {
|
|
1185
1202
|
makeAdsRequest(google, lastAdTagUrl);
|
|
1186
|
-
} catch (
|
|
1203
|
+
} catch (unused) {}
|
|
1187
1204
|
}, delay);
|
|
1188
1205
|
} else {
|
|
1189
1206
|
emit("ad_error", {
|
|
@@ -1215,7 +1232,7 @@ function createImaController(video, options) {
|
|
|
1215
1232
|
if (adsManager) {
|
|
1216
1233
|
try {
|
|
1217
1234
|
adsManager.setVolume(adVolume);
|
|
1218
|
-
} catch (
|
|
1235
|
+
} catch (unused) {}
|
|
1219
1236
|
}
|
|
1220
1237
|
emit("content_pause");
|
|
1221
1238
|
});
|
|
@@ -1229,7 +1246,7 @@ function createImaController(video, options) {
|
|
|
1229
1246
|
if (adsManager) {
|
|
1230
1247
|
try {
|
|
1231
1248
|
adsManager.setVolume(originalMutedState ? 0 : adVolume);
|
|
1232
|
-
} catch (
|
|
1249
|
+
} catch (unused) {}
|
|
1233
1250
|
}
|
|
1234
1251
|
}
|
|
1235
1252
|
if (adContainerEl) {
|
|
@@ -1390,7 +1407,7 @@ function createImaController(video, options) {
|
|
|
1390
1407
|
}
|
|
1391
1408
|
try {
|
|
1392
1409
|
adsManager.setVolume(originalMutedState ? 0 : adVolume);
|
|
1393
|
-
} catch (
|
|
1410
|
+
} catch (unused) {}
|
|
1394
1411
|
adsManager.start();
|
|
1395
1412
|
return [
|
|
1396
1413
|
2,
|
|
@@ -1472,7 +1489,7 @@ function createImaController(video, options) {
|
|
|
1472
1489
|
try {
|
|
1473
1490
|
;
|
|
1474
1491
|
adsManager === null || adsManager === void 0 ? void 0 : (_adsManager_stop = adsManager.stop) === null || _adsManager_stop === void 0 ? void 0 : _adsManager_stop.call(adsManager);
|
|
1475
|
-
} catch (
|
|
1492
|
+
} catch (unused) {}
|
|
1476
1493
|
destroyAdsManager();
|
|
1477
1494
|
return [
|
|
1478
1495
|
2
|
|
@@ -1503,7 +1520,7 @@ function createImaController(video, options) {
|
|
|
1503
1520
|
try {
|
|
1504
1521
|
var _adsLoader_destroy;
|
|
1505
1522
|
adsLoader === null || adsLoader === void 0 ? void 0 : (_adsLoader_destroy = adsLoader.destroy) === null || _adsLoader_destroy === void 0 ? void 0 : _adsLoader_destroy.call(adsLoader);
|
|
1506
|
-
} catch (
|
|
1523
|
+
} catch (unused) {}
|
|
1507
1524
|
adDisplayContainer = void 0;
|
|
1508
1525
|
adsLoader = void 0;
|
|
1509
1526
|
contentVideoHidden = false;
|
|
@@ -1552,7 +1569,7 @@ function createImaController(video, options) {
|
|
|
1552
1569
|
if (adsManager && adPlaying) {
|
|
1553
1570
|
try {
|
|
1554
1571
|
adsManager.setVolume(clampedVolume);
|
|
1555
|
-
} catch (
|
|
1572
|
+
} catch (unused) {}
|
|
1556
1573
|
}
|
|
1557
1574
|
},
|
|
1558
1575
|
getAdVolume: function getAdVolume() {
|
|
@@ -2468,8 +2485,8 @@ var DEFAULT_TIMEOUT_MS = 3e3;
|
|
|
2468
2485
|
var AUCTION_URL = "https://sspproxy.adstorm.co/openrtb2/auction/adstorm";
|
|
2469
2486
|
function createPrebidManager() {
|
|
2470
2487
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2471
|
-
var initialized = false;
|
|
2472
2488
|
var _options_debug;
|
|
2489
|
+
var initialized = false;
|
|
2473
2490
|
var debug = (_options_debug = options.debug) !== null && _options_debug !== void 0 ? _options_debug : false;
|
|
2474
2491
|
function log() {
|
|
2475
2492
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
@@ -2971,6 +2988,8 @@ function createPrebidController(contentVideo, options) {
|
|
|
2971
2988
|
adContainerEl.style.display = "none";
|
|
2972
2989
|
adContainerEl.style.pointerEvents = "none";
|
|
2973
2990
|
}
|
|
2991
|
+
contentVideo.style.visibility = "visible";
|
|
2992
|
+
contentVideo.style.opacity = "1";
|
|
2974
2993
|
if (options === null || options === void 0 ? void 0 : options.continueLiveStreamDuringAds) {
|
|
2975
2994
|
if (contentVideo.paused) {
|
|
2976
2995
|
console.log("".concat(LOG, " Content video paused in live mode, resuming playback"));
|
|
@@ -4282,7 +4301,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4282
4301
|
});
|
|
4283
4302
|
this.hls.on(Hls3.Events.MANIFEST_PARSED, function(_, data) {
|
|
4284
4303
|
return _async_to_generator(function() {
|
|
4285
|
-
var
|
|
4304
|
+
var _this_config_minSegmentsBeforePlay, _ref, _this_hls_levels, _this_hls, adBehavior, minSegments, _this_video_play;
|
|
4286
4305
|
return _ts_generator(this, function(_state) {
|
|
4287
4306
|
switch(_state.label){
|
|
4288
4307
|
case 0:
|
|
@@ -4291,10 +4310,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4291
4310
|
} else {
|
|
4292
4311
|
;
|
|
4293
4312
|
;
|
|
4294
|
-
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) {
|
|
4295
4314
|
var _level_details, _level_details1;
|
|
4296
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";
|
|
4297
|
-
})) !== null &&
|
|
4316
|
+
})) !== null && _ref !== void 0 ? _ref : false;
|
|
4298
4317
|
}
|
|
4299
4318
|
if (this.config.debugAdTiming) {
|
|
4300
4319
|
adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
|
|
@@ -4358,9 +4377,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4358
4377
|
var tag = "";
|
|
4359
4378
|
var value = "";
|
|
4360
4379
|
if (Array.isArray(entry)) {
|
|
4361
|
-
var _entry_;
|
|
4380
|
+
var _entry_, _entry_1;
|
|
4362
4381
|
tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
|
|
4363
|
-
var _entry_1;
|
|
4364
4382
|
value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
|
|
4365
4383
|
} else if (typeof entry === "string") {
|
|
4366
4384
|
var idx = entry.indexOf(":");
|
|
@@ -4483,9 +4501,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4483
4501
|
var tag = "";
|
|
4484
4502
|
var value = "";
|
|
4485
4503
|
if (Array.isArray(entry)) {
|
|
4486
|
-
var _entry_;
|
|
4504
|
+
var _entry_, _entry_1;
|
|
4487
4505
|
tag = String((_entry_ = entry[0]) !== null && _entry_ !== void 0 ? _entry_ : "");
|
|
4488
|
-
var _entry_1;
|
|
4489
4506
|
value = String((_entry_1 = entry[1]) !== null && _entry_1 !== void 0 ? _entry_1 : "");
|
|
4490
4507
|
} else if (typeof entry === "string") {
|
|
4491
4508
|
var idx = entry.indexOf(":");
|
|
@@ -4535,10 +4552,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4535
4552
|
}
|
|
4536
4553
|
});
|
|
4537
4554
|
} else if (tag.includes("EXT-X-DATERANGE")) {
|
|
4555
|
+
var _attrs_CLASS;
|
|
4538
4556
|
var attrs = _this.parseAttributeList(value);
|
|
4539
4557
|
var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
|
|
4540
4558
|
var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
|
|
4541
|
-
var _attrs_CLASS;
|
|
4542
4559
|
var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
|
|
4543
4560
|
var duration = _this.toNumber(attrs["DURATION"]);
|
|
4544
4561
|
if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
|
|
@@ -4940,11 +4957,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4940
4957
|
}
|
|
4941
4958
|
var daterangeMatch = text.match(/EXT-X-DATERANGE:([^\r\n]*)/i);
|
|
4942
4959
|
if (daterangeMatch) {
|
|
4943
|
-
var _daterangeMatch_;
|
|
4960
|
+
var _daterangeMatch_, _attrs_CLASS;
|
|
4944
4961
|
var attrs = this.parseAttributeList((_daterangeMatch_ = daterangeMatch[1]) !== null && _daterangeMatch_ !== void 0 ? _daterangeMatch_ : "");
|
|
4945
4962
|
var hasScteOut = "SCTE35-OUT" in attrs || attrs["SCTE35-OUT"] !== void 0;
|
|
4946
4963
|
var hasScteIn = "SCTE35-IN" in attrs || attrs["SCTE35-IN"] !== void 0;
|
|
4947
|
-
var _attrs_CLASS;
|
|
4948
4964
|
var klass = String((_attrs_CLASS = attrs["CLASS"]) !== null && _attrs_CLASS !== void 0 ? _attrs_CLASS : "");
|
|
4949
4965
|
var duration = this.toNumber(attrs["DURATION"]);
|
|
4950
4966
|
if (hasScteOut || /com\.apple\.hls\.cue/i.test(klass)) {
|
|
@@ -5020,7 +5036,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5020
5036
|
var out = "";
|
|
5021
5037
|
for(var i = 0; i < value.length; i++)out += String.fromCharCode(value[i]);
|
|
5022
5038
|
return out;
|
|
5023
|
-
} catch (
|
|
5039
|
+
} catch (unused) {
|
|
5024
5040
|
return void 0;
|
|
5025
5041
|
}
|
|
5026
5042
|
}
|
|
@@ -5039,6 +5055,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5039
5055
|
});
|
|
5040
5056
|
}
|
|
5041
5057
|
if (marker.type === "start") {
|
|
5058
|
+
var _this_config_immediateManifestAds;
|
|
5042
5059
|
var _this_pendingAdBreak;
|
|
5043
5060
|
if (!this.video.muted) {
|
|
5044
5061
|
this.video.muted = true;
|
|
@@ -5063,7 +5080,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5063
5080
|
this.expectedAdBreakDurationMs = durationMs;
|
|
5064
5081
|
this.currentAdBreakStartWallClockMs = Date.now();
|
|
5065
5082
|
var isManifestMarker = this.isManifestBasedMarker(marker);
|
|
5066
|
-
var _this_config_immediateManifestAds;
|
|
5067
5083
|
var forceImmediate = (_this_config_immediateManifestAds = this.config.immediateManifestAds) !== null && _this_config_immediateManifestAds !== void 0 ? _this_config_immediateManifestAds : true;
|
|
5068
5084
|
if (this.config.debugAdTiming) {
|
|
5069
5085
|
console.log("[StormcloudVideoPlayer] Ad start decision:", {
|
|
@@ -5218,9 +5234,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5218
5234
|
var regex = /([A-Z0-9-]+)=(("[^"]*")|([^",]*))(?:,|$)/gi;
|
|
5219
5235
|
var match;
|
|
5220
5236
|
while((match = regex.exec(value)) !== null){
|
|
5221
|
-
var _match_;
|
|
5237
|
+
var _match_, _ref, _match_1;
|
|
5222
5238
|
var key = (_match_ = match[1]) !== null && _match_ !== void 0 ? _match_ : "";
|
|
5223
|
-
var _match_1, _ref;
|
|
5224
5239
|
var rawVal = (_ref = (_match_1 = match[3]) !== null && _match_1 !== void 0 ? _match_1 : match[4]) !== null && _ref !== void 0 ? _ref : "";
|
|
5225
5240
|
if (rawVal.startsWith('"') && rawVal.endsWith('"')) {
|
|
5226
5241
|
rawVal = rawVal.slice(1, -1);
|
|
@@ -5579,13 +5594,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5579
5594
|
{
|
|
5580
5595
|
key: "shouldShowNativeControls",
|
|
5581
5596
|
value: function shouldShowNativeControls() {
|
|
5597
|
+
var _this_config_showCustomControls;
|
|
5582
5598
|
var streamType = this.getStreamType();
|
|
5583
5599
|
if (streamType === "other") {
|
|
5584
|
-
var
|
|
5585
|
-
return !((
|
|
5600
|
+
var _this_config_showCustomControls1;
|
|
5601
|
+
return !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false);
|
|
5586
5602
|
}
|
|
5587
|
-
|
|
5588
|
-
return !!(this.config.allowNativeHls && !((_this_config_showCustomControls1 = this.config.showCustomControls) !== null && _this_config_showCustomControls1 !== void 0 ? _this_config_showCustomControls1 : false));
|
|
5603
|
+
return !!(this.config.allowNativeHls && !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false));
|
|
5589
5604
|
}
|
|
5590
5605
|
},
|
|
5591
5606
|
{
|
|
@@ -5744,12 +5759,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5744
5759
|
continueLiveStreamDuringAds = this.shouldContinueLiveStreamDuringAds();
|
|
5745
5760
|
preloadIma = this.createAdPlayer(continueLiveStreamDuringAds);
|
|
5746
5761
|
preloadIma.initialize();
|
|
5747
|
-
errorListener = function(payload) {
|
|
5762
|
+
errorListener = function errorListener(payload) {
|
|
5748
5763
|
hasAdError = true;
|
|
5749
5764
|
adErrorPayload = payload;
|
|
5750
5765
|
};
|
|
5751
5766
|
preloadIma.on("ad_error", errorListener);
|
|
5752
|
-
errorListenerCleanup = function() {
|
|
5767
|
+
errorListenerCleanup = function errorListenerCleanup() {
|
|
5753
5768
|
return preloadIma.off("ad_error", errorListener);
|
|
5754
5769
|
};
|
|
5755
5770
|
return [
|
|
@@ -5800,7 +5815,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5800
5815
|
isReady: true,
|
|
5801
5816
|
loadPromise: Promise.resolve()
|
|
5802
5817
|
};
|
|
5803
|
-
lateErrorListener = function(payload) {
|
|
5818
|
+
lateErrorListener = function lateErrorListener(payload) {
|
|
5804
5819
|
var index = _this.preloadPool.findIndex(function(entry) {
|
|
5805
5820
|
return entry.vastUrl === vastUrl;
|
|
5806
5821
|
});
|
|
@@ -5811,7 +5826,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5811
5826
|
}
|
|
5812
5827
|
try {
|
|
5813
5828
|
preloadIma.destroy();
|
|
5814
|
-
} catch (
|
|
5829
|
+
} catch (unused) {}
|
|
5815
5830
|
}
|
|
5816
5831
|
};
|
|
5817
5832
|
preloadIma.on("ad_error", lateErrorListener);
|
|
@@ -6636,7 +6651,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6636
6651
|
10
|
|
6637
6652
|
];
|
|
6638
6653
|
nextAdUrl = this.adRequestQueue.shift();
|
|
6639
|
-
if (
|
|
6654
|
+
if (nextAdUrl == null) {
|
|
6640
6655
|
return [
|
|
6641
6656
|
3,
|
|
6642
6657
|
4
|
|
@@ -6822,7 +6837,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6822
6837
|
9
|
|
6823
6838
|
];
|
|
6824
6839
|
nextAdUrl = this.adRequestQueue.shift();
|
|
6825
|
-
if (
|
|
6840
|
+
if (nextAdUrl == null) {
|
|
6826
6841
|
return [
|
|
6827
6842
|
3,
|
|
6828
6843
|
3
|
|
@@ -7027,11 +7042,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7027
7042
|
{
|
|
7028
7043
|
key: "ensureAdStoppedByTimer",
|
|
7029
7044
|
value: function ensureAdStoppedByTimer() {
|
|
7045
|
+
var _this_config_adBreakCheckIntervalMs, _this_expectedAdBreakDurationMs;
|
|
7030
7046
|
if (!this.inAdBreak) return;
|
|
7031
7047
|
this.adStopTimerId = void 0;
|
|
7032
7048
|
var adPlaying = this.ima.isAdPlaying();
|
|
7033
7049
|
var pendingAds = this.adPodQueue.length > 0;
|
|
7034
|
-
var _this_config_adBreakCheckIntervalMs;
|
|
7035
7050
|
var checkIntervalMs = Math.max(250, Math.floor((_this_config_adBreakCheckIntervalMs = this.config.adBreakCheckIntervalMs) !== null && _this_config_adBreakCheckIntervalMs !== void 0 ? _this_config_adBreakCheckIntervalMs : 1e3));
|
|
7036
7051
|
var maxExtensionMsConfig = this.config.maxAdBreakExtensionMs;
|
|
7037
7052
|
var maxExtensionMs = typeof maxExtensionMsConfig === "number" && maxExtensionMsConfig > 0 ? maxExtensionMsConfig : 6e4;
|
|
@@ -7039,7 +7054,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7039
7054
|
if (this.currentAdBreakStartWallClockMs != null) {
|
|
7040
7055
|
elapsedSinceStartMs = Date.now() - this.currentAdBreakStartWallClockMs;
|
|
7041
7056
|
}
|
|
7042
|
-
var _this_expectedAdBreakDurationMs;
|
|
7043
7057
|
var expectedDurationMs = (_this_expectedAdBreakDurationMs = this.expectedAdBreakDurationMs) !== null && _this_expectedAdBreakDurationMs !== void 0 ? _this_expectedAdBreakDurationMs : 0;
|
|
7044
7058
|
var overrunMs = Math.max(0, elapsedSinceStartMs - expectedDurationMs);
|
|
7045
7059
|
var shouldExtendAdBreak = (adPlaying || pendingAds || this.showAds) && overrunMs < maxExtensionMs;
|
|
@@ -7296,15 +7310,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7296
7310
|
9
|
|
7297
7311
|
];
|
|
7298
7312
|
case 9:
|
|
7299
|
-
if (
|
|
7300
|
-
this.
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7313
|
+
if (vastTagUrl) {
|
|
7314
|
+
if (this.isTemporaryAdError(playError)) {
|
|
7315
|
+
this.temporaryFailureUrls.set(vastTagUrl, Date.now());
|
|
7316
|
+
if (this.config.debugAdTiming) {
|
|
7317
|
+
console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
|
|
7318
|
+
}
|
|
7319
|
+
} else {
|
|
7320
|
+
this.failedVastUrls.add(vastTagUrl);
|
|
7321
|
+
if (this.config.debugAdTiming) {
|
|
7322
|
+
console.log("[AD-ERROR] Permanent play error - URL blacklisted");
|
|
7323
|
+
}
|
|
7308
7324
|
}
|
|
7309
7325
|
}
|
|
7310
7326
|
this.clearAdFailsafeTimer();
|
|
@@ -7373,15 +7389,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7373
7389
|
15
|
|
7374
7390
|
];
|
|
7375
7391
|
case 15:
|
|
7376
|
-
if (
|
|
7377
|
-
this.
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7392
|
+
if (vastTagUrl) {
|
|
7393
|
+
if (this.isTemporaryAdError(error)) {
|
|
7394
|
+
this.temporaryFailureUrls.set(vastTagUrl, Date.now());
|
|
7395
|
+
if (this.config.debugAdTiming) {
|
|
7396
|
+
console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
|
|
7397
|
+
}
|
|
7398
|
+
} else {
|
|
7399
|
+
this.failedVastUrls.add(vastTagUrl);
|
|
7400
|
+
if (this.config.debugAdTiming) {
|
|
7401
|
+
console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
|
|
7402
|
+
}
|
|
7385
7403
|
}
|
|
7386
7404
|
}
|
|
7387
7405
|
this.clearAdRequestWatchdog();
|
|
@@ -7484,8 +7502,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7484
7502
|
key: "startAdRequestWatchdog",
|
|
7485
7503
|
value: function startAdRequestWatchdog(token) {
|
|
7486
7504
|
var _this = this;
|
|
7487
|
-
this.clearAdRequestWatchdog();
|
|
7488
7505
|
var _this_config_adFailsafeTimeoutMs;
|
|
7506
|
+
this.clearAdRequestWatchdog();
|
|
7489
7507
|
var timeoutMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
|
|
7490
7508
|
this.adRequestWatchdogToken = token;
|
|
7491
7509
|
this.adRequestWatchdogId = window.setTimeout(function() {
|
|
@@ -7528,8 +7546,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7528
7546
|
key: "startAdFailsafeTimer",
|
|
7529
7547
|
value: function startAdFailsafeTimer(token) {
|
|
7530
7548
|
var _this = this;
|
|
7531
|
-
this.clearAdFailsafeTimer();
|
|
7532
7549
|
var _this_config_adFailsafeTimeoutMs;
|
|
7550
|
+
this.clearAdFailsafeTimer();
|
|
7533
7551
|
var failsafeMs = (_this_config_adFailsafeTimeoutMs = this.config.adFailsafeTimeoutMs) !== null && _this_config_adFailsafeTimeoutMs !== void 0 ? _this_config_adFailsafeTimeoutMs : 1e4;
|
|
7534
7552
|
this.adFailsafeToken = token;
|
|
7535
7553
|
this.adFailsafeTimerId = window.setTimeout(function() {
|
|
@@ -7910,21 +7928,21 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
7910
7928
|
var _React_useState14 = _sliced_to_array(React.useState(false), 2), showLicenseWarning = _React_useState14[0], setShowLicenseWarning = _React_useState14[1];
|
|
7911
7929
|
var _React_useState15 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerWidth : 1920), 2), viewportWidth = _React_useState15[0], setViewportWidth = _React_useState15[1];
|
|
7912
7930
|
var _React_useState16 = _sliced_to_array(React.useState(typeof window !== "undefined" ? window.innerHeight > window.innerWidth : false), 2), isPortrait = _React_useState16[0], setIsPortrait = _React_useState16[1];
|
|
7913
|
-
var getResponsiveScale = function() {
|
|
7931
|
+
var getResponsiveScale = function getResponsiveScale() {
|
|
7914
7932
|
if (viewportWidth < 480) return 0.7;
|
|
7915
7933
|
if (viewportWidth < 768) return 0.8;
|
|
7916
7934
|
if (viewportWidth < 1024) return 0.9;
|
|
7917
7935
|
return 1;
|
|
7918
7936
|
};
|
|
7919
7937
|
var responsiveScale = getResponsiveScale();
|
|
7920
|
-
var formatTime = function(seconds) {
|
|
7938
|
+
var formatTime = function formatTime(seconds) {
|
|
7921
7939
|
if (!isFinite(seconds)) return "0:00:00";
|
|
7922
7940
|
var hours = Math.floor(seconds / 3600);
|
|
7923
7941
|
var minutes = Math.floor(seconds % 3600 / 60);
|
|
7924
7942
|
var remainingSeconds = Math.floor(seconds % 60);
|
|
7925
7943
|
return "".concat(hours, ":").concat(minutes.toString().padStart(2, "0"), ":").concat(remainingSeconds.toString().padStart(2, "0"));
|
|
7926
7944
|
};
|
|
7927
|
-
var handlePlayPause = function() {
|
|
7945
|
+
var handlePlayPause = function handlePlayPause() {
|
|
7928
7946
|
if (videoRef.current) {
|
|
7929
7947
|
if (videoRef.current.paused) {
|
|
7930
7948
|
var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
|
|
@@ -7943,7 +7961,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
7943
7961
|
}
|
|
7944
7962
|
}
|
|
7945
7963
|
};
|
|
7946
|
-
var handleCenterPlayClick = function() {
|
|
7964
|
+
var handleCenterPlayClick = function handleCenterPlayClick() {
|
|
7947
7965
|
if (videoRef.current && videoRef.current.paused) {
|
|
7948
7966
|
var hasValidSource = videoRef.current.src || videoRef.current.currentSrc && videoRef.current.currentSrc !== "" || videoRef.current.readyState >= 1;
|
|
7949
7967
|
if (hasValidSource) {
|
|
@@ -7957,7 +7975,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
7957
7975
|
}
|
|
7958
7976
|
}
|
|
7959
7977
|
};
|
|
7960
|
-
var handleTimelineSeek = function(e) {
|
|
7978
|
+
var handleTimelineSeek = function handleTimelineSeek(e) {
|
|
7961
7979
|
if (videoRef.current && duration > 0 && isFinite(duration)) {
|
|
7962
7980
|
var rect = e.currentTarget.getBoundingClientRect();
|
|
7963
7981
|
var clickX = e.clientX - rect.left;
|
|
@@ -7968,13 +7986,13 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
7968
7986
|
}
|
|
7969
7987
|
}
|
|
7970
7988
|
};
|
|
7971
|
-
var handleVolumeChange = function(newVolume) {
|
|
7989
|
+
var handleVolumeChange = function handleVolumeChange(newVolume) {
|
|
7972
7990
|
if (playerRef.current && isFinite(newVolume)) {
|
|
7973
7991
|
var clampedVolume = Math.max(0, Math.min(1, newVolume));
|
|
7974
7992
|
playerRef.current.setVolume(clampedVolume);
|
|
7975
7993
|
}
|
|
7976
7994
|
};
|
|
7977
|
-
var handlePlaybackRateChange = function(rate) {
|
|
7995
|
+
var handlePlaybackRateChange = function handlePlaybackRateChange(rate) {
|
|
7978
7996
|
if (videoRef.current && isFinite(rate) && rate > 0) {
|
|
7979
7997
|
videoRef.current.playbackRate = rate;
|
|
7980
7998
|
}
|
|
@@ -8012,7 +8030,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8012
8030
|
if (playerRef.current) {
|
|
8013
8031
|
try {
|
|
8014
8032
|
playerRef.current.destroy();
|
|
8015
|
-
} catch (
|
|
8033
|
+
} catch (unused) {}
|
|
8016
8034
|
playerRef.current = null;
|
|
8017
8035
|
}
|
|
8018
8036
|
var cfg = {
|
|
@@ -8052,7 +8070,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8052
8070
|
return function() {
|
|
8053
8071
|
try {
|
|
8054
8072
|
player.destroy();
|
|
8055
|
-
} catch (
|
|
8073
|
+
} catch (unused) {}
|
|
8056
8074
|
playerRef.current = null;
|
|
8057
8075
|
};
|
|
8058
8076
|
}, [
|
|
@@ -8076,7 +8094,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8076
8094
|
]);
|
|
8077
8095
|
useEffect(function() {
|
|
8078
8096
|
if (!playerRef.current) return;
|
|
8079
|
-
var checkAdStatus = function() {
|
|
8097
|
+
var checkAdStatus = function checkAdStatus() {
|
|
8080
8098
|
if (playerRef.current) {
|
|
8081
8099
|
var _videoRef_current_dataset, _videoRef_current;
|
|
8082
8100
|
var showAdsFromMethod = playerRef.current.isShowingAds();
|
|
@@ -8106,7 +8124,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8106
8124
|
}, []);
|
|
8107
8125
|
useEffect(function() {
|
|
8108
8126
|
if (typeof window === "undefined" || !playerRef.current) return;
|
|
8109
|
-
var handleResize = function() {
|
|
8127
|
+
var handleResize = function handleResize() {
|
|
8110
8128
|
if (playerRef.current && videoRef.current) {
|
|
8111
8129
|
if (typeof playerRef.current.resize === "function") {
|
|
8112
8130
|
playerRef.current.resize();
|
|
@@ -8122,7 +8140,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8122
8140
|
}, []);
|
|
8123
8141
|
useEffect(function() {
|
|
8124
8142
|
if (!playerRef.current || !videoRef.current) return;
|
|
8125
|
-
var updateStates = function() {
|
|
8143
|
+
var updateStates = function updateStates() {
|
|
8126
8144
|
var _videoRef_current;
|
|
8127
8145
|
if (playerRef.current && videoRef.current) {
|
|
8128
8146
|
setIsMuted(playerRef.current.isMuted());
|
|
@@ -8139,7 +8157,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8139
8157
|
setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
|
|
8140
8158
|
};
|
|
8141
8159
|
var interval = setInterval(updateStates, 200);
|
|
8142
|
-
var handleFullscreenChange = function() {
|
|
8160
|
+
var handleFullscreenChange = function handleFullscreenChange() {
|
|
8143
8161
|
var _videoRef_current;
|
|
8144
8162
|
setIsFullscreen(document.fullscreenElement === ((_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.parentElement));
|
|
8145
8163
|
};
|
|
@@ -8151,7 +8169,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8151
8169
|
}, []);
|
|
8152
8170
|
useEffect(function() {
|
|
8153
8171
|
if (!videoRef.current) return;
|
|
8154
|
-
var handleLoadedMetadata = function() {
|
|
8172
|
+
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
8155
8173
|
if (videoRef.current) {
|
|
8156
8174
|
var video2 = videoRef.current;
|
|
8157
8175
|
void video2.offsetHeight;
|
|
@@ -8161,19 +8179,19 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8161
8179
|
console.log("[StormcloudUI] Video event: loadedmetadata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
|
|
8162
8180
|
}
|
|
8163
8181
|
};
|
|
8164
|
-
var handleLoadedData = function() {
|
|
8182
|
+
var handleLoadedData = function handleLoadedData() {
|
|
8165
8183
|
if (debugAdTiming) {
|
|
8166
8184
|
var _videoRef_current;
|
|
8167
8185
|
console.log("[StormcloudUI] Video event: loadeddata, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
|
|
8168
8186
|
}
|
|
8169
8187
|
};
|
|
8170
|
-
var handleLoadStart = function() {
|
|
8188
|
+
var handleLoadStart = function handleLoadStart() {
|
|
8171
8189
|
if (debugAdTiming) {
|
|
8172
8190
|
var _videoRef_current;
|
|
8173
8191
|
console.log("[StormcloudUI] Video event: loadstart, readyState:", (_videoRef_current = videoRef.current) === null || _videoRef_current === void 0 ? void 0 : _videoRef_current.readyState);
|
|
8174
8192
|
}
|
|
8175
8193
|
};
|
|
8176
|
-
var handleCanPlay = function() {
|
|
8194
|
+
var handleCanPlay = function handleCanPlay() {
|
|
8177
8195
|
setIsLoading(false);
|
|
8178
8196
|
if (bufferingTimeoutRef.current) {
|
|
8179
8197
|
clearTimeout(bufferingTimeoutRef.current);
|
|
@@ -8185,7 +8203,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8185
8203
|
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");
|
|
8186
8204
|
}
|
|
8187
8205
|
};
|
|
8188
|
-
var handleCanPlayThrough = function() {
|
|
8206
|
+
var handleCanPlayThrough = function handleCanPlayThrough() {
|
|
8189
8207
|
setIsLoading(false);
|
|
8190
8208
|
if (bufferingTimeoutRef.current) {
|
|
8191
8209
|
clearTimeout(bufferingTimeoutRef.current);
|
|
@@ -8197,7 +8215,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8197
8215
|
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");
|
|
8198
8216
|
}
|
|
8199
8217
|
};
|
|
8200
|
-
var handleWaiting = function() {
|
|
8218
|
+
var handleWaiting = function handleWaiting() {
|
|
8201
8219
|
if (bufferingTimeoutRef.current) {
|
|
8202
8220
|
clearTimeout(bufferingTimeoutRef.current);
|
|
8203
8221
|
}
|
|
@@ -8213,7 +8231,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8213
8231
|
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)");
|
|
8214
8232
|
}
|
|
8215
8233
|
};
|
|
8216
|
-
var handlePlaying = function() {
|
|
8234
|
+
var handlePlaying = function handlePlaying() {
|
|
8217
8235
|
setIsLoading(false);
|
|
8218
8236
|
if (bufferingTimeoutRef.current) {
|
|
8219
8237
|
clearTimeout(bufferingTimeoutRef.current);
|
|
@@ -8226,7 +8244,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8226
8244
|
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");
|
|
8227
8245
|
}
|
|
8228
8246
|
};
|
|
8229
|
-
var handlePause = function() {
|
|
8247
|
+
var handlePause = function handlePause() {
|
|
8230
8248
|
var _playerRef_current, _videoRef_current_dataset, _videoRef_current;
|
|
8231
8249
|
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";
|
|
8232
8250
|
if (playerRef.current && !isAdActive) {
|
|
@@ -8235,7 +8253,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8235
8253
|
setShowCenterPlay(false);
|
|
8236
8254
|
}
|
|
8237
8255
|
};
|
|
8238
|
-
var handleEnded = function() {
|
|
8256
|
+
var handleEnded = function handleEnded() {
|
|
8239
8257
|
setShowCenterPlay(true);
|
|
8240
8258
|
};
|
|
8241
8259
|
var video = videoRef.current;
|
|
@@ -8393,14 +8411,14 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8393
8411
|
boxShadow: "0 12px 40px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.3)",
|
|
8394
8412
|
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
8395
8413
|
},
|
|
8396
|
-
onMouseEnter: function(e) {
|
|
8414
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8397
8415
|
var target = e.currentTarget;
|
|
8398
8416
|
target.style.transform = "translate(-50%, -50%)";
|
|
8399
8417
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(40, 40, 40, 0.9) 100%)";
|
|
8400
8418
|
target.style.boxShadow = "0 16px 48px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4)";
|
|
8401
8419
|
target.style.borderColor = "rgba(255, 255, 255, 0.9)";
|
|
8402
8420
|
},
|
|
8403
|
-
onMouseLeave: function(e) {
|
|
8421
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8404
8422
|
var target = e.currentTarget;
|
|
8405
8423
|
target.style.transform = "translate(-50%, -50%)";
|
|
8406
8424
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%)";
|
|
@@ -8507,12 +8525,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8507
8525
|
minWidth: "".concat(48 * responsiveScale, "px"),
|
|
8508
8526
|
minHeight: "".concat(48 * responsiveScale, "px")
|
|
8509
8527
|
},
|
|
8510
|
-
onMouseEnter: function(e) {
|
|
8528
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8511
8529
|
var target = e.target;
|
|
8512
8530
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
|
|
8513
8531
|
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)";
|
|
8514
8532
|
},
|
|
8515
|
-
onMouseLeave: function(e) {
|
|
8533
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8516
8534
|
var target = e.target;
|
|
8517
8535
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
|
|
8518
8536
|
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)";
|
|
@@ -8538,15 +8556,15 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8538
8556
|
padding: "8px",
|
|
8539
8557
|
margin: "-8px"
|
|
8540
8558
|
},
|
|
8541
|
-
onMouseEnter: function() {
|
|
8559
|
+
onMouseEnter: function onMouseEnter() {
|
|
8542
8560
|
return setShowVolumeSlider(true);
|
|
8543
8561
|
},
|
|
8544
|
-
onMouseLeave: function() {
|
|
8562
|
+
onMouseLeave: function onMouseLeave() {
|
|
8545
8563
|
return setShowVolumeSlider(false);
|
|
8546
8564
|
},
|
|
8547
8565
|
children: [
|
|
8548
8566
|
/* @__PURE__ */ jsx("button", {
|
|
8549
|
-
onClick: function() {
|
|
8567
|
+
onClick: function onClick() {
|
|
8550
8568
|
if (playerRef.current) {
|
|
8551
8569
|
playerRef.current.toggleMute();
|
|
8552
8570
|
}
|
|
@@ -8570,12 +8588,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8570
8588
|
minWidth: "".concat(44 * responsiveScale, "px"),
|
|
8571
8589
|
minHeight: "".concat(44 * responsiveScale, "px")
|
|
8572
8590
|
},
|
|
8573
|
-
onMouseEnter: function(e) {
|
|
8591
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8574
8592
|
var target = e.target;
|
|
8575
8593
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
|
|
8576
8594
|
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)";
|
|
8577
8595
|
},
|
|
8578
|
-
onMouseLeave: function(e) {
|
|
8596
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8579
8597
|
var target = e.target;
|
|
8580
8598
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
|
|
8581
8599
|
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)";
|
|
@@ -8611,10 +8629,10 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8611
8629
|
marginBottom: "-16px",
|
|
8612
8630
|
zIndex: 9
|
|
8613
8631
|
},
|
|
8614
|
-
onMouseEnter: function() {
|
|
8632
|
+
onMouseEnter: function onMouseEnter() {
|
|
8615
8633
|
return setShowVolumeSlider(true);
|
|
8616
8634
|
},
|
|
8617
|
-
onMouseLeave: function() {
|
|
8635
|
+
onMouseLeave: function onMouseLeave() {
|
|
8618
8636
|
return setShowVolumeSlider(false);
|
|
8619
8637
|
}
|
|
8620
8638
|
}),
|
|
@@ -8639,12 +8657,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8639
8657
|
zIndex: 10,
|
|
8640
8658
|
transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
|
|
8641
8659
|
},
|
|
8642
|
-
onMouseEnter: function(e) {
|
|
8660
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8643
8661
|
setShowVolumeSlider(true);
|
|
8644
8662
|
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)";
|
|
8645
8663
|
e.currentTarget.style.borderColor = "rgba(59, 130, 246, 0.4)";
|
|
8646
8664
|
},
|
|
8647
|
-
onMouseLeave: function(e) {
|
|
8665
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8648
8666
|
setShowVolumeSlider(false);
|
|
8649
8667
|
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)";
|
|
8650
8668
|
e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.15)";
|
|
@@ -8657,19 +8675,19 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8657
8675
|
cursor: "pointer",
|
|
8658
8676
|
transition: "transform 0.2s ease-in-out"
|
|
8659
8677
|
},
|
|
8660
|
-
onMouseEnter: function(e) {},
|
|
8661
|
-
onMouseLeave: function(e) {},
|
|
8662
|
-
onMouseDown: function(e) {
|
|
8678
|
+
onMouseEnter: function onMouseEnter(e) {},
|
|
8679
|
+
onMouseLeave: function onMouseLeave(e) {},
|
|
8680
|
+
onMouseDown: function onMouseDown(e) {
|
|
8663
8681
|
e.preventDefault();
|
|
8664
8682
|
var sliderElement = e.currentTarget;
|
|
8665
|
-
var handleMouseMove = function(moveEvent) {
|
|
8683
|
+
var handleMouseMove = function handleMouseMove(moveEvent) {
|
|
8666
8684
|
if (!sliderElement) return;
|
|
8667
8685
|
var rect2 = sliderElement.getBoundingClientRect();
|
|
8668
8686
|
var y2 = moveEvent.clientY - rect2.top;
|
|
8669
8687
|
var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
|
|
8670
8688
|
handleVolumeChange(percentage2);
|
|
8671
8689
|
};
|
|
8672
|
-
var handleMouseUp = function() {
|
|
8690
|
+
var handleMouseUp = function handleMouseUp1() {
|
|
8673
8691
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
8674
8692
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
8675
8693
|
};
|
|
@@ -8680,7 +8698,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8680
8698
|
var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
|
|
8681
8699
|
handleVolumeChange(percentage);
|
|
8682
8700
|
},
|
|
8683
|
-
onClick: function(e) {
|
|
8701
|
+
onClick: function onClick(e) {
|
|
8684
8702
|
e.stopPropagation();
|
|
8685
8703
|
var rect = e.currentTarget.getBoundingClientRect();
|
|
8686
8704
|
var y = e.clientY - rect.top;
|
|
@@ -8727,17 +8745,17 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8727
8745
|
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",
|
|
8728
8746
|
cursor: "grab"
|
|
8729
8747
|
},
|
|
8730
|
-
onMouseEnter: function(e) {
|
|
8748
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8731
8749
|
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)";
|
|
8732
8750
|
e.currentTarget.style.cursor = "grab";
|
|
8733
8751
|
},
|
|
8734
|
-
onMouseLeave: function(e) {
|
|
8752
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8735
8753
|
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)";
|
|
8736
8754
|
},
|
|
8737
|
-
onMouseDown: function(e) {
|
|
8755
|
+
onMouseDown: function onMouseDown(e) {
|
|
8738
8756
|
e.currentTarget.style.cursor = "grabbing";
|
|
8739
8757
|
},
|
|
8740
|
-
onMouseUp: function(e) {
|
|
8758
|
+
onMouseUp: function onMouseUp(e) {
|
|
8741
8759
|
e.currentTarget.style.cursor = "grab";
|
|
8742
8760
|
}
|
|
8743
8761
|
})
|
|
@@ -8777,7 +8795,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8777
8795
|
},
|
|
8778
8796
|
children: [
|
|
8779
8797
|
/* @__PURE__ */ jsxs("button", {
|
|
8780
|
-
onClick: function() {
|
|
8798
|
+
onClick: function onClick() {
|
|
8781
8799
|
return setShowSpeedMenu(!showSpeedMenu);
|
|
8782
8800
|
},
|
|
8783
8801
|
style: {
|
|
@@ -8796,12 +8814,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8796
8814
|
minWidth: "".concat(56 * responsiveScale, "px"),
|
|
8797
8815
|
minHeight: "".concat(40 * responsiveScale, "px")
|
|
8798
8816
|
},
|
|
8799
|
-
onMouseEnter: function(e) {
|
|
8817
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8800
8818
|
var target = e.target;
|
|
8801
8819
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
|
|
8802
8820
|
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)";
|
|
8803
8821
|
},
|
|
8804
|
-
onMouseLeave: function(e) {
|
|
8822
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8805
8823
|
var target = e.target;
|
|
8806
8824
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
|
|
8807
8825
|
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)";
|
|
@@ -8837,7 +8855,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8837
8855
|
2
|
|
8838
8856
|
].map(function(speed) {
|
|
8839
8857
|
return /* @__PURE__ */ jsxs("button", {
|
|
8840
|
-
onClick: function() {
|
|
8858
|
+
onClick: function onClick() {
|
|
8841
8859
|
return handlePlaybackRateChange(speed);
|
|
8842
8860
|
},
|
|
8843
8861
|
style: {
|
|
@@ -8855,12 +8873,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8855
8873
|
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
8856
8874
|
borderBottom: speed !== 2 ? "1px solid rgba(255, 255, 255, 0.05)" : "none"
|
|
8857
8875
|
},
|
|
8858
|
-
onMouseEnter: function(e) {
|
|
8876
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8859
8877
|
if (playbackRate !== speed) {
|
|
8860
8878
|
e.target.style.background = "linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%)";
|
|
8861
8879
|
}
|
|
8862
8880
|
},
|
|
8863
|
-
onMouseLeave: function(e) {
|
|
8881
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8864
8882
|
if (playbackRate !== speed) {
|
|
8865
8883
|
e.target.style.background = "transparent";
|
|
8866
8884
|
}
|
|
@@ -8875,7 +8893,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8875
8893
|
]
|
|
8876
8894
|
}),
|
|
8877
8895
|
/* @__PURE__ */ jsx("button", {
|
|
8878
|
-
onClick: function() {
|
|
8896
|
+
onClick: function onClick() {
|
|
8879
8897
|
if (onFullscreenToggle) {
|
|
8880
8898
|
onFullscreenToggle();
|
|
8881
8899
|
} else if (playerRef.current) {
|
|
@@ -8900,12 +8918,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8900
8918
|
minWidth: "".concat(44 * responsiveScale, "px"),
|
|
8901
8919
|
minHeight: "".concat(44 * responsiveScale, "px")
|
|
8902
8920
|
},
|
|
8903
|
-
onMouseEnter: function(e) {
|
|
8921
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8904
8922
|
var target = e.target;
|
|
8905
8923
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.7) 100%)";
|
|
8906
8924
|
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)";
|
|
8907
8925
|
},
|
|
8908
|
-
onMouseLeave: function(e) {
|
|
8926
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8909
8927
|
var target = e.target;
|
|
8910
8928
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 100%)";
|
|
8911
8929
|
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)";
|
|
@@ -8949,15 +8967,15 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8949
8967
|
padding: "8px",
|
|
8950
8968
|
margin: "-8px"
|
|
8951
8969
|
},
|
|
8952
|
-
onMouseEnter: function() {
|
|
8970
|
+
onMouseEnter: function onMouseEnter() {
|
|
8953
8971
|
return setShowVolumeSlider(true);
|
|
8954
8972
|
},
|
|
8955
|
-
onMouseLeave: function() {
|
|
8973
|
+
onMouseLeave: function onMouseLeave() {
|
|
8956
8974
|
return setShowVolumeSlider(false);
|
|
8957
8975
|
},
|
|
8958
8976
|
children: [
|
|
8959
8977
|
/* @__PURE__ */ jsx("button", {
|
|
8960
|
-
onClick: function() {
|
|
8978
|
+
onClick: function onClick() {
|
|
8961
8979
|
if (playerRef.current) {
|
|
8962
8980
|
playerRef.current.toggleMute();
|
|
8963
8981
|
}
|
|
@@ -8965,12 +8983,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
8965
8983
|
onVolumeToggle();
|
|
8966
8984
|
}
|
|
8967
8985
|
},
|
|
8968
|
-
onMouseEnter: function(e) {
|
|
8986
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
8969
8987
|
var target = e.currentTarget;
|
|
8970
8988
|
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)";
|
|
8971
8989
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
|
|
8972
8990
|
},
|
|
8973
|
-
onMouseLeave: function(e) {
|
|
8991
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
8974
8992
|
var target = e.currentTarget;
|
|
8975
8993
|
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)";
|
|
8976
8994
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
|
|
@@ -9025,10 +9043,10 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
9025
9043
|
marginBottom: "-16px",
|
|
9026
9044
|
zIndex: 9
|
|
9027
9045
|
},
|
|
9028
|
-
onMouseEnter: function() {
|
|
9046
|
+
onMouseEnter: function onMouseEnter() {
|
|
9029
9047
|
return setShowVolumeSlider(true);
|
|
9030
9048
|
},
|
|
9031
|
-
onMouseLeave: function() {
|
|
9049
|
+
onMouseLeave: function onMouseLeave() {
|
|
9032
9050
|
return setShowVolumeSlider(false);
|
|
9033
9051
|
}
|
|
9034
9052
|
}),
|
|
@@ -9053,12 +9071,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
9053
9071
|
zIndex: 10,
|
|
9054
9072
|
transition: "transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out"
|
|
9055
9073
|
},
|
|
9056
|
-
onMouseEnter: function(e) {
|
|
9074
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
9057
9075
|
setShowVolumeSlider(true);
|
|
9058
9076
|
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)";
|
|
9059
9077
|
e.currentTarget.style.borderColor = "rgba(96, 165, 250, 0.8)";
|
|
9060
9078
|
},
|
|
9061
|
-
onMouseLeave: function(e) {
|
|
9079
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
9062
9080
|
setShowVolumeSlider(false);
|
|
9063
9081
|
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)";
|
|
9064
9082
|
e.currentTarget.style.borderColor = "rgba(255, 255, 255, 0.7)";
|
|
@@ -9071,17 +9089,17 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
9071
9089
|
cursor: "pointer",
|
|
9072
9090
|
transition: "transform 0.2s ease-in-out"
|
|
9073
9091
|
},
|
|
9074
|
-
onMouseDown: function(e) {
|
|
9092
|
+
onMouseDown: function onMouseDown(e) {
|
|
9075
9093
|
e.preventDefault();
|
|
9076
9094
|
var sliderElement = e.currentTarget;
|
|
9077
|
-
var handleMouseMove = function(moveEvent) {
|
|
9095
|
+
var handleMouseMove = function handleMouseMove(moveEvent) {
|
|
9078
9096
|
if (!sliderElement) return;
|
|
9079
9097
|
var rect2 = sliderElement.getBoundingClientRect();
|
|
9080
9098
|
var y2 = moveEvent.clientY - rect2.top;
|
|
9081
9099
|
var percentage2 = 1 - Math.max(0, Math.min(1, y2 / rect2.height));
|
|
9082
9100
|
handleVolumeChange(percentage2);
|
|
9083
9101
|
};
|
|
9084
|
-
var handleMouseUp = function() {
|
|
9102
|
+
var handleMouseUp = function handleMouseUp1() {
|
|
9085
9103
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
9086
9104
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
9087
9105
|
};
|
|
@@ -9092,7 +9110,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
9092
9110
|
var percentage = 1 - Math.max(0, Math.min(1, y / rect.height));
|
|
9093
9111
|
handleVolumeChange(percentage);
|
|
9094
9112
|
},
|
|
9095
|
-
onClick: function(e) {
|
|
9113
|
+
onClick: function onClick(e) {
|
|
9096
9114
|
e.stopPropagation();
|
|
9097
9115
|
var rect = e.currentTarget.getBoundingClientRect();
|
|
9098
9116
|
var y = e.clientY - rect.top;
|
|
@@ -9141,17 +9159,17 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
9141
9159
|
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",
|
|
9142
9160
|
cursor: "grab"
|
|
9143
9161
|
},
|
|
9144
|
-
onMouseEnter: function(e) {
|
|
9162
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
9145
9163
|
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)";
|
|
9146
9164
|
e.currentTarget.style.cursor = "grab";
|
|
9147
9165
|
},
|
|
9148
|
-
onMouseLeave: function(e) {
|
|
9166
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
9149
9167
|
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)";
|
|
9150
9168
|
},
|
|
9151
|
-
onMouseDown: function(e) {
|
|
9169
|
+
onMouseDown: function onMouseDown(e) {
|
|
9152
9170
|
e.currentTarget.style.cursor = "grabbing";
|
|
9153
9171
|
},
|
|
9154
|
-
onMouseUp: function(e) {
|
|
9172
|
+
onMouseUp: function onMouseUp(e) {
|
|
9155
9173
|
e.currentTarget.style.cursor = "grab";
|
|
9156
9174
|
}
|
|
9157
9175
|
})
|
|
@@ -9163,7 +9181,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
9163
9181
|
]
|
|
9164
9182
|
}),
|
|
9165
9183
|
/* @__PURE__ */ jsx("button", {
|
|
9166
|
-
onClick: function() {
|
|
9184
|
+
onClick: function onClick() {
|
|
9167
9185
|
if (onFullscreenToggle) {
|
|
9168
9186
|
onFullscreenToggle();
|
|
9169
9187
|
} else if (playerRef.current) {
|
|
@@ -9172,12 +9190,12 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
9172
9190
|
});
|
|
9173
9191
|
}
|
|
9174
9192
|
},
|
|
9175
|
-
onMouseEnter: function(e) {
|
|
9193
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
9176
9194
|
var target = e.currentTarget;
|
|
9177
9195
|
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)";
|
|
9178
9196
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%)";
|
|
9179
9197
|
},
|
|
9180
|
-
onMouseLeave: function(e) {
|
|
9198
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
9181
9199
|
var target = e.currentTarget;
|
|
9182
9200
|
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)";
|
|
9183
9201
|
target.style.background = "linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.65) 100%)";
|
|
@@ -9323,7 +9341,7 @@ var StormcloudVideoPlayerComponent = React.memo(function(props) {
|
|
|
9323
9341
|
// src/StormcloudPlayer.tsx
|
|
9324
9342
|
import React3, { Component as Component4, Suspense } from "react";
|
|
9325
9343
|
// src/props.ts
|
|
9326
|
-
var noop = function() {};
|
|
9344
|
+
var noop = function noop() {};
|
|
9327
9345
|
var defaultProps = {
|
|
9328
9346
|
playing: false,
|
|
9329
9347
|
loop: false,
|
|
@@ -9369,29 +9387,29 @@ var defaultProps = {
|
|
|
9369
9387
|
// src/utils.ts
|
|
9370
9388
|
import { lazy as reactLazy } from "react";
|
|
9371
9389
|
var lazy = reactLazy;
|
|
9372
|
-
var omit = function(object, keys) {
|
|
9390
|
+
var omit = function omit(object, keys) {
|
|
9373
9391
|
var result = _object_spread({}, object);
|
|
9374
9392
|
keys.forEach(function(key) {
|
|
9375
9393
|
delete result[key];
|
|
9376
9394
|
});
|
|
9377
9395
|
return result;
|
|
9378
9396
|
};
|
|
9379
|
-
var isMediaStream = function(url) {
|
|
9397
|
+
var isMediaStream = function isMediaStream(url) {
|
|
9380
9398
|
return typeof window !== "undefined" && window.MediaStream && _instanceof(url, window.MediaStream);
|
|
9381
9399
|
};
|
|
9382
|
-
var supportsWebKitPresentationMode = function() {
|
|
9400
|
+
var supportsWebKitPresentationMode = function supportsWebKitPresentationMode() {
|
|
9383
9401
|
if (typeof window === "undefined") return false;
|
|
9384
9402
|
var video = document.createElement("video");
|
|
9385
9403
|
return "webkitSupportsPresentationMode" in video;
|
|
9386
9404
|
};
|
|
9387
|
-
var randomString = function() {
|
|
9405
|
+
var randomString = function randomString() {
|
|
9388
9406
|
return Math.random().toString(36).substr(2, 9);
|
|
9389
9407
|
};
|
|
9390
|
-
var parseQuery = function(url) {
|
|
9408
|
+
var parseQuery = function parseQuery(url) {
|
|
9391
9409
|
var query = {};
|
|
9392
9410
|
var queryString = url.split("?")[1] || "";
|
|
9393
9411
|
if (!queryString) return query;
|
|
9394
|
-
var manualParse = function(qs) {
|
|
9412
|
+
var manualParse = function manualParse(qs) {
|
|
9395
9413
|
qs.split("&").forEach(function(param) {
|
|
9396
9414
|
var _param_split = _sliced_to_array(param.split("="), 2), key = _param_split[0], value = _param_split[1];
|
|
9397
9415
|
if (key) {
|
|
@@ -9418,7 +9436,7 @@ var parseQuery = function(url) {
|
|
|
9418
9436
|
}
|
|
9419
9437
|
return query;
|
|
9420
9438
|
};
|
|
9421
|
-
var merge = function(target) {
|
|
9439
|
+
var merge = function merge1(target) {
|
|
9422
9440
|
for(var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
9423
9441
|
sources[_key - 1] = arguments[_key];
|
|
9424
9442
|
}
|
|
@@ -9438,19 +9456,19 @@ var merge = function(target) {
|
|
|
9438
9456
|
target
|
|
9439
9457
|
].concat(_to_consumable_array(sources)));
|
|
9440
9458
|
};
|
|
9441
|
-
var isObject = function(item) {
|
|
9459
|
+
var isObject = function isObject(item) {
|
|
9442
9460
|
return item && (typeof item === "undefined" ? "undefined" : _type_of(item)) === "object" && !Array.isArray(item);
|
|
9443
9461
|
};
|
|
9444
9462
|
var IS_BROWSER = typeof window !== "undefined" && window.document;
|
|
9445
9463
|
var IS_GLOBAL = typeof globalThis !== "undefined" && globalThis.window && globalThis.window.document;
|
|
9446
9464
|
var IS_IOS = IS_BROWSER && /iPad|iPhone|iPod/.test(navigator.userAgent);
|
|
9447
9465
|
var IS_SAFARI = IS_BROWSER && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
9448
|
-
var SUPPORTS_HLS = function() {
|
|
9466
|
+
var SUPPORTS_HLS = function SUPPORTS_HLS() {
|
|
9449
9467
|
if (!IS_BROWSER) return false;
|
|
9450
9468
|
var video = document.createElement("video");
|
|
9451
9469
|
return Boolean(video.canPlayType("application/vnd.apple.mpegurl"));
|
|
9452
9470
|
};
|
|
9453
|
-
var SUPPORTS_DASH = function() {
|
|
9471
|
+
var SUPPORTS_DASH = function SUPPORTS_DASH() {
|
|
9454
9472
|
if (!IS_BROWSER) return false;
|
|
9455
9473
|
var video = document.createElement("video");
|
|
9456
9474
|
return Boolean(video.canPlayType("application/dash+xml"));
|
|
@@ -9462,23 +9480,23 @@ var DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
|
|
|
9462
9480
|
var VIDEO_EXTENSIONS = /\.(mp4|webm|ogg|avi|mov|wmv|flv|mkv)($|\?)/i;
|
|
9463
9481
|
var AUDIO_EXTENSIONS = /\.(mp3|wav|ogg|aac|wma|flac|m4a)($|\?)/i;
|
|
9464
9482
|
var canPlay = {
|
|
9465
|
-
hls: function(url) {
|
|
9483
|
+
hls: function hls(url) {
|
|
9466
9484
|
if (!url || typeof url !== "string") return false;
|
|
9467
9485
|
return HLS_EXTENSIONS.test(url) || HLS_PATHS.test(url);
|
|
9468
9486
|
},
|
|
9469
|
-
dash: function(url) {
|
|
9487
|
+
dash: function dash(url) {
|
|
9470
9488
|
if (!url || typeof url !== "string") return false;
|
|
9471
9489
|
return DASH_EXTENSIONS.test(url);
|
|
9472
9490
|
},
|
|
9473
|
-
video: function(url) {
|
|
9491
|
+
video: function video(url) {
|
|
9474
9492
|
if (!url || typeof url !== "string") return false;
|
|
9475
9493
|
return VIDEO_EXTENSIONS.test(url);
|
|
9476
9494
|
},
|
|
9477
|
-
audio: function(url) {
|
|
9495
|
+
audio: function audio(url) {
|
|
9478
9496
|
if (!url || typeof url !== "string") return false;
|
|
9479
9497
|
return AUDIO_EXTENSIONS.test(url);
|
|
9480
9498
|
},
|
|
9481
|
-
file: function(url) {
|
|
9499
|
+
file: function file(url) {
|
|
9482
9500
|
if (!url || typeof url !== "string") return false;
|
|
9483
9501
|
return VIDEO_EXTENSIONS.test(url) || AUDIO_EXTENSIONS.test(url);
|
|
9484
9502
|
}
|
|
@@ -9491,11 +9509,11 @@ var HlsPlayer = /*#__PURE__*/ function(Component) {
|
|
|
9491
9509
|
function HlsPlayer() {
|
|
9492
9510
|
_class_call_check(this, HlsPlayer);
|
|
9493
9511
|
var _this;
|
|
9494
|
-
var _this1
|
|
9495
|
-
_this = _call_super(this, HlsPlayer,
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9512
|
+
var _this1;
|
|
9513
|
+
_this = _call_super(this, HlsPlayer, arguments), _this1 = _this;
|
|
9514
|
+
_this.player = null;
|
|
9515
|
+
_this.mounted = false;
|
|
9516
|
+
_this.load = function() {
|
|
9499
9517
|
return _async_to_generator(function() {
|
|
9500
9518
|
var _this_props_onMount, _this_props, config, _this_props_onReady, _this_props1, error, _this_props_onError, _this_props2;
|
|
9501
9519
|
return _ts_generator(this, function(_state) {
|
|
@@ -9568,87 +9586,87 @@ var HlsPlayer = /*#__PURE__*/ function(Component) {
|
|
|
9568
9586
|
});
|
|
9569
9587
|
})();
|
|
9570
9588
|
};
|
|
9571
|
-
|
|
9572
|
-
if (
|
|
9573
|
-
var video =
|
|
9589
|
+
_this.play = function() {
|
|
9590
|
+
if (_this.props.videoElement) {
|
|
9591
|
+
var video = _this.props.videoElement;
|
|
9574
9592
|
var hasValidSource = video.src || video.currentSrc && video.currentSrc !== "" || video.readyState >= 1;
|
|
9575
9593
|
if (hasValidSource) {
|
|
9576
9594
|
var _video_play, _this_props_onPlay, _this_props;
|
|
9577
9595
|
(_video_play = video.play()) === null || _video_play === void 0 ? void 0 : _video_play.catch(function(error) {
|
|
9578
9596
|
var _this_props_onError, _this_props;
|
|
9579
9597
|
console.error("[HlsPlayer] Failed to play:", error);
|
|
9580
|
-
(_this_props_onError = (_this_props =
|
|
9598
|
+
(_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
|
|
9581
9599
|
});
|
|
9582
|
-
(_this_props_onPlay = (_this_props =
|
|
9600
|
+
(_this_props_onPlay = (_this_props = _this.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
|
|
9583
9601
|
} else {
|
|
9584
9602
|
console.warn("[HlsPlayer] Cannot play: video has no valid source");
|
|
9585
9603
|
}
|
|
9586
9604
|
}
|
|
9587
9605
|
};
|
|
9588
|
-
|
|
9589
|
-
if (
|
|
9606
|
+
_this.pause = function() {
|
|
9607
|
+
if (_this.props.videoElement) {
|
|
9590
9608
|
var _this_props_onPause, _this_props;
|
|
9591
|
-
|
|
9592
|
-
(_this_props_onPause = (_this_props =
|
|
9609
|
+
_this.props.videoElement.pause();
|
|
9610
|
+
(_this_props_onPause = (_this_props = _this.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
|
|
9593
9611
|
}
|
|
9594
9612
|
};
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
if (
|
|
9598
|
-
|
|
9613
|
+
_this.stop = function() {
|
|
9614
|
+
_this.pause();
|
|
9615
|
+
if (_this.props.videoElement) {
|
|
9616
|
+
_this.props.videoElement.currentTime = 0;
|
|
9599
9617
|
}
|
|
9600
9618
|
};
|
|
9601
|
-
|
|
9602
|
-
if (
|
|
9603
|
-
|
|
9619
|
+
_this.seekTo = function(seconds, keepPlaying) {
|
|
9620
|
+
if (_this.props.videoElement) {
|
|
9621
|
+
_this.props.videoElement.currentTime = seconds;
|
|
9604
9622
|
if (!keepPlaying) {
|
|
9605
|
-
|
|
9623
|
+
_this.pause();
|
|
9606
9624
|
}
|
|
9607
9625
|
}
|
|
9608
9626
|
};
|
|
9609
|
-
|
|
9610
|
-
if (
|
|
9611
|
-
|
|
9627
|
+
_this.setVolume = function(volume) {
|
|
9628
|
+
if (_this.props.videoElement) {
|
|
9629
|
+
_this.props.videoElement.volume = Math.max(0, Math.min(1, volume));
|
|
9612
9630
|
}
|
|
9613
9631
|
};
|
|
9614
|
-
|
|
9615
|
-
if (
|
|
9616
|
-
|
|
9632
|
+
_this.mute = function() {
|
|
9633
|
+
if (_this.props.videoElement) {
|
|
9634
|
+
_this.props.videoElement.muted = true;
|
|
9617
9635
|
}
|
|
9618
9636
|
};
|
|
9619
|
-
|
|
9620
|
-
if (
|
|
9621
|
-
|
|
9637
|
+
_this.unmute = function() {
|
|
9638
|
+
if (_this.props.videoElement) {
|
|
9639
|
+
_this.props.videoElement.muted = false;
|
|
9622
9640
|
}
|
|
9623
9641
|
};
|
|
9624
|
-
|
|
9625
|
-
if (
|
|
9626
|
-
|
|
9642
|
+
_this.setPlaybackRate = function(rate) {
|
|
9643
|
+
if (_this.props.videoElement && rate > 0) {
|
|
9644
|
+
_this.props.videoElement.playbackRate = rate;
|
|
9627
9645
|
}
|
|
9628
9646
|
};
|
|
9629
|
-
|
|
9630
|
-
if (
|
|
9631
|
-
return
|
|
9647
|
+
_this.getDuration = function() {
|
|
9648
|
+
if (_this.props.videoElement && isFinite(_this.props.videoElement.duration)) {
|
|
9649
|
+
return _this.props.videoElement.duration;
|
|
9632
9650
|
}
|
|
9633
9651
|
return null;
|
|
9634
9652
|
};
|
|
9635
|
-
|
|
9636
|
-
if (
|
|
9637
|
-
return
|
|
9653
|
+
_this.getCurrentTime = function() {
|
|
9654
|
+
if (_this.props.videoElement && isFinite(_this.props.videoElement.currentTime)) {
|
|
9655
|
+
return _this.props.videoElement.currentTime;
|
|
9638
9656
|
}
|
|
9639
9657
|
return null;
|
|
9640
9658
|
};
|
|
9641
|
-
|
|
9642
|
-
if (
|
|
9643
|
-
return
|
|
9659
|
+
_this.getSecondsLoaded = function() {
|
|
9660
|
+
if (_this.props.videoElement && _this.props.videoElement.buffered.length > 0) {
|
|
9661
|
+
return _this.props.videoElement.buffered.end(_this.props.videoElement.buffered.length - 1);
|
|
9644
9662
|
}
|
|
9645
9663
|
return null;
|
|
9646
9664
|
};
|
|
9647
|
-
|
|
9665
|
+
_this.getInternalPlayer = function() {
|
|
9648
9666
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "player";
|
|
9649
|
-
if (key === "player") return
|
|
9650
|
-
if (key === "video") return
|
|
9651
|
-
if (key === "hls" &&
|
|
9667
|
+
if (key === "player") return _this.player;
|
|
9668
|
+
if (key === "video") return _this.props.videoElement;
|
|
9669
|
+
if (key === "hls" && _this.player) return _this.player.hls;
|
|
9652
9670
|
return null;
|
|
9653
9671
|
};
|
|
9654
9672
|
return _this;
|
|
@@ -9698,49 +9716,49 @@ var FilePlayer = /*#__PURE__*/ function(Component2) {
|
|
|
9698
9716
|
function FilePlayer() {
|
|
9699
9717
|
_class_call_check(this, FilePlayer);
|
|
9700
9718
|
var _this;
|
|
9701
|
-
var _this1
|
|
9702
|
-
_this = _call_super(this, FilePlayer,
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9719
|
+
var _this1;
|
|
9720
|
+
_this = _call_super(this, FilePlayer, arguments), _this1 = _this;
|
|
9721
|
+
_this.mounted = false;
|
|
9722
|
+
_this.ready = false;
|
|
9723
|
+
_this.load = function() {
|
|
9706
9724
|
var _this_props_onMount, _this_props;
|
|
9707
|
-
if (!
|
|
9708
|
-
var video =
|
|
9709
|
-
var handleLoadedMetadata = function() {
|
|
9710
|
-
if (
|
|
9725
|
+
if (!_this.props.videoElement || !_this.props.src) return;
|
|
9726
|
+
var video = _this.props.videoElement;
|
|
9727
|
+
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
9728
|
+
if (_this.mounted && !_this.ready) {
|
|
9711
9729
|
var _this_props_onReady, _this_props;
|
|
9712
|
-
|
|
9713
|
-
(_this_props_onReady = (_this_props =
|
|
9730
|
+
_this.ready = true;
|
|
9731
|
+
(_this_props_onReady = (_this_props = _this.props).onReady) === null || _this_props_onReady === void 0 ? void 0 : _this_props_onReady.call(_this_props);
|
|
9714
9732
|
}
|
|
9715
9733
|
};
|
|
9716
|
-
var handlePlay = function() {
|
|
9717
|
-
if (
|
|
9734
|
+
var handlePlay = function handlePlay() {
|
|
9735
|
+
if (_this.mounted) {
|
|
9718
9736
|
var _this_props_onPlay, _this_props;
|
|
9719
|
-
(_this_props_onPlay = (_this_props =
|
|
9737
|
+
(_this_props_onPlay = (_this_props = _this.props).onPlay) === null || _this_props_onPlay === void 0 ? void 0 : _this_props_onPlay.call(_this_props);
|
|
9720
9738
|
}
|
|
9721
9739
|
};
|
|
9722
|
-
var handlePause = function() {
|
|
9723
|
-
if (
|
|
9740
|
+
var handlePause = function handlePause() {
|
|
9741
|
+
if (_this.mounted) {
|
|
9724
9742
|
var _this_props_onPause, _this_props;
|
|
9725
|
-
(_this_props_onPause = (_this_props =
|
|
9743
|
+
(_this_props_onPause = (_this_props = _this.props).onPause) === null || _this_props_onPause === void 0 ? void 0 : _this_props_onPause.call(_this_props);
|
|
9726
9744
|
}
|
|
9727
9745
|
};
|
|
9728
|
-
var handleEnded = function() {
|
|
9729
|
-
if (
|
|
9746
|
+
var handleEnded = function handleEnded() {
|
|
9747
|
+
if (_this.mounted) {
|
|
9730
9748
|
var _this_props_onEnded, _this_props;
|
|
9731
|
-
(_this_props_onEnded = (_this_props =
|
|
9749
|
+
(_this_props_onEnded = (_this_props = _this.props).onEnded) === null || _this_props_onEnded === void 0 ? void 0 : _this_props_onEnded.call(_this_props);
|
|
9732
9750
|
}
|
|
9733
9751
|
};
|
|
9734
|
-
var handleError = function(error) {
|
|
9735
|
-
if (
|
|
9752
|
+
var handleError = function handleError(error) {
|
|
9753
|
+
if (_this.mounted) {
|
|
9736
9754
|
var _this_props_onError, _this_props;
|
|
9737
|
-
(_this_props_onError = (_this_props =
|
|
9755
|
+
(_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
|
|
9738
9756
|
}
|
|
9739
9757
|
};
|
|
9740
|
-
var handleLoadedData = function() {
|
|
9741
|
-
if (
|
|
9758
|
+
var handleLoadedData = function handleLoadedData() {
|
|
9759
|
+
if (_this.mounted) {
|
|
9742
9760
|
var _this_props_onLoaded, _this_props;
|
|
9743
|
-
(_this_props_onLoaded = (_this_props =
|
|
9761
|
+
(_this_props_onLoaded = (_this_props = _this.props).onLoaded) === null || _this_props_onLoaded === void 0 ? void 0 : _this_props_onLoaded.call(_this_props);
|
|
9744
9762
|
}
|
|
9745
9763
|
};
|
|
9746
9764
|
video.addEventListener("loadedmetadata", handleLoadedMetadata);
|
|
@@ -9749,15 +9767,15 @@ var FilePlayer = /*#__PURE__*/ function(Component2) {
|
|
|
9749
9767
|
video.addEventListener("ended", handleEnded);
|
|
9750
9768
|
video.addEventListener("error", handleError);
|
|
9751
9769
|
video.addEventListener("loadeddata", handleLoadedData);
|
|
9752
|
-
video.src =
|
|
9753
|
-
if (
|
|
9754
|
-
if (
|
|
9755
|
-
if (
|
|
9756
|
-
if (
|
|
9757
|
-
if (
|
|
9758
|
-
if (
|
|
9759
|
-
if (
|
|
9760
|
-
(_this_props_onMount = (_this_props =
|
|
9770
|
+
video.src = _this.props.src;
|
|
9771
|
+
if (_this.props.autoplay !== void 0) video.autoplay = _this.props.autoplay;
|
|
9772
|
+
if (_this.props.muted !== void 0) video.muted = _this.props.muted;
|
|
9773
|
+
if (_this.props.loop !== void 0) video.loop = _this.props.loop;
|
|
9774
|
+
if (_this.props.controls !== void 0) video.controls = _this.props.controls;
|
|
9775
|
+
if (_this.props.playsInline !== void 0) video.playsInline = _this.props.playsInline;
|
|
9776
|
+
if (_this.props.preload !== void 0) video.preload = _this.props.preload;
|
|
9777
|
+
if (_this.props.poster !== void 0) video.poster = _this.props.poster;
|
|
9778
|
+
(_this_props_onMount = (_this_props = _this.props).onMount) === null || _this_props_onMount === void 0 ? void 0 : _this_props_onMount.call(_this_props, _this);
|
|
9761
9779
|
return function() {
|
|
9762
9780
|
video.removeEventListener("loadedmetadata", handleLoadedMetadata);
|
|
9763
9781
|
video.removeEventListener("play", handlePlay);
|
|
@@ -9767,90 +9785,90 @@ var FilePlayer = /*#__PURE__*/ function(Component2) {
|
|
|
9767
9785
|
video.removeEventListener("loadeddata", handleLoadedData);
|
|
9768
9786
|
};
|
|
9769
9787
|
};
|
|
9770
|
-
|
|
9771
|
-
if (
|
|
9772
|
-
var video =
|
|
9788
|
+
_this.play = function() {
|
|
9789
|
+
if (_this.props.videoElement) {
|
|
9790
|
+
var video = _this.props.videoElement;
|
|
9773
9791
|
var hasValidSource = video.src || video.currentSrc && video.currentSrc !== "" || video.readyState >= 1;
|
|
9774
9792
|
if (hasValidSource) {
|
|
9775
9793
|
var _video_play;
|
|
9776
9794
|
(_video_play = video.play()) === null || _video_play === void 0 ? void 0 : _video_play.catch(function(error) {
|
|
9777
9795
|
var _this_props_onError, _this_props;
|
|
9778
9796
|
console.error("[FilePlayer] Failed to play:", error);
|
|
9779
|
-
(_this_props_onError = (_this_props =
|
|
9797
|
+
(_this_props_onError = (_this_props = _this.props).onError) === null || _this_props_onError === void 0 ? void 0 : _this_props_onError.call(_this_props, error);
|
|
9780
9798
|
});
|
|
9781
9799
|
} else {
|
|
9782
9800
|
console.warn("[FilePlayer] Cannot play: video has no valid source");
|
|
9783
9801
|
}
|
|
9784
9802
|
}
|
|
9785
9803
|
};
|
|
9786
|
-
|
|
9787
|
-
if (
|
|
9788
|
-
|
|
9804
|
+
_this.pause = function() {
|
|
9805
|
+
if (_this.props.videoElement) {
|
|
9806
|
+
_this.props.videoElement.pause();
|
|
9789
9807
|
}
|
|
9790
9808
|
};
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
if (
|
|
9794
|
-
|
|
9809
|
+
_this.stop = function() {
|
|
9810
|
+
_this.pause();
|
|
9811
|
+
if (_this.props.videoElement) {
|
|
9812
|
+
_this.props.videoElement.currentTime = 0;
|
|
9795
9813
|
}
|
|
9796
9814
|
};
|
|
9797
|
-
|
|
9798
|
-
if (
|
|
9799
|
-
|
|
9815
|
+
_this.seekTo = function(seconds, keepPlaying) {
|
|
9816
|
+
if (_this.props.videoElement) {
|
|
9817
|
+
_this.props.videoElement.currentTime = seconds;
|
|
9800
9818
|
if (!keepPlaying) {
|
|
9801
|
-
|
|
9819
|
+
_this.pause();
|
|
9802
9820
|
}
|
|
9803
9821
|
}
|
|
9804
9822
|
};
|
|
9805
|
-
|
|
9806
|
-
if (
|
|
9807
|
-
|
|
9823
|
+
_this.setVolume = function(volume) {
|
|
9824
|
+
if (_this.props.videoElement) {
|
|
9825
|
+
_this.props.videoElement.volume = Math.max(0, Math.min(1, volume));
|
|
9808
9826
|
}
|
|
9809
9827
|
};
|
|
9810
|
-
|
|
9811
|
-
if (
|
|
9812
|
-
|
|
9828
|
+
_this.mute = function() {
|
|
9829
|
+
if (_this.props.videoElement) {
|
|
9830
|
+
_this.props.videoElement.muted = true;
|
|
9813
9831
|
}
|
|
9814
9832
|
};
|
|
9815
|
-
|
|
9816
|
-
if (
|
|
9817
|
-
|
|
9833
|
+
_this.unmute = function() {
|
|
9834
|
+
if (_this.props.videoElement) {
|
|
9835
|
+
_this.props.videoElement.muted = false;
|
|
9818
9836
|
}
|
|
9819
9837
|
};
|
|
9820
|
-
|
|
9821
|
-
if (
|
|
9822
|
-
|
|
9838
|
+
_this.setPlaybackRate = function(rate) {
|
|
9839
|
+
if (_this.props.videoElement && rate > 0) {
|
|
9840
|
+
_this.props.videoElement.playbackRate = rate;
|
|
9823
9841
|
}
|
|
9824
9842
|
};
|
|
9825
|
-
|
|
9826
|
-
if (
|
|
9827
|
-
|
|
9843
|
+
_this.setLoop = function(loop) {
|
|
9844
|
+
if (_this.props.videoElement) {
|
|
9845
|
+
_this.props.videoElement.loop = loop;
|
|
9828
9846
|
}
|
|
9829
9847
|
};
|
|
9830
|
-
|
|
9831
|
-
if (
|
|
9832
|
-
return
|
|
9848
|
+
_this.getDuration = function() {
|
|
9849
|
+
if (_this.props.videoElement && isFinite(_this.props.videoElement.duration)) {
|
|
9850
|
+
return _this.props.videoElement.duration;
|
|
9833
9851
|
}
|
|
9834
9852
|
return null;
|
|
9835
9853
|
};
|
|
9836
|
-
|
|
9837
|
-
if (
|
|
9838
|
-
return
|
|
9854
|
+
_this.getCurrentTime = function() {
|
|
9855
|
+
if (_this.props.videoElement && isFinite(_this.props.videoElement.currentTime)) {
|
|
9856
|
+
return _this.props.videoElement.currentTime;
|
|
9839
9857
|
}
|
|
9840
9858
|
return null;
|
|
9841
9859
|
};
|
|
9842
|
-
|
|
9843
|
-
if (
|
|
9844
|
-
return
|
|
9860
|
+
_this.getSecondsLoaded = function() {
|
|
9861
|
+
if (_this.props.videoElement && _this.props.videoElement.buffered.length > 0) {
|
|
9862
|
+
return _this.props.videoElement.buffered.end(_this.props.videoElement.buffered.length - 1);
|
|
9845
9863
|
}
|
|
9846
9864
|
return null;
|
|
9847
9865
|
};
|
|
9848
|
-
|
|
9866
|
+
_this.getInternalPlayer = function() {
|
|
9849
9867
|
var key = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "player";
|
|
9850
|
-
if (key === "video") return
|
|
9868
|
+
if (key === "video") return _this.props.videoElement;
|
|
9851
9869
|
return null;
|
|
9852
9870
|
};
|
|
9853
|
-
|
|
9871
|
+
_this.enablePIP = function() {
|
|
9854
9872
|
return _async_to_generator(function() {
|
|
9855
9873
|
var error;
|
|
9856
9874
|
return _ts_generator(this, function(_state) {
|
|
@@ -9893,7 +9911,7 @@ var FilePlayer = /*#__PURE__*/ function(Component2) {
|
|
|
9893
9911
|
});
|
|
9894
9912
|
})();
|
|
9895
9913
|
};
|
|
9896
|
-
|
|
9914
|
+
_this.disablePIP = function() {
|
|
9897
9915
|
return _async_to_generator(function() {
|
|
9898
9916
|
var error;
|
|
9899
9917
|
return _ts_generator(this, function(_state) {
|
|
@@ -9987,7 +10005,7 @@ var players = [
|
|
|
9987
10005
|
key: "file",
|
|
9988
10006
|
name: "File Player",
|
|
9989
10007
|
canPlay: canPlay.file,
|
|
9990
|
-
canEnablePIP: function(url) {
|
|
10008
|
+
canEnablePIP: function canEnablePIP(url) {
|
|
9991
10009
|
return canPlay.file(url) && (document.pictureInPictureEnabled || typeof document.webkitSupportsPresentationMode === "function");
|
|
9992
10010
|
},
|
|
9993
10011
|
lazyPlayer: lazy(function() {
|
|
@@ -10314,7 +10332,7 @@ var SUPPORTED_PROPS = [
|
|
|
10314
10332
|
"onControlClick"
|
|
10315
10333
|
];
|
|
10316
10334
|
var customPlayers = [];
|
|
10317
|
-
var createStormcloudPlayer = function(playerList, fallback) {
|
|
10335
|
+
var createStormcloudPlayer = function createStormcloudPlayer(playerList, fallback) {
|
|
10318
10336
|
var _a;
|
|
10319
10337
|
return _a = /*#__PURE__*/ function(Component4) {
|
|
10320
10338
|
"use strict";
|
|
@@ -10327,10 +10345,10 @@ var createStormcloudPlayer = function(playerList, fallback) {
|
|
|
10327
10345
|
showPreview: false
|
|
10328
10346
|
};
|
|
10329
10347
|
_this.references = {
|
|
10330
|
-
wrapper: function(wrapper) {
|
|
10348
|
+
wrapper: function wrapper(wrapper) {
|
|
10331
10349
|
_this.wrapper = wrapper;
|
|
10332
10350
|
},
|
|
10333
|
-
player: function(player) {
|
|
10351
|
+
player: function player(player) {
|
|
10334
10352
|
_this.player = player;
|
|
10335
10353
|
}
|
|
10336
10354
|
};
|