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/players/index.cjs
CHANGED
|
@@ -902,7 +902,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
902
902
|
adPlaying = false;
|
|
903
903
|
setAdPlayingFlag(false);
|
|
904
904
|
contentVideo.muted = true;
|
|
905
|
-
contentVideo.volume = 0;
|
|
906
905
|
if (adContainerEl) {
|
|
907
906
|
adContainerEl.style.display = "none";
|
|
908
907
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -922,7 +921,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
922
921
|
adPlaying = false;
|
|
923
922
|
setAdPlayingFlag(false);
|
|
924
923
|
contentVideo.muted = true;
|
|
925
|
-
contentVideo.volume = 0;
|
|
926
924
|
if (adContainerEl) {
|
|
927
925
|
adContainerEl.style.display = "none";
|
|
928
926
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1027,7 +1025,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1027
1025
|
},
|
|
1028
1026
|
play: function play() {
|
|
1029
1027
|
return _async_to_generator(function() {
|
|
1030
|
-
var contentVolume,
|
|
1028
|
+
var contentVolume, mediaFile, isHlsAd;
|
|
1031
1029
|
return _ts_generator(this, function(_state) {
|
|
1032
1030
|
if (!currentAd) {
|
|
1033
1031
|
console.warn("[HlsAdPlayer] Cannot play: No ad loaded (no ads available)");
|
|
@@ -1061,13 +1059,11 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1061
1059
|
}
|
|
1062
1060
|
console.log("[HlsAdPlayer] FORCE MUTING main video");
|
|
1063
1061
|
contentVideo.muted = true;
|
|
1064
|
-
contentVideo.volume = 0;
|
|
1065
1062
|
adPlaying = true;
|
|
1066
1063
|
setAdPlayingFlag(true);
|
|
1067
1064
|
if (adVideoElement) {
|
|
1068
|
-
|
|
1069
|
-
adVideoElement.
|
|
1070
|
-
adVideoElement.muted = false;
|
|
1065
|
+
adVideoElement.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1066
|
+
adVideoElement.muted = originalMutedState;
|
|
1071
1067
|
console.log("[HlsAdPlayer] Set ad video volume to ".concat(adVideoElement.volume, ", muted: ").concat(adVideoElement.muted, ", originalMutedState: ").concat(originalMutedState, ", contentVolume: ").concat(contentVolume));
|
|
1072
1068
|
}
|
|
1073
1069
|
if (adContainerEl) {
|
|
@@ -1175,8 +1171,8 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1175
1171
|
setAdPlayingFlag(false);
|
|
1176
1172
|
previousMutedState = contentVideo.muted;
|
|
1177
1173
|
contentVideo.muted = originalMutedState;
|
|
1178
|
-
contentVideo.volume =
|
|
1179
|
-
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState));
|
|
1174
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1175
|
+
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState, ", volume: ").concat(contentVideo.volume));
|
|
1180
1176
|
if (adContainerEl) {
|
|
1181
1177
|
adContainerEl.style.display = "none";
|
|
1182
1178
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1231,7 +1227,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1231
1227
|
adPlaying = false;
|
|
1232
1228
|
setAdPlayingFlag(false);
|
|
1233
1229
|
contentVideo.muted = originalMutedState;
|
|
1234
|
-
contentVideo.volume =
|
|
1230
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1235
1231
|
if (adHls) {
|
|
1236
1232
|
adHls.destroy();
|
|
1237
1233
|
adHls = void 0;
|
|
@@ -1287,7 +1283,9 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1287
1283
|
},
|
|
1288
1284
|
setAdVolume: function setAdVolume(volume) {
|
|
1289
1285
|
if (adVideoElement && adPlaying) {
|
|
1290
|
-
|
|
1286
|
+
var clamped = Math.max(0, Math.min(1, volume));
|
|
1287
|
+
adVideoElement.volume = clamped;
|
|
1288
|
+
adVideoElement.muted = clamped === 0;
|
|
1291
1289
|
}
|
|
1292
1290
|
},
|
|
1293
1291
|
getAdVolume: function getAdVolume() {
|
|
@@ -1392,7 +1390,7 @@ function createPalNonceManager() {
|
|
|
1392
1390
|
return {
|
|
1393
1391
|
generateNonce: function generateNonce() {
|
|
1394
1392
|
return _async_to_generator(function() {
|
|
1395
|
-
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1393
|
+
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_playerVolume, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1396
1394
|
var _arguments = arguments;
|
|
1397
1395
|
return _ts_generator(this, function(_state) {
|
|
1398
1396
|
switch(_state.label){
|
|
@@ -1417,6 +1415,7 @@ function createPalNonceManager() {
|
|
|
1417
1415
|
request = new goog.pal.NonceRequest();
|
|
1418
1416
|
request.adWillAutoPlay = (_options_adWillAutoPlay = options.adWillAutoPlay) !== null && _options_adWillAutoPlay !== void 0 ? _options_adWillAutoPlay : true;
|
|
1419
1417
|
request.adWillPlayMuted = (_options_adWillPlayMuted = options.adWillPlayMuted) !== null && _options_adWillPlayMuted !== void 0 ? _options_adWillPlayMuted : false;
|
|
1418
|
+
request.playerVolume = (_options_playerVolume = options.playerVolume) !== null && _options_playerVolume !== void 0 ? _options_playerVolume : request.adWillPlayMuted ? 0 : 1;
|
|
1420
1419
|
request.continuousPlayback = (_options_continuousPlayback = options.continuousPlayback) !== null && _options_continuousPlayback !== void 0 ? _options_continuousPlayback : true;
|
|
1421
1420
|
request.descriptionUrl = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1422
1421
|
request.iconsSupported = true;
|
|
@@ -2814,7 +2813,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2814
2813
|
videoWidth: this.video.offsetWidth || this.video.clientWidth || 640,
|
|
2815
2814
|
videoHeight: this.video.offsetHeight || this.video.clientHeight || 480,
|
|
2816
2815
|
adWillAutoPlay: !!this.config.autoplay,
|
|
2817
|
-
adWillPlayMuted:
|
|
2816
|
+
adWillPlayMuted: true,
|
|
2817
|
+
playerVolume: 0,
|
|
2818
2818
|
continuousPlayback: (_this_config_lowLatencyMode = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false
|
|
2819
2819
|
}).catch(function() {});
|
|
2820
2820
|
fetchConsentSignals().then(function(signals) {
|
|
@@ -3280,10 +3280,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3280
3280
|
console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
|
|
3281
3281
|
}
|
|
3282
3282
|
}
|
|
3283
|
-
|
|
3284
|
-
var currentVolume = _this.video.volume;
|
|
3285
|
-
var adVolume = currentMuted ? 0 : currentVolume;
|
|
3286
|
-
_this.adPlayer.setAdVolume(adVolume);
|
|
3283
|
+
_this.adPlayer.setAdVolume(_this.getAdAudioVolume());
|
|
3287
3284
|
if (_this.isShowingPlaceholder) {
|
|
3288
3285
|
if (_this.config.debugAdTiming) {
|
|
3289
3286
|
console.log("[StormcloudVideoPlayer] Hiding placeholder - new ads starting");
|
|
@@ -3300,7 +3297,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3300
3297
|
}).catch(function() {});
|
|
3301
3298
|
if (!_this.video.muted) {
|
|
3302
3299
|
_this.video.muted = true;
|
|
3303
|
-
_this.video.volume = 0;
|
|
3304
3300
|
if (_this.config.debugAdTiming) {
|
|
3305
3301
|
console.log("[StormcloudVideoPlayer] Muted video on content_resume (ad ended, gap between ads)");
|
|
3306
3302
|
}
|
|
@@ -3348,7 +3344,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3348
3344
|
try {
|
|
3349
3345
|
this.adPlayer.destroy();
|
|
3350
3346
|
this.video.muted = true;
|
|
3351
|
-
this.video.volume = 0;
|
|
3352
3347
|
} catch (error) {
|
|
3353
3348
|
if (this.config.debugAdTiming) {
|
|
3354
3349
|
console.warn("[StormcloudVideoPlayer] Error destroying old AdController:", error);
|
|
@@ -3407,7 +3402,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3407
3402
|
}
|
|
3408
3403
|
if (!this.video.muted) {
|
|
3409
3404
|
this.video.muted = true;
|
|
3410
|
-
this.video.volume = 0;
|
|
3411
3405
|
if (this.config.debugAdTiming) {
|
|
3412
3406
|
console.log("[StormcloudVideoPlayer] Muted video when showing placeholder");
|
|
3413
3407
|
}
|
|
@@ -4029,7 +4023,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4029
4023
|
if (marker.type === "end") {
|
|
4030
4024
|
if (!this.video.muted) {
|
|
4031
4025
|
this.video.muted = true;
|
|
4032
|
-
this.video.volume = 0;
|
|
4033
4026
|
if (this.config.debugAdTiming) {
|
|
4034
4027
|
console.log("[StormcloudVideoPlayer] Muted video on SCTE end marker");
|
|
4035
4028
|
}
|
|
@@ -4067,13 +4060,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4067
4060
|
{
|
|
4068
4061
|
key: "startScte35AdBreak",
|
|
4069
4062
|
value: function startScte35AdBreak(marker, cueKey, durationMs) {
|
|
4070
|
-
if (!this.video.muted) {
|
|
4071
|
-
this.video.muted = true;
|
|
4072
|
-
this.video.volume = 0;
|
|
4073
|
-
if (this.config.debugAdTiming) {
|
|
4074
|
-
console.log("[StormcloudVideoPlayer] Muted video on SCTE start marker");
|
|
4075
|
-
}
|
|
4076
|
-
}
|
|
4077
4063
|
this.inAdBreak = true;
|
|
4078
4064
|
this.activeScte35BreakKey = cueKey !== null && cueKey !== void 0 ? cueKey : this.pendingScte35CueKey;
|
|
4079
4065
|
this.scheduledScte35BreakKey = void 0;
|
|
@@ -5660,7 +5646,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5660
5646
|
key: "handleAdStart",
|
|
5661
5647
|
value: function handleAdStart(_marker) {
|
|
5662
5648
|
return _async_to_generator(function() {
|
|
5663
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, adVolume, adVolume1, error, fallbackPreloaded, adVolume2, fallbackError;
|
|
5649
|
+
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, preservedMuted, preservedVolume, adVolume, adVolume1, error, fallbackPreloaded, preservedMuted1, preservedVolume1, adVolume2, fallbackError;
|
|
5664
5650
|
return _ts_generator(this, function(_state) {
|
|
5665
5651
|
switch(_state.label){
|
|
5666
5652
|
case 0:
|
|
@@ -5700,7 +5686,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5700
5686
|
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
5701
5687
|
if (!this.video.muted) {
|
|
5702
5688
|
this.video.muted = true;
|
|
5703
|
-
this.video.volume = 0;
|
|
5704
5689
|
if (this.config.debugAdTiming) {
|
|
5705
5690
|
console.log("[StormcloudVideoPlayer] Muted video in handleAdStart");
|
|
5706
5691
|
}
|
|
@@ -5770,10 +5755,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5770
5755
|
3,
|
|
5771
5756
|
3
|
|
5772
5757
|
];
|
|
5758
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
5759
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
5773
5760
|
this.adPlayer.destroy();
|
|
5774
5761
|
this.video.muted = true;
|
|
5775
|
-
this.video.volume = 0;
|
|
5776
5762
|
this.adPlayer = preloadedController;
|
|
5763
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
5777
5764
|
this.attachImaEventListeners();
|
|
5778
5765
|
if (this.config.debugAdTiming) {
|
|
5779
5766
|
console.log("[CONTINUOUS-FETCH] \u2705 Using preloaded ad, resuming and starting playback immediately (no request delay!)");
|
|
@@ -5871,11 +5858,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5871
5858
|
,
|
|
5872
5859
|
12
|
|
5873
5860
|
]);
|
|
5861
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
5862
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
5874
5863
|
this.adPlayer.destroy();
|
|
5875
5864
|
this.video.muted = true;
|
|
5876
|
-
this.video.volume = 0;
|
|
5877
5865
|
this.adPlayer = fallbackPreloaded.adController;
|
|
5878
5866
|
this.attachImaEventListeners();
|
|
5867
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
5879
5868
|
this.adPlayer.resume();
|
|
5880
5869
|
this.consecutiveFailures = 0;
|
|
5881
5870
|
this.currentAdIndex++;
|
|
@@ -6173,7 +6162,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6173
6162
|
value: function tryNextAvailableAd() {
|
|
6174
6163
|
var retryCount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
6175
6164
|
return _async_to_generator(function() {
|
|
6176
|
-
var remaining, preloaded,
|
|
6165
|
+
var remaining, preloaded, preservedMuted, preservedVolume, error, nextAdUrl, error1, errorMessage, maxRetries;
|
|
6177
6166
|
return _ts_generator(this, function(_state) {
|
|
6178
6167
|
switch(_state.label){
|
|
6179
6168
|
case 0:
|
|
@@ -6227,11 +6216,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6227
6216
|
,
|
|
6228
6217
|
4
|
|
6229
6218
|
]);
|
|
6219
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
6220
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
6230
6221
|
this.adPlayer.destroy();
|
|
6231
6222
|
this.video.muted = true;
|
|
6232
|
-
this.video.volume = 0;
|
|
6233
6223
|
this.adPlayer = preloaded.adController;
|
|
6234
6224
|
this.attachImaEventListeners();
|
|
6225
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
6235
6226
|
this.adPlayer.resume();
|
|
6236
6227
|
this.currentAdIndex++;
|
|
6237
6228
|
this.totalAdRequestsInBreak++;
|
|
@@ -6245,10 +6236,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6245
6236
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6246
6237
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6247
6238
|
}
|
|
6248
|
-
|
|
6249
|
-
currentVolume = this.video.volume;
|
|
6250
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6251
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
6239
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6252
6240
|
this.consecutiveFailures = 0;
|
|
6253
6241
|
return [
|
|
6254
6242
|
2
|
|
@@ -6295,9 +6283,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6295
6283
|
if (this.config.debugAdTiming) {
|
|
6296
6284
|
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)"));
|
|
6297
6285
|
}
|
|
6298
|
-
currentMuted1 = this.video.muted;
|
|
6299
|
-
currentVolume1 = this.video.volume;
|
|
6300
|
-
this.adPlayer.updateOriginalMutedState(currentMuted1, currentVolume1);
|
|
6301
6286
|
this.currentAdIndex++;
|
|
6302
6287
|
this.totalAdRequestsInBreak++;
|
|
6303
6288
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6390,7 +6375,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6390
6375
|
key: "showPlaceholderAndWaitForAds",
|
|
6391
6376
|
value: function showPlaceholderAndWaitForAds() {
|
|
6392
6377
|
return _async_to_generator(function() {
|
|
6393
|
-
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl,
|
|
6378
|
+
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl, error, errorMessage;
|
|
6394
6379
|
return _ts_generator(this, function(_state) {
|
|
6395
6380
|
switch(_state.label){
|
|
6396
6381
|
case 0:
|
|
@@ -6486,9 +6471,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6486
6471
|
}
|
|
6487
6472
|
this.isShowingPlaceholder = false;
|
|
6488
6473
|
this.adPlayer.hidePlaceholder();
|
|
6489
|
-
currentMuted = this.video.muted;
|
|
6490
|
-
currentVolume = this.video.volume;
|
|
6491
|
-
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
6492
6474
|
this.currentAdIndex++;
|
|
6493
6475
|
this.totalAdRequestsInBreak++;
|
|
6494
6476
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6938,7 +6920,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6938
6920
|
key: "playSingleAd",
|
|
6939
6921
|
value: function playSingleAd(vastTagUrl) {
|
|
6940
6922
|
return _async_to_generator(function() {
|
|
6941
|
-
var requestToken,
|
|
6923
|
+
var requestToken, playError, preloadedFallback, preservedMuted, preservedVolume, fallbackError, error, errorMessage, preloadedFallback1, preservedMuted1, preservedVolume1, fallbackError1;
|
|
6942
6924
|
return _ts_generator(this, function(_state) {
|
|
6943
6925
|
switch(_state.label){
|
|
6944
6926
|
case 0:
|
|
@@ -7025,10 +7007,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7025
7007
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
7026
7008
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
7027
7009
|
}
|
|
7028
|
-
|
|
7029
|
-
currentVolume = this.video.volume;
|
|
7030
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
7031
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
7010
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7032
7011
|
this.consecutiveFailures = 0;
|
|
7033
7012
|
this.temporaryFailureUrls.delete(vastTagUrl);
|
|
7034
7013
|
return [
|
|
@@ -7057,11 +7036,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7057
7036
|
10
|
|
7058
7037
|
]);
|
|
7059
7038
|
this.clearAdFailsafeTimer();
|
|
7039
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
7040
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
7060
7041
|
this.adPlayer.destroy();
|
|
7061
7042
|
this.video.muted = true;
|
|
7062
|
-
this.video.volume = 0;
|
|
7063
7043
|
this.adPlayer = preloadedFallback.adController;
|
|
7064
7044
|
this.attachImaEventListeners();
|
|
7045
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
7065
7046
|
this.adPlayer.resume();
|
|
7066
7047
|
this.consecutiveFailures = 0;
|
|
7067
7048
|
this.currentAdIndex++;
|
|
@@ -7075,10 +7056,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7075
7056
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
7076
7057
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
7077
7058
|
}
|
|
7078
|
-
|
|
7079
|
-
currentVolume1 = this.video.volume;
|
|
7080
|
-
adVolume1 = currentMuted1 ? 0 : currentVolume1;
|
|
7081
|
-
this.adPlayer.setAdVolume(adVolume1);
|
|
7059
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7082
7060
|
return [
|
|
7083
7061
|
2
|
|
7084
7062
|
];
|
|
@@ -7137,11 +7115,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7137
7115
|
]);
|
|
7138
7116
|
this.clearAdRequestWatchdog();
|
|
7139
7117
|
this.clearAdFailsafeTimer();
|
|
7118
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
7119
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
7140
7120
|
this.adPlayer.destroy();
|
|
7141
7121
|
this.video.muted = true;
|
|
7142
|
-
this.video.volume = 0;
|
|
7143
7122
|
this.adPlayer = preloadedFallback1.adController;
|
|
7144
7123
|
this.attachImaEventListeners();
|
|
7124
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
7145
7125
|
this.adPlayer.resume();
|
|
7146
7126
|
this.consecutiveFailures = 0;
|
|
7147
7127
|
this.currentAdIndex++;
|
|
@@ -7152,10 +7132,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7152
7132
|
];
|
|
7153
7133
|
case 14:
|
|
7154
7134
|
_state.sent();
|
|
7155
|
-
|
|
7156
|
-
currentVolume2 = this.video.volume;
|
|
7157
|
-
adVolume2 = currentMuted2 ? 0 : currentVolume2;
|
|
7158
|
-
this.adPlayer.setAdVolume(adVolume2);
|
|
7135
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7159
7136
|
return [
|
|
7160
7137
|
2
|
|
7161
7138
|
];
|
|
@@ -7457,10 +7434,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7457
7434
|
key: "toggleMute",
|
|
7458
7435
|
value: function toggleMute() {
|
|
7459
7436
|
if (this.adPlayer.isAdPlaying()) {
|
|
7460
|
-
var
|
|
7461
|
-
var
|
|
7437
|
+
var newMutedState = !this.adPlayer.getOriginalMutedState();
|
|
7438
|
+
var restoreVolume = this.adPlayer.getOriginalVolume() || 1;
|
|
7462
7439
|
this.adPlayer.updateOriginalMutedState(newMutedState, this.video.volume);
|
|
7463
|
-
this.adPlayer.setAdVolume(newMutedState ? 0 :
|
|
7440
|
+
this.adPlayer.setAdVolume(newMutedState ? 0 : restoreVolume);
|
|
7464
7441
|
if (this.config.debugAdTiming) {
|
|
7465
7442
|
console.log("[StormcloudVideoPlayer] Mute toggle during ad - immediately applied:", newMutedState);
|
|
7466
7443
|
}
|
|
@@ -7515,10 +7492,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7515
7492
|
key: "isMuted",
|
|
7516
7493
|
value: function isMuted() {
|
|
7517
7494
|
if (this.adPlayer.isAdPlaying()) {
|
|
7518
|
-
|
|
7519
|
-
console.log("[StormcloudVideoPlayer] isMuted() override during ad playback -> false");
|
|
7520
|
-
}
|
|
7521
|
-
return false;
|
|
7495
|
+
return this.adPlayer.getOriginalMutedState();
|
|
7522
7496
|
}
|
|
7523
7497
|
return this.video.muted;
|
|
7524
7498
|
}
|
|
@@ -7585,6 +7559,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7585
7559
|
return this.video.volume;
|
|
7586
7560
|
}
|
|
7587
7561
|
},
|
|
7562
|
+
{
|
|
7563
|
+
key: "getAdAudioVolume",
|
|
7564
|
+
value: function getAdAudioVolume() {
|
|
7565
|
+
return this.adPlayer.getOriginalMutedState() ? 0 : this.adPlayer.getOriginalVolume();
|
|
7566
|
+
}
|
|
7567
|
+
},
|
|
7588
7568
|
{
|
|
7589
7569
|
key: "isFullscreen",
|
|
7590
7570
|
value: function isFullscreen() {
|