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
|
@@ -814,7 +814,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
814
814
|
adPlaying = false;
|
|
815
815
|
setAdPlayingFlag(false);
|
|
816
816
|
contentVideo.muted = true;
|
|
817
|
-
contentVideo.volume = 0;
|
|
818
817
|
if (adContainerEl) {
|
|
819
818
|
adContainerEl.style.display = "none";
|
|
820
819
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -834,7 +833,6 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
834
833
|
adPlaying = false;
|
|
835
834
|
setAdPlayingFlag(false);
|
|
836
835
|
contentVideo.muted = true;
|
|
837
|
-
contentVideo.volume = 0;
|
|
838
836
|
if (adContainerEl) {
|
|
839
837
|
adContainerEl.style.display = "none";
|
|
840
838
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -939,7 +937,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
939
937
|
},
|
|
940
938
|
play: function play() {
|
|
941
939
|
return _async_to_generator(function() {
|
|
942
|
-
var contentVolume,
|
|
940
|
+
var contentVolume, mediaFile, isHlsAd;
|
|
943
941
|
return _ts_generator(this, function(_state) {
|
|
944
942
|
if (!currentAd) {
|
|
945
943
|
console.warn("[HlsAdPlayer] Cannot play: No ad loaded (no ads available)");
|
|
@@ -973,13 +971,11 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
973
971
|
}
|
|
974
972
|
console.log("[HlsAdPlayer] FORCE MUTING main video");
|
|
975
973
|
contentVideo.muted = true;
|
|
976
|
-
contentVideo.volume = 0;
|
|
977
974
|
adPlaying = true;
|
|
978
975
|
setAdPlayingFlag(true);
|
|
979
976
|
if (adVideoElement) {
|
|
980
|
-
|
|
981
|
-
adVideoElement.
|
|
982
|
-
adVideoElement.muted = false;
|
|
977
|
+
adVideoElement.volume = Math.max(0, Math.min(1, originalVolume));
|
|
978
|
+
adVideoElement.muted = originalMutedState;
|
|
983
979
|
console.log("[HlsAdPlayer] Set ad video volume to ".concat(adVideoElement.volume, ", muted: ").concat(adVideoElement.muted, ", originalMutedState: ").concat(originalMutedState, ", contentVolume: ").concat(contentVolume));
|
|
984
980
|
}
|
|
985
981
|
if (adContainerEl) {
|
|
@@ -1087,8 +1083,8 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1087
1083
|
setAdPlayingFlag(false);
|
|
1088
1084
|
previousMutedState = contentVideo.muted;
|
|
1089
1085
|
contentVideo.muted = originalMutedState;
|
|
1090
|
-
contentVideo.volume =
|
|
1091
|
-
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState));
|
|
1086
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1087
|
+
console.log("[HlsAdPlayer] Restored mute state on stop: ".concat(previousMutedState, " -> ").concat(originalMutedState, ", volume: ").concat(contentVideo.volume));
|
|
1092
1088
|
if (adContainerEl) {
|
|
1093
1089
|
adContainerEl.style.display = "none";
|
|
1094
1090
|
adContainerEl.style.pointerEvents = "none";
|
|
@@ -1143,7 +1139,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1143
1139
|
adPlaying = false;
|
|
1144
1140
|
setAdPlayingFlag(false);
|
|
1145
1141
|
contentVideo.muted = originalMutedState;
|
|
1146
|
-
contentVideo.volume =
|
|
1142
|
+
contentVideo.volume = Math.max(0, Math.min(1, originalVolume));
|
|
1147
1143
|
if (adHls) {
|
|
1148
1144
|
adHls.destroy();
|
|
1149
1145
|
adHls = void 0;
|
|
@@ -1199,7 +1195,9 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1199
1195
|
},
|
|
1200
1196
|
setAdVolume: function setAdVolume(volume) {
|
|
1201
1197
|
if (adVideoElement && adPlaying) {
|
|
1202
|
-
|
|
1198
|
+
var clamped = Math.max(0, Math.min(1, volume));
|
|
1199
|
+
adVideoElement.volume = clamped;
|
|
1200
|
+
adVideoElement.muted = clamped === 0;
|
|
1203
1201
|
}
|
|
1204
1202
|
},
|
|
1205
1203
|
getAdVolume: function getAdVolume() {
|
|
@@ -1304,7 +1302,7 @@ function createPalNonceManager() {
|
|
|
1304
1302
|
return {
|
|
1305
1303
|
generateNonce: function generateNonce() {
|
|
1306
1304
|
return _async_to_generator(function() {
|
|
1307
|
-
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1305
|
+
var options, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_playerVolume, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
1308
1306
|
var _arguments = arguments;
|
|
1309
1307
|
return _ts_generator(this, function(_state) {
|
|
1310
1308
|
switch(_state.label){
|
|
@@ -1329,6 +1327,7 @@ function createPalNonceManager() {
|
|
|
1329
1327
|
request = new goog.pal.NonceRequest();
|
|
1330
1328
|
request.adWillAutoPlay = (_options_adWillAutoPlay = options.adWillAutoPlay) !== null && _options_adWillAutoPlay !== void 0 ? _options_adWillAutoPlay : true;
|
|
1331
1329
|
request.adWillPlayMuted = (_options_adWillPlayMuted = options.adWillPlayMuted) !== null && _options_adWillPlayMuted !== void 0 ? _options_adWillPlayMuted : false;
|
|
1330
|
+
request.playerVolume = (_options_playerVolume = options.playerVolume) !== null && _options_playerVolume !== void 0 ? _options_playerVolume : request.adWillPlayMuted ? 0 : 1;
|
|
1332
1331
|
request.continuousPlayback = (_options_continuousPlayback = options.continuousPlayback) !== null && _options_continuousPlayback !== void 0 ? _options_continuousPlayback : true;
|
|
1333
1332
|
request.descriptionUrl = options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : "");
|
|
1334
1333
|
request.iconsSupported = true;
|
|
@@ -2726,7 +2725,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2726
2725
|
videoWidth: this.video.offsetWidth || this.video.clientWidth || 640,
|
|
2727
2726
|
videoHeight: this.video.offsetHeight || this.video.clientHeight || 480,
|
|
2728
2727
|
adWillAutoPlay: !!this.config.autoplay,
|
|
2729
|
-
adWillPlayMuted:
|
|
2728
|
+
adWillPlayMuted: true,
|
|
2729
|
+
playerVolume: 0,
|
|
2730
2730
|
continuousPlayback: (_this_config_lowLatencyMode = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false
|
|
2731
2731
|
}).catch(function() {});
|
|
2732
2732
|
fetchConsentSignals().then(function(signals) {
|
|
@@ -3192,10 +3192,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3192
3192
|
console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
|
|
3193
3193
|
}
|
|
3194
3194
|
}
|
|
3195
|
-
|
|
3196
|
-
var currentVolume = _this.video.volume;
|
|
3197
|
-
var adVolume = currentMuted ? 0 : currentVolume;
|
|
3198
|
-
_this.adPlayer.setAdVolume(adVolume);
|
|
3195
|
+
_this.adPlayer.setAdVolume(_this.getAdAudioVolume());
|
|
3199
3196
|
if (_this.isShowingPlaceholder) {
|
|
3200
3197
|
if (_this.config.debugAdTiming) {
|
|
3201
3198
|
console.log("[StormcloudVideoPlayer] Hiding placeholder - new ads starting");
|
|
@@ -3212,7 +3209,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3212
3209
|
}).catch(function() {});
|
|
3213
3210
|
if (!_this.video.muted) {
|
|
3214
3211
|
_this.video.muted = true;
|
|
3215
|
-
_this.video.volume = 0;
|
|
3216
3212
|
if (_this.config.debugAdTiming) {
|
|
3217
3213
|
console.log("[StormcloudVideoPlayer] Muted video on content_resume (ad ended, gap between ads)");
|
|
3218
3214
|
}
|
|
@@ -3260,7 +3256,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3260
3256
|
try {
|
|
3261
3257
|
this.adPlayer.destroy();
|
|
3262
3258
|
this.video.muted = true;
|
|
3263
|
-
this.video.volume = 0;
|
|
3264
3259
|
} catch (error) {
|
|
3265
3260
|
if (this.config.debugAdTiming) {
|
|
3266
3261
|
console.warn("[StormcloudVideoPlayer] Error destroying old AdController:", error);
|
|
@@ -3319,7 +3314,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3319
3314
|
}
|
|
3320
3315
|
if (!this.video.muted) {
|
|
3321
3316
|
this.video.muted = true;
|
|
3322
|
-
this.video.volume = 0;
|
|
3323
3317
|
if (this.config.debugAdTiming) {
|
|
3324
3318
|
console.log("[StormcloudVideoPlayer] Muted video when showing placeholder");
|
|
3325
3319
|
}
|
|
@@ -3941,7 +3935,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3941
3935
|
if (marker.type === "end") {
|
|
3942
3936
|
if (!this.video.muted) {
|
|
3943
3937
|
this.video.muted = true;
|
|
3944
|
-
this.video.volume = 0;
|
|
3945
3938
|
if (this.config.debugAdTiming) {
|
|
3946
3939
|
console.log("[StormcloudVideoPlayer] Muted video on SCTE end marker");
|
|
3947
3940
|
}
|
|
@@ -3979,13 +3972,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3979
3972
|
{
|
|
3980
3973
|
key: "startScte35AdBreak",
|
|
3981
3974
|
value: function startScte35AdBreak(marker, cueKey, durationMs) {
|
|
3982
|
-
if (!this.video.muted) {
|
|
3983
|
-
this.video.muted = true;
|
|
3984
|
-
this.video.volume = 0;
|
|
3985
|
-
if (this.config.debugAdTiming) {
|
|
3986
|
-
console.log("[StormcloudVideoPlayer] Muted video on SCTE start marker");
|
|
3987
|
-
}
|
|
3988
|
-
}
|
|
3989
3975
|
this.inAdBreak = true;
|
|
3990
3976
|
this.activeScte35BreakKey = cueKey !== null && cueKey !== void 0 ? cueKey : this.pendingScte35CueKey;
|
|
3991
3977
|
this.scheduledScte35BreakKey = void 0;
|
|
@@ -5572,7 +5558,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5572
5558
|
key: "handleAdStart",
|
|
5573
5559
|
value: function handleAdStart(_marker) {
|
|
5574
5560
|
return _async_to_generator(function() {
|
|
5575
|
-
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, adVolume, adVolume1, error, fallbackPreloaded, adVolume2, fallbackError;
|
|
5561
|
+
var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, preservedMuted, preservedVolume, adVolume, adVolume1, error, fallbackPreloaded, preservedMuted1, preservedVolume1, adVolume2, fallbackError;
|
|
5576
5562
|
return _ts_generator(this, function(_state) {
|
|
5577
5563
|
switch(_state.label){
|
|
5578
5564
|
case 0:
|
|
@@ -5612,7 +5598,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5612
5598
|
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
5613
5599
|
if (!this.video.muted) {
|
|
5614
5600
|
this.video.muted = true;
|
|
5615
|
-
this.video.volume = 0;
|
|
5616
5601
|
if (this.config.debugAdTiming) {
|
|
5617
5602
|
console.log("[StormcloudVideoPlayer] Muted video in handleAdStart");
|
|
5618
5603
|
}
|
|
@@ -5682,10 +5667,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5682
5667
|
3,
|
|
5683
5668
|
3
|
|
5684
5669
|
];
|
|
5670
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
5671
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
5685
5672
|
this.adPlayer.destroy();
|
|
5686
5673
|
this.video.muted = true;
|
|
5687
|
-
this.video.volume = 0;
|
|
5688
5674
|
this.adPlayer = preloadedController;
|
|
5675
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
5689
5676
|
this.attachImaEventListeners();
|
|
5690
5677
|
if (this.config.debugAdTiming) {
|
|
5691
5678
|
console.log("[CONTINUOUS-FETCH] \u2705 Using preloaded ad, resuming and starting playback immediately (no request delay!)");
|
|
@@ -5783,11 +5770,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5783
5770
|
,
|
|
5784
5771
|
12
|
|
5785
5772
|
]);
|
|
5773
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
5774
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
5786
5775
|
this.adPlayer.destroy();
|
|
5787
5776
|
this.video.muted = true;
|
|
5788
|
-
this.video.volume = 0;
|
|
5789
5777
|
this.adPlayer = fallbackPreloaded.adController;
|
|
5790
5778
|
this.attachImaEventListeners();
|
|
5779
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
5791
5780
|
this.adPlayer.resume();
|
|
5792
5781
|
this.consecutiveFailures = 0;
|
|
5793
5782
|
this.currentAdIndex++;
|
|
@@ -6085,7 +6074,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6085
6074
|
value: function tryNextAvailableAd() {
|
|
6086
6075
|
var retryCount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
6087
6076
|
return _async_to_generator(function() {
|
|
6088
|
-
var remaining, preloaded,
|
|
6077
|
+
var remaining, preloaded, preservedMuted, preservedVolume, error, nextAdUrl, error1, errorMessage, maxRetries;
|
|
6089
6078
|
return _ts_generator(this, function(_state) {
|
|
6090
6079
|
switch(_state.label){
|
|
6091
6080
|
case 0:
|
|
@@ -6139,11 +6128,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6139
6128
|
,
|
|
6140
6129
|
4
|
|
6141
6130
|
]);
|
|
6131
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
6132
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
6142
6133
|
this.adPlayer.destroy();
|
|
6143
6134
|
this.video.muted = true;
|
|
6144
|
-
this.video.volume = 0;
|
|
6145
6135
|
this.adPlayer = preloaded.adController;
|
|
6146
6136
|
this.attachImaEventListeners();
|
|
6137
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
6147
6138
|
this.adPlayer.resume();
|
|
6148
6139
|
this.currentAdIndex++;
|
|
6149
6140
|
this.totalAdRequestsInBreak++;
|
|
@@ -6157,10 +6148,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6157
6148
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6158
6149
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6159
6150
|
}
|
|
6160
|
-
|
|
6161
|
-
currentVolume = this.video.volume;
|
|
6162
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6163
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
6151
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6164
6152
|
this.consecutiveFailures = 0;
|
|
6165
6153
|
return [
|
|
6166
6154
|
2
|
|
@@ -6207,9 +6195,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6207
6195
|
if (this.config.debugAdTiming) {
|
|
6208
6196
|
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)"));
|
|
6209
6197
|
}
|
|
6210
|
-
currentMuted1 = this.video.muted;
|
|
6211
|
-
currentVolume1 = this.video.volume;
|
|
6212
|
-
this.adPlayer.updateOriginalMutedState(currentMuted1, currentVolume1);
|
|
6213
6198
|
this.currentAdIndex++;
|
|
6214
6199
|
this.totalAdRequestsInBreak++;
|
|
6215
6200
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6302,7 +6287,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6302
6287
|
key: "showPlaceholderAndWaitForAds",
|
|
6303
6288
|
value: function showPlaceholderAndWaitForAds() {
|
|
6304
6289
|
return _async_to_generator(function() {
|
|
6305
|
-
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl,
|
|
6290
|
+
var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl, error, errorMessage;
|
|
6306
6291
|
return _ts_generator(this, function(_state) {
|
|
6307
6292
|
switch(_state.label){
|
|
6308
6293
|
case 0:
|
|
@@ -6398,9 +6383,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6398
6383
|
}
|
|
6399
6384
|
this.isShowingPlaceholder = false;
|
|
6400
6385
|
this.adPlayer.hidePlaceholder();
|
|
6401
|
-
currentMuted = this.video.muted;
|
|
6402
|
-
currentVolume = this.video.volume;
|
|
6403
|
-
this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
|
|
6404
6386
|
this.currentAdIndex++;
|
|
6405
6387
|
this.totalAdRequestsInBreak++;
|
|
6406
6388
|
this.lastAdRequestTime = Date.now();
|
|
@@ -6850,7 +6832,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6850
6832
|
key: "playSingleAd",
|
|
6851
6833
|
value: function playSingleAd(vastTagUrl) {
|
|
6852
6834
|
return _async_to_generator(function() {
|
|
6853
|
-
var requestToken,
|
|
6835
|
+
var requestToken, playError, preloadedFallback, preservedMuted, preservedVolume, fallbackError, error, errorMessage, preloadedFallback1, preservedMuted1, preservedVolume1, fallbackError1;
|
|
6854
6836
|
return _ts_generator(this, function(_state) {
|
|
6855
6837
|
switch(_state.label){
|
|
6856
6838
|
case 0:
|
|
@@ -6937,10 +6919,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6937
6919
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6938
6920
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6939
6921
|
}
|
|
6940
|
-
|
|
6941
|
-
currentVolume = this.video.volume;
|
|
6942
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6943
|
-
this.adPlayer.setAdVolume(adVolume);
|
|
6922
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6944
6923
|
this.consecutiveFailures = 0;
|
|
6945
6924
|
this.temporaryFailureUrls.delete(vastTagUrl);
|
|
6946
6925
|
return [
|
|
@@ -6969,11 +6948,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6969
6948
|
10
|
|
6970
6949
|
]);
|
|
6971
6950
|
this.clearAdFailsafeTimer();
|
|
6951
|
+
preservedMuted = this.adPlayer.getOriginalMutedState();
|
|
6952
|
+
preservedVolume = this.adPlayer.getOriginalVolume();
|
|
6972
6953
|
this.adPlayer.destroy();
|
|
6973
6954
|
this.video.muted = true;
|
|
6974
|
-
this.video.volume = 0;
|
|
6975
6955
|
this.adPlayer = preloadedFallback.adController;
|
|
6976
6956
|
this.attachImaEventListeners();
|
|
6957
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted, preservedVolume);
|
|
6977
6958
|
this.adPlayer.resume();
|
|
6978
6959
|
this.consecutiveFailures = 0;
|
|
6979
6960
|
this.currentAdIndex++;
|
|
@@ -6987,10 +6968,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6987
6968
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6988
6969
|
this.scheduleAdStopCountdown(this.getRemainingAdMs());
|
|
6989
6970
|
}
|
|
6990
|
-
|
|
6991
|
-
currentVolume1 = this.video.volume;
|
|
6992
|
-
adVolume1 = currentMuted1 ? 0 : currentVolume1;
|
|
6993
|
-
this.adPlayer.setAdVolume(adVolume1);
|
|
6971
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
6994
6972
|
return [
|
|
6995
6973
|
2
|
|
6996
6974
|
];
|
|
@@ -7049,11 +7027,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7049
7027
|
]);
|
|
7050
7028
|
this.clearAdRequestWatchdog();
|
|
7051
7029
|
this.clearAdFailsafeTimer();
|
|
7030
|
+
preservedMuted1 = this.adPlayer.getOriginalMutedState();
|
|
7031
|
+
preservedVolume1 = this.adPlayer.getOriginalVolume();
|
|
7052
7032
|
this.adPlayer.destroy();
|
|
7053
7033
|
this.video.muted = true;
|
|
7054
|
-
this.video.volume = 0;
|
|
7055
7034
|
this.adPlayer = preloadedFallback1.adController;
|
|
7056
7035
|
this.attachImaEventListeners();
|
|
7036
|
+
this.adPlayer.updateOriginalMutedState(preservedMuted1, preservedVolume1);
|
|
7057
7037
|
this.adPlayer.resume();
|
|
7058
7038
|
this.consecutiveFailures = 0;
|
|
7059
7039
|
this.currentAdIndex++;
|
|
@@ -7064,10 +7044,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7064
7044
|
];
|
|
7065
7045
|
case 14:
|
|
7066
7046
|
_state.sent();
|
|
7067
|
-
|
|
7068
|
-
currentVolume2 = this.video.volume;
|
|
7069
|
-
adVolume2 = currentMuted2 ? 0 : currentVolume2;
|
|
7070
|
-
this.adPlayer.setAdVolume(adVolume2);
|
|
7047
|
+
this.adPlayer.setAdVolume(this.getAdAudioVolume());
|
|
7071
7048
|
return [
|
|
7072
7049
|
2
|
|
7073
7050
|
];
|
|
@@ -7369,10 +7346,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7369
7346
|
key: "toggleMute",
|
|
7370
7347
|
value: function toggleMute() {
|
|
7371
7348
|
if (this.adPlayer.isAdPlaying()) {
|
|
7372
|
-
var
|
|
7373
|
-
var
|
|
7349
|
+
var newMutedState = !this.adPlayer.getOriginalMutedState();
|
|
7350
|
+
var restoreVolume = this.adPlayer.getOriginalVolume() || 1;
|
|
7374
7351
|
this.adPlayer.updateOriginalMutedState(newMutedState, this.video.volume);
|
|
7375
|
-
this.adPlayer.setAdVolume(newMutedState ? 0 :
|
|
7352
|
+
this.adPlayer.setAdVolume(newMutedState ? 0 : restoreVolume);
|
|
7376
7353
|
if (this.config.debugAdTiming) {
|
|
7377
7354
|
console.log("[StormcloudVideoPlayer] Mute toggle during ad - immediately applied:", newMutedState);
|
|
7378
7355
|
}
|
|
@@ -7427,10 +7404,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7427
7404
|
key: "isMuted",
|
|
7428
7405
|
value: function isMuted() {
|
|
7429
7406
|
if (this.adPlayer.isAdPlaying()) {
|
|
7430
|
-
|
|
7431
|
-
console.log("[StormcloudVideoPlayer] isMuted() override during ad playback -> false");
|
|
7432
|
-
}
|
|
7433
|
-
return false;
|
|
7407
|
+
return this.adPlayer.getOriginalMutedState();
|
|
7434
7408
|
}
|
|
7435
7409
|
return this.video.muted;
|
|
7436
7410
|
}
|
|
@@ -7497,6 +7471,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7497
7471
|
return this.video.volume;
|
|
7498
7472
|
}
|
|
7499
7473
|
},
|
|
7474
|
+
{
|
|
7475
|
+
key: "getAdAudioVolume",
|
|
7476
|
+
value: function getAdAudioVolume() {
|
|
7477
|
+
return this.adPlayer.getOriginalMutedState() ? 0 : this.adPlayer.getOriginalVolume();
|
|
7478
|
+
}
|
|
7479
|
+
},
|
|
7500
7480
|
{
|
|
7501
7481
|
key: "isFullscreen",
|
|
7502
7482
|
value: function isFullscreen() {
|