stormcloud-video-player 0.3.8 → 0.3.9

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
@@ -408,12 +408,8 @@ function createImaController(video, options) {
408
408
  let adsLoadedReject;
409
409
  function makeAdsRequest(google, vastTagUrl) {
410
410
  const adsRequest = new google.ima.AdsRequest();
411
- const preloadedResponse = preloadedVast.get(vastTagUrl);
412
- if (preloadedResponse) {
413
- adsRequest.adsResponse = preloadedResponse;
414
- } else {
415
- adsRequest.adTagUrl = vastTagUrl;
416
- }
411
+ console.log("[IMA] \u{1F4E1} Requesting VAST from URL (letting IMA fetch fresh)");
412
+ adsRequest.adTagUrl = vastTagUrl;
417
413
  const videoWidth = video.offsetWidth || video.clientWidth || 640;
418
414
  const videoHeight = video.offsetHeight || video.clientHeight || 360;
419
415
  adsRequest.linearAdSlotWidth = videoWidth;
@@ -436,11 +432,8 @@ function createImaController(video, options) {
436
432
  console.warn("[IMA] Failed to call setAdWillPlayMuted:", error);
437
433
  }
438
434
  }
439
- adsRequest.vastLoadTimeout = 5e3;
435
+ adsRequest.vastLoadTimeout = 1e4;
440
436
  adsLoader.requestAds(adsRequest);
441
- if (preloadedResponse) {
442
- preloadedVast.delete(vastTagUrl);
443
- }
444
437
  }
445
438
  function ensurePlaceholderContainer() {
446
439
  var _a;
@@ -3860,6 +3853,12 @@ var StormcloudVideoPlayer = class {
3860
3853
  );
3861
3854
  }
3862
3855
  mediaUrls = await this.fetchAndParseVastXml(vastTagUrl);
3856
+ if (this.config.debugAdTiming) {
3857
+ console.log(
3858
+ `[StormcloudVideoPlayer] Extracted ${mediaUrls.length} media URLs:`,
3859
+ mediaUrls
3860
+ );
3861
+ }
3863
3862
  if (mediaUrls.length > 0) {
3864
3863
  this.vastToMediaUrlMap.set(vastTagUrl, mediaUrls);
3865
3864
  }