stormcloud-video-player 0.2.29 → 0.2.30

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
@@ -648,27 +648,25 @@ function createImaController(video, options) {
648
648
  console.log("[IMA] Content resume requested");
649
649
  adPlaying = false;
650
650
  setAdPlayingFlag(false);
651
- showContentVideo();
652
651
  emit("content_resume");
653
- setTimeout(() => {
654
- const stillInPod = video.dataset.stormcloudAdPlaying === "true";
655
- if (stillInPod) {
656
- console.log(
657
- "[IMA] Still in ad pod - keeping ad container visible"
658
- );
659
- if (adContainerEl) {
660
- adContainerEl.style.display = "flex";
661
- adContainerEl.style.pointerEvents = "auto";
662
- }
663
- hideContentVideo();
664
- }
665
- }, 50);
666
652
  }
667
653
  );
668
654
  adsManager.addEventListener(AdEvent.ALL_ADS_COMPLETED, () => {
669
- console.log("[IMA] All ads completed - notifying parent");
655
+ console.log("[IMA] All ads completed - restoring content");
670
656
  adPlaying = false;
671
657
  setAdPlayingFlag(false);
658
+ showContentVideo();
659
+ if (adContainerEl) {
660
+ adContainerEl.style.pointerEvents = "none";
661
+ adContainerEl.style.display = "none";
662
+ console.log("[IMA] Ad container hidden");
663
+ }
664
+ if (!(options == null ? void 0 : options.continueLiveStreamDuringAds) && video.paused) {
665
+ console.log("[IMA] Resuming content video playback");
666
+ video.play().catch((e) => {
667
+ console.warn("[IMA] Failed to resume content video:", e);
668
+ });
669
+ }
672
670
  emit("all_ads_completed");
673
671
  });
674
672
  console.log("[IMA] Ads manager event listeners attached");