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
|
@@ -202,6 +202,7 @@ declare class StormcloudVideoPlayer {
|
|
|
202
202
|
setMuted(muted: boolean): void;
|
|
203
203
|
setVolume(volume: number): void;
|
|
204
204
|
getVolume(): number;
|
|
205
|
+
private getAdAudioVolume;
|
|
205
206
|
isFullscreen(): boolean;
|
|
206
207
|
isLive(): boolean;
|
|
207
208
|
get videoElement(): HTMLVideoElement;
|
|
@@ -866,7 +866,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
866
866
|
adPlaying = false;
|
|
867
867
|
setAdPlayingFlag(false);
|
|
868
868
|
contentVideo.muted = true;
|
|
869
|
-
contentVideo.volume = 0;
|
|
870
869
|
if (adContainerEl) {
|
|
871
870
|
adContainerEl.style.display = "none";
|
|
872
871
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -886,7 +885,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
886
885
|
adPlaying = false;
|
|
887
886
|
setAdPlayingFlag(false);
|
|
888
887
|
contentVideo.muted = true;
|
|
889
|
-
contentVideo.volume = 0;
|
|
890
888
|
if (adContainerEl) {
|
|
891
889
|
adContainerEl.style.display = "none";
|
|
892
890
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -991,7 +989,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
991
989
|
},
|
|
992
990
|
play: function play() {
|
|
993
991
|
return _async_to_generator(function() {
|
|
994
|
-
var contentVolume,
|
|
992
|
+
var contentVolume, mediaFile, isHlsAd;
|
|
995
993
|
return _ts_generator(this, function(_state) {
|
|
996
994
|
if (!currentAd) {
|
|
997
995
|
console.warn("[HlsAdPlayer] Cannot play: No ad loaded (no ads available)");
|
|
@@ -1025,13 +1023,11 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1025
1023
|
}
|
|
1026
1024
|
console.log("[HlsAdPlayer] FORCE MUTING main video");
|
|
1027
1025
|
contentVideo.muted = true;
|
|
1028
|
-
contentVideo.volume = 0;
|
|
1029
1026
|
adPlaying = true;
|
|
1030
1027
|
setAdPlayingFlag(true);
|
|
1031
1028
|
if (adVideoElement) {
|
|
1032
|
-
|
|
1033
|
-
adVideoElement.
|
|
1034
|
-
adVideoElement.muted = false;
|
|
1029
|
+
adVideoElement.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1030
|
+
adVideoElement.muted = originalMutedState;
|
|
1035
1031
|
console.log("[HlsAdPlayer] Set ad video volume to ".concat(adVideoElement.volume, ", muted: ").concat(adVideoElement.muted, ", originalMutedState: ").concat(originalMutedState, ", contentVolume: ").concat(contentVolume));
|
|
1036
1032
|
}
|
|
1037
1033
|
if (adContainerEl) {
|
|
@@ -1139,8 +1135,8 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1139
1135
|
setAdPlayingFlag(false);
|
|
1140
1136
|
previousMutedState = contentVideo.muted;
|
|
1141
1137
|
contentVideo.muted = originalMutedState;
|
|
1142
|
-
contentVideo.volume =
|
|
1143
|
-
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState));
|
|
1138
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1139
|
+
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState, ", volume: ").concat(contentVideo.volume));
|
|
1144
1140
|
if (adContainerEl) {
|
|
1145
1141
|
adContainerEl.style.display = "none";
|
|
1146
1142
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1195,7 +1191,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1195
1191
|
adPlaying = false;
|
|
1196
1192
|
setAdPlayingFlag(false);
|
|
1197
1193
|
contentVideo.muted = originalMutedState;
|
|
1198
|
-
contentVideo.volume =
|
|
1194
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1199
1195
|
if (adHls) {
|
|
1200
1196
|
adHls.destroy();
|
|
1201
1197
|
adHls = void 0;
|
|
@@ -1251,7 +1247,9 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1251
1247
|
},
|
|
1252
1248
|
setAdVolume: function setAdVolume(volume) {
|
|
1253
1249
|
if (adVideoElement && adPlaying) {
|
|
1254
|
-
|
|
1250
|
+
var clamped = Math.max(0, Math.min(1, volume));
|
|
1251
|
+
adVideoElement.volume = clamped;
|
|
1252
|
+
adVideoElement.muted = clamped === 0;
|
|
1255
1253
|
}
|
|
1256
1254
|
},
|
|
1257
1255
|
getAdVolume: function getAdVolume() {
|
|
@@ -1356,7 +1354,7 @@ function createPalNonceManager() {
|
|
|
1356
1354
|
return {
|
|
1357
1355
|
generateNonce: function generateNonce() {
|
|
1358
1356
|
return _async_to_generator(function() {
|
|
1359
|
-
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1357
|
+
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_playerVolume, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1360
1358
|
var _arguments = arguments;
|
|
1361
1359
|
return _ts_generator(this, function(_state) {
|
|
1362
1360
|
switch(_state.label){
|
|
@@ -1381,6 +1379,7 @@ function createPalNonceManager() {
|
|
|
1381
1379
|
request = new goog.pal.NonceRequest();
|
|
1382
1380
|
request.adWillAutoPlay = (_options_adWillAutoPlay = options.adWillAutoPlay) !== null && _options_adWillAutoPlay !== void 0 ? _options_adWillAutoPlay : true;
|
|
1383
1381
|
request.adWillPlayMuted = (_options_adWillPlayMuted = options.adWillPlayMuted) !== null && _options_adWillPlayMuted !== void 0 ? _options_adWillPlayMuted : false;
|
|
1382
|
+
request.playerVolume = (_options_playerVolume = options.playerVolume) !== null && _options_playerVolume !== void 0 ? _options_playerVolume : request.adWillPlayMuted ? 0 : 1;
|
|
1384
1383
|
request.continuousPlayback = (_options_continuousPlayback = options.continuousPlayback) !== null && _options_continuousPlayback !== void 0 ? _options_continuousPlayback : true;
|
|
1385
1384
|
request.descriptionUrl = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1386
1385
|
request.iconsSupported = true;
|
|
@@ -2778,7 +2777,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2778
2777
|
videoWidth: this.video.offsetWidth || this.video.clientWidth || 640,
|
|
2779
2778
|
videoHeight: this.video.offsetHeight || this.video.clientHeight || 480,
|
|
2780
2779
|
adWillAutoPlay: !!this.config.autoplay,
|
|
2781
|
-
adWillPlayMuted:
|
|
2780
|
+
adWillPlayMuted: true,
|
|
2781
|
+
playerVolume: 0,
|
|
2782
2782
|
continuousPlayback: (_this_config_lowLatencyMode = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false
|
|
2783
2783
|
}).catch(function() {});
|
|
2784
2784
|
fetchConsentSignals().then(function(signals) {
|
|
@@ -3244,10 +3244,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3244
3244
|
console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
|
|
3245
3245
|
}
|
|
3246
3246
|
}
|
|
3247
|
-
|
|
3248
|
-
var currentVolume = _this.video.volume;
|
|
3249
|
-
var adVolume = currentMuted ? 0 : currentVolume;
|
|
3250
|
-
_this.adPlayer.setAdVolume(adVolume);
|
|
3247
|
+
_this.adPlayer.setAdVolume(_this.getAdAudioVolume());
|
|
3251
3248
|
if (_this.isShowingPlaceholder) {
|
|
3252
3249
|
if (_this.config.debugAdTiming) {
|
|
3253
3250
|
console.log("[StormcloudVideoPlayer] Hiding placeholder - new ads starting");
|
|
@@ -3264,7 +3261,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3264
3261
|
}).catch(function() {});
|
|
3265
3262
|
if (!_this.video.muted) {
|
|
3266
3263
|
_this.video.muted = true;
|
|
3267
|
-
_this.video.volume = 0;
|
|
3268
3264
|
if (_this.config.debugAdTiming) {
|
|
3269
3265
|
console.log("[StormcloudVideoPlayer] Muted video on content_resume (ad ended, gap between ads)");
|
|
3270
3266
|
}
|
|
@@ -3312,7 +3308,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3312
3308
|
try {
|
|
3313
3309
|
this.adPlayer.destroy();
|
|
3314
3310
|
this.video.muted = true;
|
|
3315
|
-
this.video.volume = 0;
|
|
3316
3311
|
} catch (error) {
|
|
3317
3312
|
if (this.config.debugAdTiming) {
|
|
3318
3313
|
console.warn("[StormcloudVideoPlayer] Error destroying old AdController:", error);
|
|
@@ -3371,7 +3366,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3371
3366
|
}
|
|
3372
3367
|
if (!this.video.muted) {
|
|
3373
3368
|
this.video.muted = true;
|
|
3374
|
-
this.video.volume = 0;
|
|
3375
3369
|
if (this.config.debugAdTiming) {
|
|
3376
3370
|
console.log("[StormcloudVideoPlayer] Muted video when showing placeholder");
|
|
3377
3371
|
}
|
|
@@ -3993,7 +3987,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3993
3987
|
if (marker.type === "end") {
|
|
3994
3988
|
if (!this.video.muted) {
|
|
3995
3989
|
this.video.muted = true;
|
|
3996
|
-
this.video.volume = 0;
|
|
3997
3990
|
if (this.config.debugAdTiming) {
|
|
3998
3991
|
console.log("[StormcloudVideoPlayer] Muted video on SCTE end marker");
|
|
3999
3992
|
}
|
|
@@ -4031,13 +4024,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4031
4024
|
{
|
|
4032
4025
|
key: "startScte35AdBreak",
|
|
4033
4026
|
value: function startScte35AdBreak(marker, cueKey, durationMs) {
|
|
4034
|
-
if (!this.video.muted) {
|
|
4035
|
-
this.video.muted = true;
|
|
4036
|
-
this.video.volume = 0;
|
|
4037
|
-
if (this.config.debugAdTiming) {
|
|
4038
|
-
console.log("[StormcloudVideoPlayer] Muted video on SCTE start marker");
|
|
4039
|
-
}
|
|
4040
|
-
}
|
|
4041
4027
|
this.inAdBreak = true;
|
|
4042
4028
|
this.activeScte35BreakKey = cueKey !== null && cueKey !== void 0 ? cueKey : this.pendingScte35CueKey;
|
|
4043
4029
|
this.scheduledScte35BreakKey = void 0;
|
|
@@ -5624,7 +5610,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5624
5610
|
key: "handleAdStart",
|
|
5625
5611
|
value: function handleAdStart(_marker) {
|
|
5626
5612
|
return _async_to_generator(function() {
|
|
5627
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, adVolume, adVolume1, error, fallbackPreloaded, adVolume2, fallbackError;
|
|
5613
|
+
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, preservedMuted, preservedVolume, adVolume, adVolume1, error, fallbackPreloaded, preservedMuted1, preservedVolume1, adVolume2, fallbackError;
|
|
5628
5614
|
return _ts_generator(this, function(_state) {
|
|
5629
5615
|
switch(_state.label){
|
|
5630
5616
|
case 0:
|
|
@@ -5664,7 +5650,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5664
5650
|
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
5665
5651
|
if (!this.video.muted) {
|
|
5666
5652
|
this.video.muted = true;
|
|
5667
|
-
this.video.volume = 0;
|
|
5668
5653
|
if (this.config.debugAdTiming) {
|
|
5669
5654
|
console.log("[StormcloudVideoPlayer] Muted video in handleAdStart");
|
|
5670
5655
|
}
|
|
@@ -5734,10 +5719,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5734
5719
|
3,
|
|
5735
5720
|
3
|
|
5736
5721
|
];
|
|
5722
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
5723
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
5737
5724
|
this.adPlayer.destroy();
|
|
5738
5725
|
this.video.muted = true;
|
|
5739
|
-
this.video.volume = 0;
|
|
5740
5726
|
this.adPlayer = preloadedController;
|
|
5727
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
5741
5728
|
this.attachImaEventListeners();
|
|
5742
5729
|
if (this.config.debugAdTiming) {
|
|
5743
5730
|
console.log("[CONTINUOUS-FETCH] \u2705 Using preloaded ad, resuming and starting playback immediately (no request delay!)");
|
|
@@ -5835,11 +5822,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5835
5822
|
,
|
|
5836
5823
|
12
|
|
5837
5824
|
]);
|
|
5825
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
5826
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
5838
5827
|
this.adPlayer.destroy();
|
|
5839
5828
|
this.video.muted = true;
|
|
5840
|
-
this.video.volume = 0;
|
|
5841
5829
|
this.adPlayer = fallbackPreloaded.adController;
|
|
5842
5830
|
this.attachImaEventListeners();
|
|
5831
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
5843
5832
|
this.adPlayer.resume();
|
|
5844
5833
|
this.consecutiveFailures = 0;
|
|
5845
5834
|
this.currentAdIndex++;
|
|
@@ -6137,7 +6126,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6137
6126
|
value: function tryNextAvailableAd() {
|
|
6138
6127
|
var retryCount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
6139
6128
|
return _async_to_generator(function() {
|
|
6140
|
-
var remaining, preloaded,
|
|
6129
|
+
var remaining, preloaded, preservedMuted, preservedVolume, error, nextAdUrl, error1, errorMessage, maxRetries;
|
|
6141
6130
|
return _ts_generator(this, function(_state) {
|
|
6142
6131
|
switch(_state.label){
|
|
6143
6132
|
case 0:
|
|
@@ -6191,11 +6180,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6191
6180
|
,
|
|
6192
6181
|
4
|
|
6193
6182
|
]);
|
|
6183
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
6184
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
6194
6185
|
this.adPlayer.destroy();
|
|
6195
6186
|
this.video.muted = true;
|
|
6196
|
-
this.video.volume = 0;
|
|
6197
6187
|
this.adPlayer = preloaded.adController;
|
|
6198
6188
|
this.attachImaEventListeners();
|
|
6189
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
6199
6190
|
this.adPlayer.resume();
|
|
6200
6191
|
this.currentAdIndex++;
|
|
6201
6192
|
this.totalAdRequestsInBreak++;
|
|
@@ -6209,10 +6200,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6209
6200
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6210
6201
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6211
6202
|
}
|
|
6212
|
-
|
|
6213
|
-
currentVolume = this.video.volume;
|
|
6214
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6215
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
6203
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6216
6204
|
this.consecutiveFailures = 0;
|
|
6217
6205
|
return [
|
|
6218
6206
|
2
|
|
@@ -6259,9 +6247,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6259
6247
|
if (this.config.debugAdTiming) {
|
|
6260
6248
|
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)"));
|
|
6261
6249
|
}
|
|
6262
|
-
currentMuted1 = this.video.muted;
|
|
6263
|
-
currentVolume1 = this.video.volume;
|
|
6264
|
-
this.adPlayer.updateOriginalMutedState(currentMuted1, currentVolume1);
|
|
6265
6250
|
this.currentAdIndex++;
|
|
6266
6251
|
this.totalAdRequestsInBreak++;
|
|
6267
6252
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6354,7 +6339,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6354
6339
|
key: "showPlaceholderAndWaitForAds",
|
|
6355
6340
|
value: function showPlaceholderAndWaitForAds() {
|
|
6356
6341
|
return _async_to_generator(function() {
|
|
6357
|
-
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl,
|
|
6342
|
+
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl, error, errorMessage;
|
|
6358
6343
|
return _ts_generator(this, function(_state) {
|
|
6359
6344
|
switch(_state.label){
|
|
6360
6345
|
case 0:
|
|
@@ -6450,9 +6435,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6450
6435
|
}
|
|
6451
6436
|
this.isShowingPlaceholder = false;
|
|
6452
6437
|
this.adPlayer.hidePlaceholder();
|
|
6453
|
-
currentMuted = this.video.muted;
|
|
6454
|
-
currentVolume = this.video.volume;
|
|
6455
|
-
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
6456
6438
|
this.currentAdIndex++;
|
|
6457
6439
|
this.totalAdRequestsInBreak++;
|
|
6458
6440
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6902,7 +6884,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6902
6884
|
key: "playSingleAd",
|
|
6903
6885
|
value: function playSingleAd(vastTagUrl) {
|
|
6904
6886
|
return _async_to_generator(function() {
|
|
6905
|
-
var requestToken,
|
|
6887
|
+
var requestToken, playError, preloadedFallback, preservedMuted, preservedVolume, fallbackError, error, errorMessage, preloadedFallback1, preservedMuted1, preservedVolume1, fallbackError1;
|
|
6906
6888
|
return _ts_generator(this, function(_state) {
|
|
6907
6889
|
switch(_state.label){
|
|
6908
6890
|
case 0:
|
|
@@ -6989,10 +6971,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6989
6971
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6990
6972
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6991
6973
|
}
|
|
6992
|
-
|
|
6993
|
-
currentVolume = this.video.volume;
|
|
6994
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6995
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
6974
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6996
6975
|
this.consecutiveFailures = 0;
|
|
6997
6976
|
this.temporaryFailureUrls.delete(vastTagUrl);
|
|
6998
6977
|
return [
|
|
@@ -7021,11 +7000,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7021
7000
|
10
|
|
7022
7001
|
]);
|
|
7023
7002
|
this.clearAdFailsafeTimer();
|
|
7003
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
7004
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
7024
7005
|
this.adPlayer.destroy();
|
|
7025
7006
|
this.video.muted = true;
|
|
7026
|
-
this.video.volume = 0;
|
|
7027
7007
|
this.adPlayer = preloadedFallback.adController;
|
|
7028
7008
|
this.attachImaEventListeners();
|
|
7009
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
7029
7010
|
this.adPlayer.resume();
|
|
7030
7011
|
this.consecutiveFailures = 0;
|
|
7031
7012
|
this.currentAdIndex++;
|
|
@@ -7039,10 +7020,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7039
7020
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
7040
7021
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
7041
7022
|
}
|
|
7042
|
-
|
|
7043
|
-
currentVolume1 = this.video.volume;
|
|
7044
|
-
adVolume1 = currentMuted1 ? 0 : currentVolume1;
|
|
7045
|
-
this.adPlayer.setAdVolume(adVolume1);
|
|
7023
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7046
7024
|
return [
|
|
7047
7025
|
2
|
|
7048
7026
|
];
|
|
@@ -7101,11 +7079,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7101
7079
|
]);
|
|
7102
7080
|
this.clearAdRequestWatchdog();
|
|
7103
7081
|
this.clearAdFailsafeTimer();
|
|
7082
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
7083
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
7104
7084
|
this.adPlayer.destroy();
|
|
7105
7085
|
this.video.muted = true;
|
|
7106
|
-
this.video.volume = 0;
|
|
7107
7086
|
this.adPlayer = preloadedFallback1.adController;
|
|
7108
7087
|
this.attachImaEventListeners();
|
|
7088
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
7109
7089
|
this.adPlayer.resume();
|
|
7110
7090
|
this.consecutiveFailures = 0;
|
|
7111
7091
|
this.currentAdIndex++;
|
|
@@ -7116,10 +7096,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7116
7096
|
];
|
|
7117
7097
|
case 14:
|
|
7118
7098
|
_state.sent();
|
|
7119
|
-
|
|
7120
|
-
currentVolume2 = this.video.volume;
|
|
7121
|
-
adVolume2 = currentMuted2 ? 0 : currentVolume2;
|
|
7122
|
-
this.adPlayer.setAdVolume(adVolume2);
|
|
7099
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7123
7100
|
return [
|
|
7124
7101
|
2
|
|
7125
7102
|
];
|
|
@@ -7421,10 +7398,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7421
7398
|
key: "toggleMute",
|
|
7422
7399
|
value: function toggleMute() {
|
|
7423
7400
|
if (this.adPlayer.isAdPlaying()) {
|
|
7424
|
-
var
|
|
7425
|
-
var
|
|
7401
|
+
var newMutedState = !this.adPlayer.getOriginalMutedState();
|
|
7402
|
+
var restoreVolume = this.adPlayer.getOriginalVolume() || 1;
|
|
7426
7403
|
this.adPlayer.updateOriginalMutedState(newMutedState, this.video.volume);
|
|
7427
|
-
this.adPlayer.setAdVolume(newMutedState ? 0 :
|
|
7404
|
+
this.adPlayer.setAdVolume(newMutedState ? 0 : restoreVolume);
|
|
7428
7405
|
if (this.config.debugAdTiming) {
|
|
7429
7406
|
console.log("[StormcloudVideoPlayer] Mute toggle during ad - immediately applied:", newMutedState);
|
|
7430
7407
|
}
|
|
@@ -7479,10 +7456,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7479
7456
|
key: "isMuted",
|
|
7480
7457
|
value: function isMuted() {
|
|
7481
7458
|
if (this.adPlayer.isAdPlaying()) {
|
|
7482
|
-
|
|
7483
|
-
console.log("[StormcloudVideoPlayer] isMuted() override during ad playback -> false");
|
|
7484
|
-
}
|
|
7485
|
-
return false;
|
|
7459
|
+
return this.adPlayer.getOriginalMutedState();
|
|
7486
7460
|
}
|
|
7487
7461
|
return this.video.muted;
|
|
7488
7462
|
}
|
|
@@ -7549,6 +7523,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7549
7523
|
return this.video.volume;
|
|
7550
7524
|
}
|
|
7551
7525
|
},
|
|
7526
|
+
{
|
|
7527
|
+
key: "getAdAudioVolume",
|
|
7528
|
+
value: function getAdAudioVolume() {
|
|
7529
|
+
return this.adPlayer.getOriginalMutedState() ? 0 : this.adPlayer.getOriginalVolume();
|
|
7530
|
+
}
|
|
7531
|
+
},
|
|
7552
7532
|
{
|
|
7553
7533
|
key: "isFullscreen",
|
|
7554
7534
|
value: function isFullscreen() {
|