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.
@@ -501,7 +501,9 @@ function createImaController(video, options) {
501
501
  adsManager.addEventListener(
502
502
  AdEvent.CONTENT_PAUSE_REQUESTED,
503
503
  () => {
504
- console.log("[IMA] Content pause requested");
504
+ console.log(
505
+ "[IMA] Content pause requested - FORCE MUTING main video"
506
+ );
505
507
  if (!(options == null ? void 0 : options.continueLiveStreamDuringAds)) {
506
508
  video.pause();
507
509
  console.log("[IMA] Video paused (VOD mode)");
@@ -511,14 +513,19 @@ function createImaController(video, options) {
511
513
  );
512
514
  }
513
515
  video.muted = true;
516
+ video.volume = 0;
514
517
  adPlaying = true;
515
518
  setAdPlayingFlag(true);
516
519
  emit("content_pause");
517
520
  }
518
521
  );
519
522
  adsManager.addEventListener(AdEvent.STARTED, () => {
520
- console.log("[IMA] Ad started playing");
523
+ console.log(
524
+ "[IMA] Ad started playing - FORCE MUTING main video"
525
+ );
521
526
  setAdPlayingFlag(true);
527
+ video.muted = true;
528
+ video.volume = 0;
522
529
  if (adContainerEl) {
523
530
  adContainerEl.style.pointerEvents = "auto";
524
531
  adContainerEl.style.display = "flex";
@@ -1194,7 +1201,9 @@ function createHlsAdPlayer(contentVideo, options) {
1194
1201
  } else {
1195
1202
  console.log("[HlsAdPlayer] Content continues (Live mode)");
1196
1203
  }
1204
+ console.log("[HlsAdPlayer] FORCE MUTING main video");
1197
1205
  contentVideo.muted = true;
1206
+ contentVideo.volume = 0;
1198
1207
  adPlaying = true;
1199
1208
  setAdPlayingFlag(true);
1200
1209
  if (adVideoElement) {
@@ -2971,7 +2980,7 @@ var StormcloudVideoPlayer = class {
2971
2980
  var _a;
2972
2981
  if (this.config.debugAdTiming) {
2973
2982
  console.log(
2974
- "[StormcloudVideoPlayer] Handling ad pod completion - resuming content"
2983
+ "[StormcloudVideoPlayer] Handling ad pod completion - resuming content and hiding ad layer"
2975
2984
  );
2976
2985
  }
2977
2986
  this.inAdBreak = false;
@@ -2984,11 +2993,14 @@ var StormcloudVideoPlayer = class {
2984
2993
  this.showAds = false;
2985
2994
  this.currentAdIndex = 0;
2986
2995
  this.totalAdsInBreak = 0;
2996
+ this.ima.stop().catch(() => {
2997
+ });
2987
2998
  const originalMutedState = this.ima.getOriginalMutedState();
2988
2999
  this.video.muted = originalMutedState;
3000
+ this.video.volume = originalMutedState ? 0 : 1;
2989
3001
  if (this.config.debugAdTiming) {
2990
3002
  console.log(
2991
- `[StormcloudVideoPlayer] Restored main video mute state to: ${originalMutedState}`
3003
+ `[StormcloudVideoPlayer] Restored main video - muted: ${originalMutedState}, volume: ${this.video.volume}`
2992
3004
  );
2993
3005
  }
2994
3006
  if (!this.shouldContinueLiveStreamDuringAds() && this.video.paused) {