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.js CHANGED
@@ -339,12 +339,8 @@ function createImaController(video, options) {
339
339
  let adsLoadedReject;
340
340
  function makeAdsRequest(google, vastTagUrl) {
341
341
  const adsRequest = new google.ima.AdsRequest();
342
- const preloadedResponse = preloadedVast.get(vastTagUrl);
343
- if (preloadedResponse) {
344
- adsRequest.adsResponse = preloadedResponse;
345
- } else {
346
- adsRequest.adTagUrl = vastTagUrl;
347
- }
342
+ console.log("[IMA] \u{1F4E1} Requesting VAST from URL (letting IMA fetch fresh)");
343
+ adsRequest.adTagUrl = vastTagUrl;
348
344
  const videoWidth = video.offsetWidth || video.clientWidth || 640;
349
345
  const videoHeight = video.offsetHeight || video.clientHeight || 360;
350
346
  adsRequest.linearAdSlotWidth = videoWidth;
@@ -367,11 +363,8 @@ function createImaController(video, options) {
367
363
  console.warn("[IMA] Failed to call setAdWillPlayMuted:", error);
368
364
  }
369
365
  }
370
- adsRequest.vastLoadTimeout = 5e3;
366
+ adsRequest.vastLoadTimeout = 1e4;
371
367
  adsLoader.requestAds(adsRequest);
372
- if (preloadedResponse) {
373
- preloadedVast.delete(vastTagUrl);
374
- }
375
368
  }
376
369
  function ensurePlaceholderContainer() {
377
370
  var _a;
@@ -3791,6 +3784,12 @@ var StormcloudVideoPlayer = class {
3791
3784
  );
3792
3785
  }
3793
3786
  mediaUrls = await this.fetchAndParseVastXml(vastTagUrl);
3787
+ if (this.config.debugAdTiming) {
3788
+ console.log(
3789
+ `[StormcloudVideoPlayer] Extracted ${mediaUrls.length} media URLs:`,
3790
+ mediaUrls
3791
+ );
3792
+ }
3794
3793
  if (mediaUrls.length > 0) {
3795
3794
  this.vastToMediaUrlMap.set(vastTagUrl, mediaUrls);
3796
3795
  }