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.
package/lib/index.cjs CHANGED
@@ -2499,10 +2499,12 @@ var StormcloudVideoPlayer = class {
2499
2499
  this.handleAdPodComplete();
2500
2500
  }
2501
2501
  });
2502
- this.ima.on("ad_error", () => {
2502
+ this.ima.on("ad_error", (errorPayload) => {
2503
2503
  const remaining = this.getRemainingAdMs();
2504
- console.log(
2505
- `[DEBUG-POD] \u274C ad_error event | inBreak=${this.inAdBreak}, queue=${this.adPodQueue.length}, remaining=${remaining}ms`
2504
+ console.error(
2505
+ `[DEBUG-POD] \u274C ad_error event | inBreak=${this.inAdBreak}, queue=${this.adPodQueue.length}, remaining=${remaining}ms`,
2506
+ errorPayload ? `
2507
+ Error details: ${JSON.stringify(errorPayload)}` : ""
2506
2508
  );
2507
2509
  if (this.inAdBreak) {
2508
2510
  if (remaining > 500 && this.adPodQueue.length > 0) {
@@ -2529,7 +2531,7 @@ var StormcloudVideoPlayer = class {
2529
2531
  }
2530
2532
  });
2531
2533
  this.ima.on("content_pause", () => {
2532
- console.log(`[DEBUG-POD] \u{1F3AF} content_pause | ad ${this.currentAdIndex}/${this.totalAdsInBreak}, queue=${this.adPodQueue.length}`);
2534
+ console.log(`[DEBUG-POD] \u{1F3AF} content_pause (AD STARTING!) | ad ${this.currentAdIndex}/${this.totalAdsInBreak}, queue=${this.adPodQueue.length}`);
2533
2535
  this.clearAdFailsafeTimer();
2534
2536
  this.clearAdRequestWatchdog();
2535
2537
  this.activeAdRequestToken = null;
@@ -3454,22 +3456,31 @@ var StormcloudVideoPlayer = class {
3454
3456
  console.log(`[DEBUG-POD] \u{1F4DD} Request token=${requestToken}, preloaded=${wasPreloaded}`);
3455
3457
  this.startAdRequestWatchdog(requestToken);
3456
3458
  try {
3459
+ console.log(`[DEBUG-POD] \u{1F4E1} Calling ima.requestAds() for token=${requestToken}...`);
3457
3460
  await this.ima.requestAds(vastTagUrl);
3461
+ console.log(`[DEBUG-POD] \u2705 ima.requestAds() completed successfully`);
3458
3462
  this.clearAdRequestWatchdog();
3459
3463
  if (this.activeAdRequestToken !== requestToken) {
3460
3464
  console.warn(`[DEBUG-POD] \u26A0\uFE0F Token mismatch after requestAds (stale request)`);
3461
3465
  return;
3462
3466
  }
3467
+ console.log(`[DEBUG-POD] \u{1F4FA} Calling ima.play() to start ad playback...`);
3468
+ console.log(`[DEBUG-POD] \u{1F4CA} Video element state: paused=${this.video.paused}, muted=${this.video.muted}, readyState=${this.video.readyState}`);
3463
3469
  try {
3464
3470
  this.startAdFailsafeTimer(requestToken);
3465
3471
  await this.ima.play();
3466
3472
  if (this.activeAdRequestToken === requestToken) {
3467
- console.log(`[DEBUG-POD] \u2705 Ad play initiated (token=${requestToken})`);
3473
+ console.log(`[DEBUG-POD] \u2705 Ad play initiated successfully (token=${requestToken})`);
3468
3474
  } else {
3469
3475
  console.warn(`[DEBUG-POD] \u26A0\uFE0F Token mismatch after play (stale request)`);
3470
3476
  }
3471
3477
  } catch (playError) {
3472
- console.log("[DEBUG-POD] \u26A0\uFE0F No ads available from play()");
3478
+ console.error(
3479
+ "[DEBUG-POD] \u274C Failed to play ad:",
3480
+ playError instanceof Error ? playError.message : playError,
3481
+ "\nFull error:",
3482
+ playError
3483
+ );
3473
3484
  this.clearAdFailsafeTimer();
3474
3485
  if (this.activeAdRequestToken === requestToken) {
3475
3486
  this.activeAdRequestToken = null;