stormcloud-video-player 0.2.34 → 0.2.35
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/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +29 -47
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +29 -47
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +29 -47
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +29 -47
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +29 -47
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/ima.cjs +1 -1
- package/lib/sdk/ima.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +29 -47
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -674,7 +674,7 @@ function createImaController(video, options) {
|
|
|
674
674
|
console.log("[DEBUG-FLOW] \u23F8\uFE0F CONTENT_RESUME - Single ad done");
|
|
675
675
|
adPlaying = false;
|
|
676
676
|
setAdPlayingFlag(false);
|
|
677
|
-
console.log("[DEBUG-LAYER] \u26A0\uFE0F Waiting for pod manager
|
|
677
|
+
console.log("[DEBUG-LAYER] \u26A0\uFE0F Waiting for pod manager (more ads, placeholder, or done)");
|
|
678
678
|
emit("content_resume");
|
|
679
679
|
}
|
|
680
680
|
);
|
|
@@ -2442,44 +2442,31 @@ var StormcloudVideoPlayer = class {
|
|
|
2442
2442
|
}
|
|
2443
2443
|
});
|
|
2444
2444
|
this.ima.on("ad_error", () => {
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
remainingAds: this.adPodQueue.length
|
|
2450
|
-
});
|
|
2451
|
-
}
|
|
2445
|
+
const remaining = this.getRemainingAdMs();
|
|
2446
|
+
console.log(
|
|
2447
|
+
`[DEBUG-POD] \u274C ad_error event | inBreak=${this.inAdBreak}, queue=${this.adPodQueue.length}, remaining=${remaining}ms`
|
|
2448
|
+
);
|
|
2452
2449
|
if (this.inAdBreak) {
|
|
2453
|
-
const remaining = this.getRemainingAdMs();
|
|
2454
2450
|
if (remaining > 500 && this.adPodQueue.length > 0) {
|
|
2455
2451
|
const nextPreloaded = this.findNextPreloadedAd();
|
|
2456
2452
|
if (nextPreloaded) {
|
|
2457
2453
|
this.currentAdIndex++;
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
);
|
|
2462
|
-
}
|
|
2454
|
+
console.log(
|
|
2455
|
+
`[DEBUG-POD] \u27A1\uFE0F Trying next ad after error (${this.currentAdIndex}/${this.totalAdsInBreak})`
|
|
2456
|
+
);
|
|
2463
2457
|
this.playSingleAd(nextPreloaded).catch(() => {
|
|
2464
2458
|
this.handleAdFailure();
|
|
2465
2459
|
});
|
|
2466
2460
|
} else {
|
|
2467
|
-
|
|
2468
|
-
console.log(
|
|
2469
|
-
"[StormcloudVideoPlayer] No preloaded ads available, ending ad break"
|
|
2470
|
-
);
|
|
2471
|
-
}
|
|
2461
|
+
console.log("[DEBUG-POD] \u26A0\uFE0F No more preloaded ads - calling handleAdFailure");
|
|
2472
2462
|
this.handleAdFailure();
|
|
2473
2463
|
}
|
|
2474
2464
|
} else {
|
|
2465
|
+
console.log("[DEBUG-POD] \u26A0\uFE0F No more ads or time - calling handleAdFailure");
|
|
2475
2466
|
this.handleAdFailure();
|
|
2476
2467
|
}
|
|
2477
2468
|
} else {
|
|
2478
|
-
|
|
2479
|
-
console.log(
|
|
2480
|
-
"[StormcloudVideoPlayer] Ad error before ad break established - cleaning up"
|
|
2481
|
-
);
|
|
2482
|
-
}
|
|
2469
|
+
console.log("[DEBUG-POD] \u26A0\uFE0F Error before ad break established");
|
|
2483
2470
|
this.handleAdFailure();
|
|
2484
2471
|
}
|
|
2485
2472
|
});
|
|
@@ -3230,31 +3217,15 @@ var StormcloudVideoPlayer = class {
|
|
|
3230
3217
|
const overrunMs = Math.max(0, elapsedSinceStartMs - expectedDurationMs);
|
|
3231
3218
|
const shouldExtendAdBreak = (adPlaying || pendingAds || this.showAds) && overrunMs < maxExtensionMs;
|
|
3232
3219
|
if (shouldExtendAdBreak) {
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
{
|
|
3237
|
-
adPlaying,
|
|
3238
|
-
pendingAds,
|
|
3239
|
-
showAds: this.showAds,
|
|
3240
|
-
overrunMs,
|
|
3241
|
-
checkIntervalMs,
|
|
3242
|
-
maxExtensionMs
|
|
3243
|
-
}
|
|
3244
|
-
);
|
|
3245
|
-
}
|
|
3220
|
+
console.log(
|
|
3221
|
+
`[DEBUG-POD] \u23F3 Extending ad break | elapsed=${elapsedSinceStartMs}ms, expected=${expectedDurationMs}ms, overrun=${overrunMs}ms`
|
|
3222
|
+
);
|
|
3246
3223
|
this.scheduleAdStopCountdown(checkIntervalMs);
|
|
3247
3224
|
return;
|
|
3248
3225
|
}
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
pendingAds,
|
|
3253
|
-
showAds: this.showAds,
|
|
3254
|
-
overrunMs,
|
|
3255
|
-
maxExtensionMs
|
|
3256
|
-
});
|
|
3257
|
-
}
|
|
3226
|
+
console.log(
|
|
3227
|
+
`[DEBUG-POD] \u23F1\uFE0F Ad break duration expired | elapsed=${elapsedSinceStartMs}ms, expected=${expectedDurationMs}ms`
|
|
3228
|
+
);
|
|
3258
3229
|
if (adPlaying) {
|
|
3259
3230
|
this.ima.stop().catch(() => {
|
|
3260
3231
|
});
|
|
@@ -3369,9 +3340,20 @@ var StormcloudVideoPlayer = class {
|
|
|
3369
3340
|
}
|
|
3370
3341
|
}
|
|
3371
3342
|
handleAdFailure() {
|
|
3343
|
+
const remaining = this.getRemainingAdMs();
|
|
3372
3344
|
console.log(
|
|
3373
|
-
`[DEBUG-POD] \u274C handleAdFailure | inBreak=${this.inAdBreak}, showAds=${this.showAds},
|
|
3345
|
+
`[DEBUG-POD] \u274C handleAdFailure | inBreak=${this.inAdBreak}, showAds=${this.showAds}, remaining=${remaining}ms`
|
|
3374
3346
|
);
|
|
3347
|
+
if (remaining > 500 && this.inAdBreak) {
|
|
3348
|
+
console.log(
|
|
3349
|
+
`[DEBUG-POD] \u23F3 Ad failed but ${remaining}ms remaining - showing placeholder until duration expires`
|
|
3350
|
+
);
|
|
3351
|
+
this.showAds = true;
|
|
3352
|
+
this.ima.showPlaceholder();
|
|
3353
|
+
this.enforceAdHoldState();
|
|
3354
|
+
return;
|
|
3355
|
+
}
|
|
3356
|
+
console.log("[DEBUG-POD] \u23F9\uFE0F No remaining time - ending ad break now");
|
|
3375
3357
|
this.handleAdPodComplete();
|
|
3376
3358
|
}
|
|
3377
3359
|
startAdRequestWatchdog(token) {
|