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
|
@@ -852,7 +852,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
852
852
|
adPlaying = false;
|
|
853
853
|
setAdPlayingFlag(false);
|
|
854
854
|
contentVideo.muted = true;
|
|
855
|
-
contentVideo.volume = 0;
|
|
856
855
|
if (adContainerEl) {
|
|
857
856
|
adContainerEl.style.display = "none";
|
|
858
857
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -872,7 +871,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
872
871
|
adPlaying = false;
|
|
873
872
|
setAdPlayingFlag(false);
|
|
874
873
|
contentVideo.muted = true;
|
|
875
|
-
contentVideo.volume = 0;
|
|
876
874
|
if (adContainerEl) {
|
|
877
875
|
adContainerEl.style.display = "none";
|
|
878
876
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -977,7 +975,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
977
975
|
},
|
|
978
976
|
play: function play() {
|
|
979
977
|
return _async_to_generator(function() {
|
|
980
|
-
var contentVolume,
|
|
978
|
+
var contentVolume, mediaFile, isHlsAd;
|
|
981
979
|
return _ts_generator(this, function(_state) {
|
|
982
980
|
if (!currentAd) {
|
|
983
981
|
console.warn("[HlsAdPlayer] Cannot play: No ad loaded (no ads available)");
|
|
@@ -1011,13 +1009,11 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1011
1009
|
}
|
|
1012
1010
|
console.log("[HlsAdPlayer] FORCE MUTING main video");
|
|
1013
1011
|
contentVideo.muted = true;
|
|
1014
|
-
contentVideo.volume = 0;
|
|
1015
1012
|
adPlaying = true;
|
|
1016
1013
|
setAdPlayingFlag(true);
|
|
1017
1014
|
if (adVideoElement) {
|
|
1018
|
-
|
|
1019
|
-
adVideoElement.
|
|
1020
|
-
adVideoElement.muted = false;
|
|
1015
|
+
adVideoElement.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1016
|
+
adVideoElement.muted = originalMutedState;
|
|
1021
1017
|
console.log("[HlsAdPlayer] Set ad video volume to ".concat(adVideoElement.volume, ", muted: ").concat(adVideoElement.muted, ", originalMutedState: ").concat(originalMutedState, ", contentVolume: ").concat(contentVolume));
|
|
1022
1018
|
}
|
|
1023
1019
|
if (adContainerEl) {
|
|
@@ -1125,8 +1121,8 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1125
1121
|
setAdPlayingFlag(false);
|
|
1126
1122
|
previousMutedState = contentVideo.muted;
|
|
1127
1123
|
contentVideo.muted = originalMutedState;
|
|
1128
|
-
contentVideo.volume =
|
|
1129
|
-
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState));
|
|
1124
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1125
|
+
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState, ", volume: ").concat(contentVideo.volume));
|
|
1130
1126
|
if (adContainerEl) {
|
|
1131
1127
|
adContainerEl.style.display = "none";
|
|
1132
1128
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1181,7 +1177,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1181
1177
|
adPlaying = false;
|
|
1182
1178
|
setAdPlayingFlag(false);
|
|
1183
1179
|
contentVideo.muted = originalMutedState;
|
|
1184
|
-
contentVideo.volume =
|
|
1180
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1185
1181
|
if (adHls) {
|
|
1186
1182
|
adHls.destroy();
|
|
1187
1183
|
adHls = void 0;
|
|
@@ -1237,7 +1233,9 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1237
1233
|
},
|
|
1238
1234
|
setAdVolume: function setAdVolume(volume) {
|
|
1239
1235
|
if (adVideoElement && adPlaying) {
|
|
1240
|
-
|
|
1236
|
+
var clamped = Math.max(0, Math.min(1, volume));
|
|
1237
|
+
adVideoElement.volume = clamped;
|
|
1238
|
+
adVideoElement.muted = clamped === 0;
|
|
1241
1239
|
}
|
|
1242
1240
|
},
|
|
1243
1241
|
getAdVolume: function getAdVolume() {
|
|
@@ -1342,7 +1340,7 @@ function createPalNonceManager() {
|
|
|
1342
1340
|
return {
|
|
1343
1341
|
generateNonce: function generateNonce() {
|
|
1344
1342
|
return _async_to_generator(function() {
|
|
1345
|
-
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1343
|
+
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_playerVolume, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1346
1344
|
var _arguments = arguments;
|
|
1347
1345
|
return _ts_generator(this, function(_state) {
|
|
1348
1346
|
switch(_state.label){
|
|
@@ -1367,6 +1365,7 @@ function createPalNonceManager() {
|
|
|
1367
1365
|
request = new goog.pal.NonceRequest();
|
|
1368
1366
|
request.adWillAutoPlay = (_options_adWillAutoPlay = options.adWillAutoPlay) !== null && _options_adWillAutoPlay !== void 0 ? _options_adWillAutoPlay : true;
|
|
1369
1367
|
request.adWillPlayMuted = (_options_adWillPlayMuted = options.adWillPlayMuted) !== null && _options_adWillPlayMuted !== void 0 ? _options_adWillPlayMuted : false;
|
|
1368
|
+
request.playerVolume = (_options_playerVolume = options.playerVolume) !== null && _options_playerVolume !== void 0 ? _options_playerVolume : request.adWillPlayMuted ? 0 : 1;
|
|
1370
1369
|
request.continuousPlayback = (_options_continuousPlayback = options.continuousPlayback) !== null && _options_continuousPlayback !== void 0 ? _options_continuousPlayback : true;
|
|
1371
1370
|
request.descriptionUrl = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1372
1371
|
request.iconsSupported = true;
|
|
@@ -2764,7 +2763,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2764
2763
|
videoWidth: this.video.offsetWidth || this.video.clientWidth || 640,
|
|
2765
2764
|
videoHeight: this.video.offsetHeight || this.video.clientHeight || 480,
|
|
2766
2765
|
adWillAutoPlay: !!this.config.autoplay,
|
|
2767
|
-
adWillPlayMuted:
|
|
2766
|
+
adWillPlayMuted: true,
|
|
2767
|
+
playerVolume: 0,
|
|
2768
2768
|
continuousPlayback: (_this_config_lowLatencyMode = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false
|
|
2769
2769
|
}).catch(function() {});
|
|
2770
2770
|
fetchConsentSignals().then(function(signals) {
|
|
@@ -3230,10 +3230,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3230
3230
|
console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
|
|
3231
3231
|
}
|
|
3232
3232
|
}
|
|
3233
|
-
|
|
3234
|
-
var currentVolume = _this.video.volume;
|
|
3235
|
-
var adVolume = currentMuted ? 0 : currentVolume;
|
|
3236
|
-
_this.adPlayer.setAdVolume(adVolume);
|
|
3233
|
+
_this.adPlayer.setAdVolume(_this.getAdAudioVolume());
|
|
3237
3234
|
if (_this.isShowingPlaceholder) {
|
|
3238
3235
|
if (_this.config.debugAdTiming) {
|
|
3239
3236
|
console.log("[StormcloudVideoPlayer] Hiding placeholder - new ads starting");
|
|
@@ -3250,7 +3247,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3250
3247
|
}).catch(function() {});
|
|
3251
3248
|
if (!_this.video.muted) {
|
|
3252
3249
|
_this.video.muted = true;
|
|
3253
|
-
_this.video.volume = 0;
|
|
3254
3250
|
if (_this.config.debugAdTiming) {
|
|
3255
3251
|
console.log("[StormcloudVideoPlayer] Muted video on content_resume (ad ended, gap between ads)");
|
|
3256
3252
|
}
|
|
@@ -3298,7 +3294,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3298
3294
|
try {
|
|
3299
3295
|
this.adPlayer.destroy();
|
|
3300
3296
|
this.video.muted = true;
|
|
3301
|
-
this.video.volume = 0;
|
|
3302
3297
|
} catch (error) {
|
|
3303
3298
|
if (this.config.debugAdTiming) {
|
|
3304
3299
|
console.warn("[StormcloudVideoPlayer] Error destroying old AdController:", error);
|
|
@@ -3357,7 +3352,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3357
3352
|
}
|
|
3358
3353
|
if (!this.video.muted) {
|
|
3359
3354
|
this.video.muted = true;
|
|
3360
|
-
this.video.volume = 0;
|
|
3361
3355
|
if (this.config.debugAdTiming) {
|
|
3362
3356
|
console.log("[StormcloudVideoPlayer] Muted video when showing placeholder");
|
|
3363
3357
|
}
|
|
@@ -3979,7 +3973,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3979
3973
|
if (marker.type === "end") {
|
|
3980
3974
|
if (!this.video.muted) {
|
|
3981
3975
|
this.video.muted = true;
|
|
3982
|
-
this.video.volume = 0;
|
|
3983
3976
|
if (this.config.debugAdTiming) {
|
|
3984
3977
|
console.log("[StormcloudVideoPlayer] Muted video on SCTE end marker");
|
|
3985
3978
|
}
|
|
@@ -4017,13 +4010,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4017
4010
|
{
|
|
4018
4011
|
key: "startScte35AdBreak",
|
|
4019
4012
|
value: function startScte35AdBreak(marker, cueKey, durationMs) {
|
|
4020
|
-
if (!this.video.muted) {
|
|
4021
|
-
this.video.muted = true;
|
|
4022
|
-
this.video.volume = 0;
|
|
4023
|
-
if (this.config.debugAdTiming) {
|
|
4024
|
-
console.log("[StormcloudVideoPlayer] Muted video on SCTE start marker");
|
|
4025
|
-
}
|
|
4026
|
-
}
|
|
4027
4013
|
this.inAdBreak = true;
|
|
4028
4014
|
this.activeScte35BreakKey = cueKey !== null && cueKey !== void 0 ? cueKey : this.pendingScte35CueKey;
|
|
4029
4015
|
this.scheduledScte35BreakKey = void 0;
|
|
@@ -5610,7 +5596,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5610
5596
|
key: "handleAdStart",
|
|
5611
5597
|
value: function handleAdStart(_marker) {
|
|
5612
5598
|
return _async_to_generator(function() {
|
|
5613
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, adVolume, adVolume1, error, fallbackPreloaded, adVolume2, fallbackError;
|
|
5599
|
+
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, preservedMuted, preservedVolume, adVolume, adVolume1, error, fallbackPreloaded, preservedMuted1, preservedVolume1, adVolume2, fallbackError;
|
|
5614
5600
|
return _ts_generator(this, function(_state) {
|
|
5615
5601
|
switch(_state.label){
|
|
5616
5602
|
case 0:
|
|
@@ -5650,7 +5636,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5650
5636
|
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
5651
5637
|
if (!this.video.muted) {
|
|
5652
5638
|
this.video.muted = true;
|
|
5653
|
-
this.video.volume = 0;
|
|
5654
5639
|
if (this.config.debugAdTiming) {
|
|
5655
5640
|
console.log("[StormcloudVideoPlayer] Muted video in handleAdStart");
|
|
5656
5641
|
}
|
|
@@ -5720,10 +5705,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5720
5705
|
3,
|
|
5721
5706
|
3
|
|
5722
5707
|
];
|
|
5708
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
5709
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
5723
5710
|
this.adPlayer.destroy();
|
|
5724
5711
|
this.video.muted = true;
|
|
5725
|
-
this.video.volume = 0;
|
|
5726
5712
|
this.adPlayer = preloadedController;
|
|
5713
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
5727
5714
|
this.attachImaEventListeners();
|
|
5728
5715
|
if (this.config.debugAdTiming) {
|
|
5729
5716
|
console.log("[CONTINUOUS-FETCH] \u2705 Using preloaded ad, resuming and starting playback immediately (no request delay!)");
|
|
@@ -5821,11 +5808,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5821
5808
|
,
|
|
5822
5809
|
12
|
|
5823
5810
|
]);
|
|
5811
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
5812
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
5824
5813
|
this.adPlayer.destroy();
|
|
5825
5814
|
this.video.muted = true;
|
|
5826
|
-
this.video.volume = 0;
|
|
5827
5815
|
this.adPlayer = fallbackPreloaded.adController;
|
|
5828
5816
|
this.attachImaEventListeners();
|
|
5817
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
5829
5818
|
this.adPlayer.resume();
|
|
5830
5819
|
this.consecutiveFailures = 0;
|
|
5831
5820
|
this.currentAdIndex++;
|
|
@@ -6123,7 +6112,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6123
6112
|
value: function tryNextAvailableAd() {
|
|
6124
6113
|
var retryCount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
6125
6114
|
return _async_to_generator(function() {
|
|
6126
|
-
var remaining, preloaded,
|
|
6115
|
+
var remaining, preloaded, preservedMuted, preservedVolume, error, nextAdUrl, error1, errorMessage, maxRetries;
|
|
6127
6116
|
return _ts_generator(this, function(_state) {
|
|
6128
6117
|
switch(_state.label){
|
|
6129
6118
|
case 0:
|
|
@@ -6177,11 +6166,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6177
6166
|
,
|
|
6178
6167
|
4
|
|
6179
6168
|
]);
|
|
6169
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
6170
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
6180
6171
|
this.adPlayer.destroy();
|
|
6181
6172
|
this.video.muted = true;
|
|
6182
|
-
this.video.volume = 0;
|
|
6183
6173
|
this.adPlayer = preloaded.adController;
|
|
6184
6174
|
this.attachImaEventListeners();
|
|
6175
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
6185
6176
|
this.adPlayer.resume();
|
|
6186
6177
|
this.currentAdIndex++;
|
|
6187
6178
|
this.totalAdRequestsInBreak++;
|
|
@@ -6195,10 +6186,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6195
6186
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6196
6187
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6197
6188
|
}
|
|
6198
|
-
|
|
6199
|
-
currentVolume = this.video.volume;
|
|
6200
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6201
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
6189
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6202
6190
|
this.consecutiveFailures = 0;
|
|
6203
6191
|
return [
|
|
6204
6192
|
2
|
|
@@ -6245,9 +6233,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6245
6233
|
if (this.config.debugAdTiming) {
|
|
6246
6234
|
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)"));
|
|
6247
6235
|
}
|
|
6248
|
-
currentMuted1 = this.video.muted;
|
|
6249
|
-
currentVolume1 = this.video.volume;
|
|
6250
|
-
this.adPlayer.updateOriginalMutedState(currentMuted1, currentVolume1);
|
|
6251
6236
|
this.currentAdIndex++;
|
|
6252
6237
|
this.totalAdRequestsInBreak++;
|
|
6253
6238
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6340,7 +6325,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6340
6325
|
key: "showPlaceholderAndWaitForAds",
|
|
6341
6326
|
value: function showPlaceholderAndWaitForAds() {
|
|
6342
6327
|
return _async_to_generator(function() {
|
|
6343
|
-
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl,
|
|
6328
|
+
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl, error, errorMessage;
|
|
6344
6329
|
return _ts_generator(this, function(_state) {
|
|
6345
6330
|
switch(_state.label){
|
|
6346
6331
|
case 0:
|
|
@@ -6436,9 +6421,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6436
6421
|
}
|
|
6437
6422
|
this.isShowingPlaceholder = false;
|
|
6438
6423
|
this.adPlayer.hidePlaceholder();
|
|
6439
|
-
currentMuted = this.video.muted;
|
|
6440
|
-
currentVolume = this.video.volume;
|
|
6441
|
-
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
6442
6424
|
this.currentAdIndex++;
|
|
6443
6425
|
this.totalAdRequestsInBreak++;
|
|
6444
6426
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6888,7 +6870,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6888
6870
|
key: "playSingleAd",
|
|
6889
6871
|
value: function playSingleAd(vastTagUrl) {
|
|
6890
6872
|
return _async_to_generator(function() {
|
|
6891
|
-
var requestToken,
|
|
6873
|
+
var requestToken, playError, preloadedFallback, preservedMuted, preservedVolume, fallbackError, error, errorMessage, preloadedFallback1, preservedMuted1, preservedVolume1, fallbackError1;
|
|
6892
6874
|
return _ts_generator(this, function(_state) {
|
|
6893
6875
|
switch(_state.label){
|
|
6894
6876
|
case 0:
|
|
@@ -6975,10 +6957,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6975
6957
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6976
6958
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6977
6959
|
}
|
|
6978
|
-
|
|
6979
|
-
currentVolume = this.video.volume;
|
|
6980
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6981
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
6960
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6982
6961
|
this.consecutiveFailures = 0;
|
|
6983
6962
|
this.temporaryFailureUrls.delete(vastTagUrl);
|
|
6984
6963
|
return [
|
|
@@ -7007,11 +6986,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7007
6986
|
10
|
|
7008
6987
|
]);
|
|
7009
6988
|
this.clearAdFailsafeTimer();
|
|
6989
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
6990
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
7010
6991
|
this.adPlayer.destroy();
|
|
7011
6992
|
this.video.muted = true;
|
|
7012
|
-
this.video.volume = 0;
|
|
7013
6993
|
this.adPlayer = preloadedFallback.adController;
|
|
7014
6994
|
this.attachImaEventListeners();
|
|
6995
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
7015
6996
|
this.adPlayer.resume();
|
|
7016
6997
|
this.consecutiveFailures = 0;
|
|
7017
6998
|
this.currentAdIndex++;
|
|
@@ -7025,10 +7006,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7025
7006
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
7026
7007
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
7027
7008
|
}
|
|
7028
|
-
|
|
7029
|
-
currentVolume1 = this.video.volume;
|
|
7030
|
-
adVolume1 = currentMuted1 ? 0 : currentVolume1;
|
|
7031
|
-
this.adPlayer.setAdVolume(adVolume1);
|
|
7009
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7032
7010
|
return [
|
|
7033
7011
|
2
|
|
7034
7012
|
];
|
|
@@ -7087,11 +7065,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7087
7065
|
]);
|
|
7088
7066
|
this.clearAdRequestWatchdog();
|
|
7089
7067
|
this.clearAdFailsafeTimer();
|
|
7068
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
7069
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
7090
7070
|
this.adPlayer.destroy();
|
|
7091
7071
|
this.video.muted = true;
|
|
7092
|
-
this.video.volume = 0;
|
|
7093
7072
|
this.adPlayer = preloadedFallback1.adController;
|
|
7094
7073
|
this.attachImaEventListeners();
|
|
7074
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
7095
7075
|
this.adPlayer.resume();
|
|
7096
7076
|
this.consecutiveFailures = 0;
|
|
7097
7077
|
this.currentAdIndex++;
|
|
@@ -7102,10 +7082,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7102
7082
|
];
|
|
7103
7083
|
case 14:
|
|
7104
7084
|
_state.sent();
|
|
7105
|
-
|
|
7106
|
-
currentVolume2 = this.video.volume;
|
|
7107
|
-
adVolume2 = currentMuted2 ? 0 : currentVolume2;
|
|
7108
|
-
this.adPlayer.setAdVolume(adVolume2);
|
|
7085
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7109
7086
|
return [
|
|
7110
7087
|
2
|
|
7111
7088
|
];
|
|
@@ -7407,10 +7384,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7407
7384
|
key: "toggleMute",
|
|
7408
7385
|
value: function toggleMute() {
|
|
7409
7386
|
if (this.adPlayer.isAdPlaying()) {
|
|
7410
|
-
var
|
|
7411
|
-
var
|
|
7387
|
+
var newMutedState = !this.adPlayer.getOriginalMutedState();
|
|
7388
|
+
var restoreVolume = this.adPlayer.getOriginalVolume() || 1;
|
|
7412
7389
|
this.adPlayer.updateOriginalMutedState(newMutedState, this.video.volume);
|
|
7413
|
-
this.adPlayer.setAdVolume(newMutedState ? 0 :
|
|
7390
|
+
this.adPlayer.setAdVolume(newMutedState ? 0 : restoreVolume);
|
|
7414
7391
|
if (this.config.debugAdTiming) {
|
|
7415
7392
|
console.log("[StormcloudVideoPlayer] Mute toggle during ad - immediately applied:", newMutedState);
|
|
7416
7393
|
}
|
|
@@ -7465,10 +7442,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7465
7442
|
key: "isMuted",
|
|
7466
7443
|
value: function isMuted() {
|
|
7467
7444
|
if (this.adPlayer.isAdPlaying()) {
|
|
7468
|
-
|
|
7469
|
-
console.log("[StormcloudVideoPlayer] isMuted() override during ad playback -> false");
|
|
7470
|
-
}
|
|
7471
|
-
return false;
|
|
7445
|
+
return this.adPlayer.getOriginalMutedState();
|
|
7472
7446
|
}
|
|
7473
7447
|
return this.video.muted;
|
|
7474
7448
|
}
|
|
@@ -7535,6 +7509,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7535
7509
|
return this.video.volume;
|
|
7536
7510
|
}
|
|
7537
7511
|
},
|
|
7512
|
+
{
|
|
7513
|
+
key: "getAdAudioVolume",
|
|
7514
|
+
value: function getAdAudioVolume() {
|
|
7515
|
+
return this.adPlayer.getOriginalMutedState() ? 0 : this.adPlayer.getOriginalVolume();
|
|
7516
|
+
}
|
|
7517
|
+
},
|
|
7538
7518
|
{
|
|
7539
7519
|
key: "isFullscreen",
|
|
7540
7520
|
value: function isFullscreen() {
|