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