stormcloud-video-player 0.3.4 → 0.3.5
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 +8 -5
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +8 -5
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +8 -5
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +8 -5
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +8 -5
- package/lib/players/index.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +8 -5
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -3712,21 +3712,24 @@ Error details: ${JSON.stringify(errorPayload)}` : ""
|
|
|
3712
3712
|
for (const duration of this.fetchedAdDurations.values()) {
|
|
3713
3713
|
totalFetchedDurationMs += duration * 1e3;
|
|
3714
3714
|
}
|
|
3715
|
-
const
|
|
3715
|
+
const fetchedCount = this.fetchedAdDurations.size;
|
|
3716
|
+
const averageDurationMs = fetchedCount > 0 ? totalFetchedDurationMs / fetchedCount : 30 * 1e3;
|
|
3717
|
+
const queuedButNotFetched = this.adPodAllUrls.length - fetchedCount;
|
|
3718
|
+
const estimatedQueuedDurationMs = queuedButNotFetched * averageDurationMs;
|
|
3719
|
+
const estimatedTotalDurationMs = totalFetchedDurationMs + estimatedQueuedDurationMs;
|
|
3720
|
+
const remainingTimeMs = this.targetAdBreakDurationMs - estimatedTotalDurationMs;
|
|
3716
3721
|
if (remainingTimeMs <= 0) {
|
|
3717
3722
|
if (this.config.debugAdTiming) {
|
|
3718
3723
|
console.log(
|
|
3719
|
-
`[ADAPTIVE-POD] \u2705 Target duration
|
|
3724
|
+
`[ADAPTIVE-POD] \u2705 Target duration met: Fetched=${totalFetchedDurationMs}ms + Queued(${queuedButNotFetched} ads)=${estimatedQueuedDurationMs}ms = ${estimatedTotalDurationMs}ms / Target=${this.targetAdBreakDurationMs}ms`
|
|
3720
3725
|
);
|
|
3721
3726
|
}
|
|
3722
3727
|
return 0;
|
|
3723
3728
|
}
|
|
3724
|
-
const fetchedCount = this.fetchedAdDurations.size;
|
|
3725
|
-
const averageDurationMs = fetchedCount > 0 ? totalFetchedDurationMs / fetchedCount : 30 * 1e3;
|
|
3726
3729
|
const additionalAds = Math.ceil(remainingTimeMs / averageDurationMs);
|
|
3727
3730
|
if (this.config.debugAdTiming) {
|
|
3728
3731
|
console.log(
|
|
3729
|
-
`[ADAPTIVE-POD] \u{1F4CA} Need ${additionalAds} more ads | Fetched: ${totalFetchedDurationMs}ms
|
|
3732
|
+
`[ADAPTIVE-POD] \u{1F4CA} Need ${additionalAds} more ads | Fetched: ${totalFetchedDurationMs}ms (${fetchedCount} ads) | Queued: ${estimatedQueuedDurationMs}ms (${queuedButNotFetched} ads) | Target: ${this.targetAdBreakDurationMs}ms | Remaining: ${remainingTimeMs}ms | Avg duration: ${averageDurationMs}ms`
|
|
3730
3733
|
);
|
|
3731
3734
|
}
|
|
3732
3735
|
return additionalAds;
|