stormcloud-video-player 0.8.6 → 0.8.8
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 +47 -67
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +2 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +47 -67
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +47 -67
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/players/HlsPlayer.cjs +47 -67
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +47 -67
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +9 -11
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/pal.cjs +2 -1
- package/lib/sdk/pal.cjs.map +1 -1
- package/lib/sdk/pal.d.cts +1 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +47 -67
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -1050,7 +1050,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1050
1050
|
adPlaying = false;
|
|
1051
1051
|
setAdPlayingFlag(false);
|
|
1052
1052
|
contentVideo.muted = true;
|
|
1053
|
-
contentVideo.volume = 0;
|
|
1054
1053
|
if (adContainerEl) {
|
|
1055
1054
|
adContainerEl.style.display = "none";
|
|
1056
1055
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1070,7 +1069,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1070
1069
|
adPlaying = false;
|
|
1071
1070
|
setAdPlayingFlag(false);
|
|
1072
1071
|
contentVideo.muted = true;
|
|
1073
|
-
contentVideo.volume = 0;
|
|
1074
1072
|
if (adContainerEl) {
|
|
1075
1073
|
adContainerEl.style.display = "none";
|
|
1076
1074
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1175,7 +1173,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1175
1173
|
},
|
|
1176
1174
|
play: function play() {
|
|
1177
1175
|
return _async_to_generator(function() {
|
|
1178
|
-
var contentVolume,
|
|
1176
|
+
var contentVolume, mediaFile, isHlsAd;
|
|
1179
1177
|
return _ts_generator(this, function(_state) {
|
|
1180
1178
|
if (!currentAd) {
|
|
1181
1179
|
console.warn("[HlsAdPlayer] Cannot play: No ad loaded (no ads available)");
|
|
@@ -1209,13 +1207,11 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1209
1207
|
}
|
|
1210
1208
|
console.log("[HlsAdPlayer] FORCE MUTING main video");
|
|
1211
1209
|
contentVideo.muted = true;
|
|
1212
|
-
contentVideo.volume = 0;
|
|
1213
1210
|
adPlaying = true;
|
|
1214
1211
|
setAdPlayingFlag(true);
|
|
1215
1212
|
if (adVideoElement) {
|
|
1216
|
-
|
|
1217
|
-
adVideoElement.
|
|
1218
|
-
adVideoElement.muted = false;
|
|
1213
|
+
adVideoElement.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1214
|
+
adVideoElement.muted = originalMutedState;
|
|
1219
1215
|
console.log("[HlsAdPlayer] Set ad video volume to ".concat(adVideoElement.volume, ", muted: ").concat(adVideoElement.muted, ", originalMutedState: ").concat(originalMutedState, ", contentVolume: ").concat(contentVolume));
|
|
1220
1216
|
}
|
|
1221
1217
|
if (adContainerEl) {
|
|
@@ -1323,8 +1319,8 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1323
1319
|
setAdPlayingFlag(false);
|
|
1324
1320
|
previousMutedState = contentVideo.muted;
|
|
1325
1321
|
contentVideo.muted = originalMutedState;
|
|
1326
|
-
contentVideo.volume =
|
|
1327
|
-
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState));
|
|
1322
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1323
|
+
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState, ", volume: ").concat(contentVideo.volume));
|
|
1328
1324
|
if (adContainerEl) {
|
|
1329
1325
|
adContainerEl.style.display = "none";
|
|
1330
1326
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1379,7 +1375,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1379
1375
|
adPlaying = false;
|
|
1380
1376
|
setAdPlayingFlag(false);
|
|
1381
1377
|
contentVideo.muted = originalMutedState;
|
|
1382
|
-
contentVideo.volume =
|
|
1378
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1383
1379
|
if (adHls) {
|
|
1384
1380
|
adHls.destroy();
|
|
1385
1381
|
adHls = void 0;
|
|
@@ -1435,7 +1431,9 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1435
1431
|
},
|
|
1436
1432
|
setAdVolume: function setAdVolume(volume) {
|
|
1437
1433
|
if (adVideoElement && adPlaying) {
|
|
1438
|
-
|
|
1434
|
+
var clamped = Math.max(0, Math.min(1, volume));
|
|
1435
|
+
adVideoElement.volume = clamped;
|
|
1436
|
+
adVideoElement.muted = clamped === 0;
|
|
1439
1437
|
}
|
|
1440
1438
|
},
|
|
1441
1439
|
getAdVolume: function getAdVolume() {
|
|
@@ -1540,7 +1538,7 @@ function createPalNonceManager() {
|
|
|
1540
1538
|
return {
|
|
1541
1539
|
generateNonce: function generateNonce() {
|
|
1542
1540
|
return _async_to_generator(function() {
|
|
1543
|
-
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1541
|
+
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_playerVolume, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1544
1542
|
var _arguments = arguments;
|
|
1545
1543
|
return _ts_generator(this, function(_state) {
|
|
1546
1544
|
switch(_state.label){
|
|
@@ -1565,6 +1563,7 @@ function createPalNonceManager() {
|
|
|
1565
1563
|
request = new goog.pal.NonceRequest();
|
|
1566
1564
|
request.adWillAutoPlay = (_options_adWillAutoPlay = options.adWillAutoPlay) !== null && _options_adWillAutoPlay !== void 0 ? _options_adWillAutoPlay : true;
|
|
1567
1565
|
request.adWillPlayMuted = (_options_adWillPlayMuted = options.adWillPlayMuted) !== null && _options_adWillPlayMuted !== void 0 ? _options_adWillPlayMuted : false;
|
|
1566
|
+
request.playerVolume = (_options_playerVolume = options.playerVolume) !== null && _options_playerVolume !== void 0 ? _options_playerVolume : request.adWillPlayMuted ? 0 : 1;
|
|
1568
1567
|
request.continuousPlayback = (_options_continuousPlayback = options.continuousPlayback) !== null && _options_continuousPlayback !== void 0 ? _options_continuousPlayback : true;
|
|
1569
1568
|
request.descriptionUrl = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1570
1569
|
request.iconsSupported = true;
|
|
@@ -3009,7 +3008,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3009
3008
|
videoWidth: this.video.offsetWidth || this.video.clientWidth || 640,
|
|
3010
3009
|
videoHeight: this.video.offsetHeight || this.video.clientHeight || 480,
|
|
3011
3010
|
adWillAutoPlay: !!this.config.autoplay,
|
|
3012
|
-
adWillPlayMuted:
|
|
3011
|
+
adWillPlayMuted: true,
|
|
3012
|
+
playerVolume: 0,
|
|
3013
3013
|
continuousPlayback: (_this_config_lowLatencyMode = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false
|
|
3014
3014
|
}).catch(function() {});
|
|
3015
3015
|
fetchConsentSignals().then(function(signals) {
|
|
@@ -3475,10 +3475,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3475
3475
|
console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
|
|
3476
3476
|
}
|
|
3477
3477
|
}
|
|
3478
|
-
|
|
3479
|
-
var currentVolume = _this.video.volume;
|
|
3480
|
-
var adVolume = currentMuted ? 0 : currentVolume;
|
|
3481
|
-
_this.adPlayer.setAdVolume(adVolume);
|
|
3478
|
+
_this.adPlayer.setAdVolume(_this.getAdAudioVolume());
|
|
3482
3479
|
if (_this.isShowingPlaceholder) {
|
|
3483
3480
|
if (_this.config.debugAdTiming) {
|
|
3484
3481
|
console.log("[StormcloudVideoPlayer] Hiding placeholder - new ads starting");
|
|
@@ -3495,7 +3492,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3495
3492
|
}).catch(function() {});
|
|
3496
3493
|
if (!_this.video.muted) {
|
|
3497
3494
|
_this.video.muted = true;
|
|
3498
|
-
_this.video.volume = 0;
|
|
3499
3495
|
if (_this.config.debugAdTiming) {
|
|
3500
3496
|
console.log("[StormcloudVideoPlayer] Muted video on content_resume (ad ended, gap between ads)");
|
|
3501
3497
|
}
|
|
@@ -3543,7 +3539,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3543
3539
|
try {
|
|
3544
3540
|
this.adPlayer.destroy();
|
|
3545
3541
|
this.video.muted = true;
|
|
3546
|
-
this.video.volume = 0;
|
|
3547
3542
|
} catch (error) {
|
|
3548
3543
|
if (this.config.debugAdTiming) {
|
|
3549
3544
|
console.warn("[StormcloudVideoPlayer] Error destroying old AdController:", error);
|
|
@@ -3602,7 +3597,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3602
3597
|
}
|
|
3603
3598
|
if (!this.video.muted) {
|
|
3604
3599
|
this.video.muted = true;
|
|
3605
|
-
this.video.volume = 0;
|
|
3606
3600
|
if (this.config.debugAdTiming) {
|
|
3607
3601
|
console.log("[StormcloudVideoPlayer] Muted video when showing placeholder");
|
|
3608
3602
|
}
|
|
@@ -4224,7 +4218,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4224
4218
|
if (marker.type === "end") {
|
|
4225
4219
|
if (!this.video.muted) {
|
|
4226
4220
|
this.video.muted = true;
|
|
4227
|
-
this.video.volume = 0;
|
|
4228
4221
|
if (this.config.debugAdTiming) {
|
|
4229
4222
|
console.log("[StormcloudVideoPlayer] Muted video on SCTE end marker");
|
|
4230
4223
|
}
|
|
@@ -4262,13 +4255,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4262
4255
|
{
|
|
4263
4256
|
key: "startScte35AdBreak",
|
|
4264
4257
|
value: function startScte35AdBreak(marker, cueKey, durationMs) {
|
|
4265
|
-
if (!this.video.muted) {
|
|
4266
|
-
this.video.muted = true;
|
|
4267
|
-
this.video.volume = 0;
|
|
4268
|
-
if (this.config.debugAdTiming) {
|
|
4269
|
-
console.log("[StormcloudVideoPlayer] Muted video on SCTE start marker");
|
|
4270
|
-
}
|
|
4271
|
-
}
|
|
4272
4258
|
this.inAdBreak = true;
|
|
4273
4259
|
this.activeScte35BreakKey = cueKey !== null && cueKey !== void 0 ? cueKey : this.pendingScte35CueKey;
|
|
4274
4260
|
this.scheduledScte35BreakKey = void 0;
|
|
@@ -5855,7 +5841,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5855
5841
|
key: "handleAdStart",
|
|
5856
5842
|
value: function handleAdStart(_marker) {
|
|
5857
5843
|
return _async_to_generator(function() {
|
|
5858
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, adVolume, adVolume1, error, fallbackPreloaded, adVolume2, fallbackError;
|
|
5844
|
+
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, preservedMuted, preservedVolume, adVolume, adVolume1, error, fallbackPreloaded, preservedMuted1, preservedVolume1, adVolume2, fallbackError;
|
|
5859
5845
|
return _ts_generator(this, function(_state) {
|
|
5860
5846
|
switch(_state.label){
|
|
5861
5847
|
case 0:
|
|
@@ -5895,7 +5881,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5895
5881
|
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
5896
5882
|
if (!this.video.muted) {
|
|
5897
5883
|
this.video.muted = true;
|
|
5898
|
-
this.video.volume = 0;
|
|
5899
5884
|
if (this.config.debugAdTiming) {
|
|
5900
5885
|
console.log("[StormcloudVideoPlayer] Muted video in handleAdStart");
|
|
5901
5886
|
}
|
|
@@ -5965,10 +5950,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5965
5950
|
3,
|
|
5966
5951
|
3
|
|
5967
5952
|
];
|
|
5953
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
5954
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
5968
5955
|
this.adPlayer.destroy();
|
|
5969
5956
|
this.video.muted = true;
|
|
5970
|
-
this.video.volume = 0;
|
|
5971
5957
|
this.adPlayer = preloadedController;
|
|
5958
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
5972
5959
|
this.attachImaEventListeners();
|
|
5973
5960
|
if (this.config.debugAdTiming) {
|
|
5974
5961
|
console.log("[CONTINUOUS-FETCH] \u2705 Using preloaded ad, resuming and starting playback immediately (no request delay!)");
|
|
@@ -6066,11 +6053,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6066
6053
|
,
|
|
6067
6054
|
12
|
|
6068
6055
|
]);
|
|
6056
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
6057
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
6069
6058
|
this.adPlayer.destroy();
|
|
6070
6059
|
this.video.muted = true;
|
|
6071
|
-
this.video.volume = 0;
|
|
6072
6060
|
this.adPlayer = fallbackPreloaded.adController;
|
|
6073
6061
|
this.attachImaEventListeners();
|
|
6062
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
6074
6063
|
this.adPlayer.resume();
|
|
6075
6064
|
this.consecutiveFailures = 0;
|
|
6076
6065
|
this.currentAdIndex++;
|
|
@@ -6368,7 +6357,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6368
6357
|
value: function tryNextAvailableAd() {
|
|
6369
6358
|
var retryCount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
6370
6359
|
return _async_to_generator(function() {
|
|
6371
|
-
var remaining, preloaded,
|
|
6360
|
+
var remaining, preloaded, preservedMuted, preservedVolume, error, nextAdUrl, error1, errorMessage, maxRetries;
|
|
6372
6361
|
return _ts_generator(this, function(_state) {
|
|
6373
6362
|
switch(_state.label){
|
|
6374
6363
|
case 0:
|
|
@@ -6422,11 +6411,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6422
6411
|
,
|
|
6423
6412
|
4
|
|
6424
6413
|
]);
|
|
6414
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
6415
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
6425
6416
|
this.adPlayer.destroy();
|
|
6426
6417
|
this.video.muted = true;
|
|
6427
|
-
this.video.volume = 0;
|
|
6428
6418
|
this.adPlayer = preloaded.adController;
|
|
6429
6419
|
this.attachImaEventListeners();
|
|
6420
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
6430
6421
|
this.adPlayer.resume();
|
|
6431
6422
|
this.currentAdIndex++;
|
|
6432
6423
|
this.totalAdRequestsInBreak++;
|
|
@@ -6440,10 +6431,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6440
6431
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6441
6432
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6442
6433
|
}
|
|
6443
|
-
|
|
6444
|
-
currentVolume = this.video.volume;
|
|
6445
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6446
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
6434
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6447
6435
|
this.consecutiveFailures = 0;
|
|
6448
6436
|
return [
|
|
6449
6437
|
2
|
|
@@ -6490,9 +6478,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6490
6478
|
if (this.config.debugAdTiming) {
|
|
6491
6479
|
console.log("[CONTINUOUS-FETCH] \uD83C\uDFAC Requesting next ad via HLS ad player (".concat(this.currentAdIndex + 1, "/").concat(this.totalAdsInBreak, ", ").concat(this.adRequestQueue.length, " remaining in queue)"));
|
|
6492
6480
|
}
|
|
6493
|
-
currentMuted1 = this.video.muted;
|
|
6494
|
-
currentVolume1 = this.video.volume;
|
|
6495
|
-
this.adPlayer.updateOriginalMutedState(currentMuted1, currentVolume1);
|
|
6496
6481
|
this.currentAdIndex++;
|
|
6497
6482
|
this.totalAdRequestsInBreak++;
|
|
6498
6483
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6585,7 +6570,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6585
6570
|
key: "showPlaceholderAndWaitForAds",
|
|
6586
6571
|
value: function showPlaceholderAndWaitForAds() {
|
|
6587
6572
|
return _async_to_generator(function() {
|
|
6588
|
-
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl,
|
|
6573
|
+
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl, error, errorMessage;
|
|
6589
6574
|
return _ts_generator(this, function(_state) {
|
|
6590
6575
|
switch(_state.label){
|
|
6591
6576
|
case 0:
|
|
@@ -6681,9 +6666,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6681
6666
|
}
|
|
6682
6667
|
this.isShowingPlaceholder = false;
|
|
6683
6668
|
this.adPlayer.hidePlaceholder();
|
|
6684
|
-
currentMuted = this.video.muted;
|
|
6685
|
-
currentVolume = this.video.volume;
|
|
6686
|
-
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
6687
6669
|
this.currentAdIndex++;
|
|
6688
6670
|
this.totalAdRequestsInBreak++;
|
|
6689
6671
|
this.lastAdRequestTime = Date.now();
|
|
@@ -7133,7 +7115,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7133
7115
|
key: "playSingleAd",
|
|
7134
7116
|
value: function playSingleAd(vastTagUrl) {
|
|
7135
7117
|
return _async_to_generator(function() {
|
|
7136
|
-
var requestToken,
|
|
7118
|
+
var requestToken, playError, preloadedFallback, preservedMuted, preservedVolume, fallbackError, error, errorMessage, preloadedFallback1, preservedMuted1, preservedVolume1, fallbackError1;
|
|
7137
7119
|
return _ts_generator(this, function(_state) {
|
|
7138
7120
|
switch(_state.label){
|
|
7139
7121
|
case 0:
|
|
@@ -7220,10 +7202,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7220
7202
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
7221
7203
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
7222
7204
|
}
|
|
7223
|
-
|
|
7224
|
-
currentVolume = this.video.volume;
|
|
7225
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
7226
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
7205
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7227
7206
|
this.consecutiveFailures = 0;
|
|
7228
7207
|
this.temporaryFailureUrls.delete(vastTagUrl);
|
|
7229
7208
|
return [
|
|
@@ -7252,11 +7231,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7252
7231
|
10
|
|
7253
7232
|
]);
|
|
7254
7233
|
this.clearAdFailsafeTimer();
|
|
7234
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
7235
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
7255
7236
|
this.adPlayer.destroy();
|
|
7256
7237
|
this.video.muted = true;
|
|
7257
|
-
this.video.volume = 0;
|
|
7258
7238
|
this.adPlayer = preloadedFallback.adController;
|
|
7259
7239
|
this.attachImaEventListeners();
|
|
7240
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
7260
7241
|
this.adPlayer.resume();
|
|
7261
7242
|
this.consecutiveFailures = 0;
|
|
7262
7243
|
this.currentAdIndex++;
|
|
@@ -7270,10 +7251,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7270
7251
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
7271
7252
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
7272
7253
|
}
|
|
7273
|
-
|
|
7274
|
-
currentVolume1 = this.video.volume;
|
|
7275
|
-
adVolume1 = currentMuted1 ? 0 : currentVolume1;
|
|
7276
|
-
this.adPlayer.setAdVolume(adVolume1);
|
|
7254
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7277
7255
|
return [
|
|
7278
7256
|
2
|
|
7279
7257
|
];
|
|
@@ -7332,11 +7310,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7332
7310
|
]);
|
|
7333
7311
|
this.clearAdRequestWatchdog();
|
|
7334
7312
|
this.clearAdFailsafeTimer();
|
|
7313
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
7314
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
7335
7315
|
this.adPlayer.destroy();
|
|
7336
7316
|
this.video.muted = true;
|
|
7337
|
-
this.video.volume = 0;
|
|
7338
7317
|
this.adPlayer = preloadedFallback1.adController;
|
|
7339
7318
|
this.attachImaEventListeners();
|
|
7319
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
7340
7320
|
this.adPlayer.resume();
|
|
7341
7321
|
this.consecutiveFailures = 0;
|
|
7342
7322
|
this.currentAdIndex++;
|
|
@@ -7347,10 +7327,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7347
7327
|
];
|
|
7348
7328
|
case 14:
|
|
7349
7329
|
_state.sent();
|
|
7350
|
-
|
|
7351
|
-
currentVolume2 = this.video.volume;
|
|
7352
|
-
adVolume2 = currentMuted2 ? 0 : currentVolume2;
|
|
7353
|
-
this.adPlayer.setAdVolume(adVolume2);
|
|
7330
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7354
7331
|
return [
|
|
7355
7332
|
2
|
|
7356
7333
|
];
|
|
@@ -7652,10 +7629,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7652
7629
|
key: "toggleMute",
|
|
7653
7630
|
value: function toggleMute() {
|
|
7654
7631
|
if (this.adPlayer.isAdPlaying()) {
|
|
7655
|
-
var
|
|
7656
|
-
var
|
|
7632
|
+
var newMutedState = !this.adPlayer.getOriginalMutedState();
|
|
7633
|
+
var restoreVolume = this.adPlayer.getOriginalVolume() || 1;
|
|
7657
7634
|
this.adPlayer.updateOriginalMutedState(newMutedState, this.video.volume);
|
|
7658
|
-
this.adPlayer.setAdVolume(newMutedState ? 0 :
|
|
7635
|
+
this.adPlayer.setAdVolume(newMutedState ? 0 : restoreVolume);
|
|
7659
7636
|
if (this.config.debugAdTiming) {
|
|
7660
7637
|
console.log("[StormcloudVideoPlayer] Mute toggle during ad - immediately applied:", newMutedState);
|
|
7661
7638
|
}
|
|
@@ -7710,10 +7687,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7710
7687
|
key: "isMuted",
|
|
7711
7688
|
value: function isMuted() {
|
|
7712
7689
|
if (this.adPlayer.isAdPlaying()) {
|
|
7713
|
-
|
|
7714
|
-
console.log("[StormcloudVideoPlayer] isMuted() override during ad playback -> false");
|
|
7715
|
-
}
|
|
7716
|
-
return false;
|
|
7690
|
+
return this.adPlayer.getOriginalMutedState();
|
|
7717
7691
|
}
|
|
7718
7692
|
return this.video.muted;
|
|
7719
7693
|
}
|
|
@@ -7780,6 +7754,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7780
7754
|
return this.video.volume;
|
|
7781
7755
|
}
|
|
7782
7756
|
},
|
|
7757
|
+
{
|
|
7758
|
+
key: "getAdAudioVolume",
|
|
7759
|
+
value: function getAdAudioVolume() {
|
|
7760
|
+
return this.adPlayer.getOriginalMutedState() ? 0 : this.adPlayer.getOriginalVolume();
|
|
7761
|
+
}
|
|
7762
|
+
},
|
|
7783
7763
|
{
|
|
7784
7764
|
key: "isFullscreen",
|
|
7785
7765
|
value: function isFullscreen() {
|