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