stormcloud-video-player 0.2.22 → 0.2.23

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
@@ -605,6 +605,18 @@ function createImaController(video, options) {
605
605
  adPlaying = false;
606
606
  setAdPlayingFlag(false);
607
607
  emit("content_resume");
608
+ setTimeout(() => {
609
+ const stillInPod = video.dataset.stormcloudAdPlaying === "true";
610
+ if (stillInPod) {
611
+ console.log(
612
+ "[IMA] Still in ad pod - keeping ad container visible (black screen)"
613
+ );
614
+ if (adContainerEl) {
615
+ adContainerEl.style.display = "flex";
616
+ adContainerEl.style.pointerEvents = "auto";
617
+ }
618
+ }
619
+ }, 50);
608
620
  }
609
621
  );
610
622
  adsManager.addEventListener(AdEvent.ALL_ADS_COMPLETED, () => {
@@ -1154,6 +1166,18 @@ function createHlsAdPlayer(contentVideo, options) {
1154
1166
  adPlaying = false;
1155
1167
  setAdPlayingFlag(false);
1156
1168
  emit("content_resume");
1169
+ setTimeout(() => {
1170
+ const stillInPod = contentVideo.dataset.stormcloudAdPlaying === "true";
1171
+ if (stillInPod) {
1172
+ console.log(
1173
+ "[HlsAdPlayer] Still in ad pod - keeping ad container visible (black screen)"
1174
+ );
1175
+ if (adContainerEl) {
1176
+ adContainerEl.style.display = "flex";
1177
+ adContainerEl.style.pointerEvents = "auto";
1178
+ }
1179
+ }
1180
+ }, 50);
1157
1181
  }
1158
1182
  function handleAdError() {
1159
1183
  console.log("[HlsAdPlayer] Handling ad error");
@@ -2212,6 +2236,9 @@ var StormcloudVideoPlayer = class {
2212
2236
  if (remaining > 500 && this.adPodQueue.length > 0) {
2213
2237
  const next = this.adPodQueue.shift();
2214
2238
  this.currentAdIndex++;
2239
+ this.video.dataset.stormcloudAdPlaying = "true";
2240
+ this.video.muted = true;
2241
+ this.video.volume = 0;
2215
2242
  if (this.config.debugAdTiming) {
2216
2243
  console.log(
2217
2244
  `[StormcloudVideoPlayer] Playing next ad in pod (${this.currentAdIndex}/${this.totalAdsInBreak}) - main video stays muted, ad layer stays visible`