stormcloud-video-player 0.3.3 → 0.3.4

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.
@@ -2435,10 +2435,12 @@ var StormcloudVideoPlayer = class {
2435
2435
  this.handleAdPodComplete();
2436
2436
  }
2437
2437
  });
2438
- this.ima.on("ad_error", () => {
2438
+ this.ima.on("ad_error", (errorPayload) => {
2439
2439
  const remaining = this.getRemainingAdMs();
2440
- console.log(
2441
- `[DEBUG-POD] \u274C ad_error event | inBreak=${this.inAdBreak}, queue=${this.adPodQueue.length}, remaining=${remaining}ms`
2440
+ console.error(
2441
+ `[DEBUG-POD] \u274C ad_error event | inBreak=${this.inAdBreak}, queue=${this.adPodQueue.length}, remaining=${remaining}ms`,
2442
+ errorPayload ? `
2443
+ Error details: ${JSON.stringify(errorPayload)}` : ""
2442
2444
  );
2443
2445
  if (this.inAdBreak) {
2444
2446
  if (remaining > 500 && this.adPodQueue.length > 0) {
@@ -2465,7 +2467,7 @@ var StormcloudVideoPlayer = class {
2465
2467
  }
2466
2468
  });
2467
2469
  this.ima.on("content_pause", () => {
2468
- console.log(`[DEBUG-POD] \u{1F3AF} content_pause | ad ${this.currentAdIndex}/${this.totalAdsInBreak}, queue=${this.adPodQueue.length}`);
2470
+ console.log(`[DEBUG-POD] \u{1F3AF} content_pause (AD STARTING!) | ad ${this.currentAdIndex}/${this.totalAdsInBreak}, queue=${this.adPodQueue.length}`);
2469
2471
  this.clearAdFailsafeTimer();
2470
2472
  this.clearAdRequestWatchdog();
2471
2473
  this.activeAdRequestToken = null;
@@ -3390,22 +3392,31 @@ var StormcloudVideoPlayer = class {
3390
3392
  console.log(`[DEBUG-POD] \u{1F4DD} Request token=${requestToken}, preloaded=${wasPreloaded}`);
3391
3393
  this.startAdRequestWatchdog(requestToken);
3392
3394
  try {
3395
+ console.log(`[DEBUG-POD] \u{1F4E1} Calling ima.requestAds() for token=${requestToken}...`);
3393
3396
  await this.ima.requestAds(vastTagUrl);
3397
+ console.log(`[DEBUG-POD] \u2705 ima.requestAds() completed successfully`);
3394
3398
  this.clearAdRequestWatchdog();
3395
3399
  if (this.activeAdRequestToken !== requestToken) {
3396
3400
  console.warn(`[DEBUG-POD] \u26A0\uFE0F Token mismatch after requestAds (stale request)`);
3397
3401
  return;
3398
3402
  }
3403
+ console.log(`[DEBUG-POD] \u{1F4FA} Calling ima.play() to start ad playback...`);
3404
+ console.log(`[DEBUG-POD] \u{1F4CA} Video element state: paused=${this.video.paused}, muted=${this.video.muted}, readyState=${this.video.readyState}`);
3399
3405
  try {
3400
3406
  this.startAdFailsafeTimer(requestToken);
3401
3407
  await this.ima.play();
3402
3408
  if (this.activeAdRequestToken === requestToken) {
3403
- console.log(`[DEBUG-POD] \u2705 Ad play initiated (token=${requestToken})`);
3409
+ console.log(`[DEBUG-POD] \u2705 Ad play initiated successfully (token=${requestToken})`);
3404
3410
  } else {
3405
3411
  console.warn(`[DEBUG-POD] \u26A0\uFE0F Token mismatch after play (stale request)`);
3406
3412
  }
3407
3413
  } catch (playError) {
3408
- console.log("[DEBUG-POD] \u26A0\uFE0F No ads available from play()");
3414
+ console.error(
3415
+ "[DEBUG-POD] \u274C Failed to play ad:",
3416
+ playError instanceof Error ? playError.message : playError,
3417
+ "\nFull error:",
3418
+ playError
3419
+ );
3409
3420
  this.clearAdFailsafeTimer();
3410
3421
  if (this.activeAdRequestToken === requestToken) {
3411
3422
  this.activeAdRequestToken = null;