stormcloud-video-player 0.2.21 → 0.2.22

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/lib/index.cjs CHANGED
@@ -565,7 +565,9 @@ function createImaController(video, options) {
565
565
  adsManager.addEventListener(
566
566
  AdEvent.CONTENT_PAUSE_REQUESTED,
567
567
  () => {
568
- console.log("[IMA] Content pause requested");
568
+ console.log(
569
+ "[IMA] Content pause requested - FORCE MUTING main video"
570
+ );
569
571
  if (!(options == null ? void 0 : options.continueLiveStreamDuringAds)) {
570
572
  video.pause();
571
573
  console.log("[IMA] Video paused (VOD mode)");
@@ -575,14 +577,19 @@ function createImaController(video, options) {
575
577
  );
576
578
  }
577
579
  video.muted = true;
580
+ video.volume = 0;
578
581
  adPlaying = true;
579
582
  setAdPlayingFlag(true);
580
583
  emit("content_pause");
581
584
  }
582
585
  );
583
586
  adsManager.addEventListener(AdEvent.STARTED, () => {
584
- console.log("[IMA] Ad started playing");
587
+ console.log(
588
+ "[IMA] Ad started playing - FORCE MUTING main video"
589
+ );
585
590
  setAdPlayingFlag(true);
591
+ video.muted = true;
592
+ video.volume = 0;
586
593
  if (adContainerEl) {
587
594
  adContainerEl.style.pointerEvents = "auto";
588
595
  adContainerEl.style.display = "flex";
@@ -1258,7 +1265,9 @@ function createHlsAdPlayer(contentVideo, options) {
1258
1265
  } else {
1259
1266
  console.log("[HlsAdPlayer] Content continues (Live mode)");
1260
1267
  }
1268
+ console.log("[HlsAdPlayer] FORCE MUTING main video");
1261
1269
  contentVideo.muted = true;
1270
+ contentVideo.volume = 0;
1262
1271
  adPlaying = true;
1263
1272
  setAdPlayingFlag(true);
1264
1273
  if (adVideoElement) {
@@ -3035,7 +3044,7 @@ var StormcloudVideoPlayer = class {
3035
3044
  var _a;
3036
3045
  if (this.config.debugAdTiming) {
3037
3046
  console.log(
3038
- "[StormcloudVideoPlayer] Handling ad pod completion - resuming content"
3047
+ "[StormcloudVideoPlayer] Handling ad pod completion - resuming content and hiding ad layer"
3039
3048
  );
3040
3049
  }
3041
3050
  this.inAdBreak = false;
@@ -3048,11 +3057,14 @@ var StormcloudVideoPlayer = class {
3048
3057
  this.showAds = false;
3049
3058
  this.currentAdIndex = 0;
3050
3059
  this.totalAdsInBreak = 0;
3060
+ this.ima.stop().catch(() => {
3061
+ });
3051
3062
  const originalMutedState = this.ima.getOriginalMutedState();
3052
3063
  this.video.muted = originalMutedState;
3064
+ this.video.volume = originalMutedState ? 0 : 1;
3053
3065
  if (this.config.debugAdTiming) {
3054
3066
  console.log(
3055
- `[StormcloudVideoPlayer] Restored main video mute state to: ${originalMutedState}`
3067
+ `[StormcloudVideoPlayer] Restored main video - muted: ${originalMutedState}, volume: ${this.video.volume}`
3056
3068
  );
3057
3069
  }
3058
3070
  if (!this.shouldContinueLiveStreamDuringAds() && this.video.paused) {