stormcloud-video-player 0.8.8 → 0.8.9
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 +2 -2
- package/lib/index.cjs +42 -7
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +42 -7
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +42 -7
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -0
- package/lib/players/HlsPlayer.cjs +42 -7
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +42 -7
- package/lib/players/index.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +42 -7
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -217,6 +217,7 @@ declare class StormcloudVideoPlayer {
|
|
|
217
217
|
private preloadPoolActive;
|
|
218
218
|
private preloadPoolLoopRunning;
|
|
219
219
|
private adDetectSentForCurrentBreak;
|
|
220
|
+
private adBreakEpoch;
|
|
220
221
|
private palNonce;
|
|
221
222
|
private palPlaybackStarted;
|
|
222
223
|
private readonly streamCorrelator;
|
package/lib/index.d.ts
CHANGED
|
@@ -217,6 +217,7 @@ declare class StormcloudVideoPlayer {
|
|
|
217
217
|
private preloadPoolActive;
|
|
218
218
|
private preloadPoolLoopRunning;
|
|
219
219
|
private adDetectSentForCurrentBreak;
|
|
220
|
+
private adBreakEpoch;
|
|
220
221
|
private palNonce;
|
|
221
222
|
private palPlaybackStarted;
|
|
222
223
|
private readonly streamCorrelator;
|
package/lib/index.js
CHANGED
|
@@ -2722,6 +2722,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2722
2722
|
this.preloadPoolActive = false;
|
|
2723
2723
|
this.preloadPoolLoopRunning = false;
|
|
2724
2724
|
this.adDetectSentForCurrentBreak = false;
|
|
2725
|
+
this.adBreakEpoch = 0;
|
|
2725
2726
|
this.palPlaybackStarted = false;
|
|
2726
2727
|
this.streamCorrelator = generateCorrelator();
|
|
2727
2728
|
this.consentSignals = {};
|
|
@@ -5269,7 +5270,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5269
5270
|
key: "preloadAdIntoPool",
|
|
5270
5271
|
value: function preloadAdIntoPool(vastUrl) {
|
|
5271
5272
|
return _async_to_generator(function() {
|
|
5272
|
-
var _this, loadPromise;
|
|
5273
|
+
var _this, epoch, loadPromise;
|
|
5273
5274
|
return _ts_generator(this, function(_state) {
|
|
5274
5275
|
_this = this;
|
|
5275
5276
|
if (this.isGamInCooldown()) {
|
|
@@ -5295,6 +5296,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5295
5296
|
if (this.config.debugAdTiming) {
|
|
5296
5297
|
console.log("[PRELOAD-POOL] \uD83D\uDCE5 Preloading ad into pool: ".concat(vastUrl));
|
|
5297
5298
|
}
|
|
5299
|
+
epoch = this.adBreakEpoch;
|
|
5298
5300
|
loadPromise = function() {
|
|
5299
5301
|
return _async_to_generator(function() {
|
|
5300
5302
|
var _this, hasAdError, adErrorPayload, errorListenerCleanup, continueLiveStreamDuringAds, preloadAd, errorListener, isNoFill, poolEntry, lateErrorListener, error;
|
|
@@ -5372,6 +5374,20 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5372
5374
|
2
|
|
5373
5375
|
];
|
|
5374
5376
|
}
|
|
5377
|
+
if (!this.preloadPoolActive || epoch !== this.adBreakEpoch) {
|
|
5378
|
+
if (this.config.debugAdTiming) {
|
|
5379
|
+
console.log("[PRELOAD-POOL] \uD83D\uDEAB Discarding preloaded ad - break ended during fetch");
|
|
5380
|
+
}
|
|
5381
|
+
if (errorListenerCleanup) {
|
|
5382
|
+
errorListenerCleanup();
|
|
5383
|
+
}
|
|
5384
|
+
try {
|
|
5385
|
+
preloadAd.destroy();
|
|
5386
|
+
} catch (unused) {}
|
|
5387
|
+
return [
|
|
5388
|
+
2
|
|
5389
|
+
];
|
|
5390
|
+
}
|
|
5375
5391
|
poolEntry = {
|
|
5376
5392
|
vastUrl: vastUrl,
|
|
5377
5393
|
adController: preloadAd,
|
|
@@ -5443,7 +5459,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5443
5459
|
key: "preloadPoolLoop",
|
|
5444
5460
|
value: function preloadPoolLoop(baseVastUrl) {
|
|
5445
5461
|
return _async_to_generator(function() {
|
|
5446
|
-
var remaining, newUrls, newUrl;
|
|
5462
|
+
var epoch, remaining, newUrls, newUrl;
|
|
5447
5463
|
return _ts_generator(this, function(_state) {
|
|
5448
5464
|
switch(_state.label){
|
|
5449
5465
|
case 0:
|
|
@@ -5453,12 +5469,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5453
5469
|
];
|
|
5454
5470
|
}
|
|
5455
5471
|
this.preloadPoolLoopRunning = true;
|
|
5472
|
+
epoch = this.adBreakEpoch;
|
|
5456
5473
|
if (this.config.debugAdTiming) {
|
|
5457
5474
|
console.log("[PRELOAD-POOL] \uD83D\uDD04 Starting continuous preload loop");
|
|
5458
5475
|
}
|
|
5459
5476
|
_state.label = 1;
|
|
5460
5477
|
case 1:
|
|
5461
|
-
if (!this.preloadPoolActive) return [
|
|
5478
|
+
if (!(this.preloadPoolActive && epoch === this.adBreakEpoch)) return [
|
|
5462
5479
|
3,
|
|
5463
5480
|
10
|
|
5464
5481
|
];
|
|
@@ -5503,7 +5520,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5503
5520
|
3,
|
|
5504
5521
|
8
|
|
5505
5522
|
];
|
|
5506
|
-
if (!this.preloadPoolActive || this.isGamInCooldown()) {
|
|
5523
|
+
if (!this.preloadPoolActive || epoch !== this.adBreakEpoch || this.isGamInCooldown()) {
|
|
5507
5524
|
return [
|
|
5508
5525
|
3,
|
|
5509
5526
|
8
|
|
@@ -5936,7 +5953,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5936
5953
|
key: "continuousFetchLoop",
|
|
5937
5954
|
value: function continuousFetchLoop(baseVastUrl) {
|
|
5938
5955
|
return _async_to_generator(function() {
|
|
5939
|
-
var _this, _loop, _ret;
|
|
5956
|
+
var _this, _loop, epoch, _ret;
|
|
5940
5957
|
return _ts_generator(this, function(_state) {
|
|
5941
5958
|
switch(_state.label){
|
|
5942
5959
|
case 0:
|
|
@@ -6046,9 +6063,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6046
6063
|
}
|
|
6047
6064
|
});
|
|
6048
6065
|
};
|
|
6066
|
+
epoch = this.adBreakEpoch;
|
|
6049
6067
|
_state.label = 1;
|
|
6050
6068
|
case 1:
|
|
6051
|
-
if (!(this.continuousFetchingActive && this.inAdBreak)) return [
|
|
6069
|
+
if (!(this.continuousFetchingActive && this.inAdBreak && epoch === this.adBreakEpoch)) return [
|
|
6052
6070
|
3,
|
|
6053
6071
|
3
|
|
6054
6072
|
];
|
|
@@ -6097,10 +6115,16 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6097
6115
|
key: "tryNextAvailableAdWithRateLimit",
|
|
6098
6116
|
value: function tryNextAvailableAdWithRateLimit() {
|
|
6099
6117
|
return _async_to_generator(function() {
|
|
6100
|
-
var backoffMultiplier, backoffDelay, effectiveMinInterval, timeSinceLastRequest, waitTime;
|
|
6118
|
+
var epoch, backoffMultiplier, backoffDelay, effectiveMinInterval, timeSinceLastRequest, waitTime;
|
|
6101
6119
|
return _ts_generator(this, function(_state) {
|
|
6102
6120
|
switch(_state.label){
|
|
6103
6121
|
case 0:
|
|
6122
|
+
if (!this.inAdBreak) {
|
|
6123
|
+
return [
|
|
6124
|
+
2
|
|
6125
|
+
];
|
|
6126
|
+
}
|
|
6127
|
+
epoch = this.adBreakEpoch;
|
|
6104
6128
|
if (this.consecutiveFailures >= this.maxConsecutiveFailures) {
|
|
6105
6129
|
if (this.config.debugAdTiming) {
|
|
6106
6130
|
console.log("[CONTINUOUS-FETCH] \uD83D\uDED1 Too many consecutive failures (".concat(this.consecutiveFailures, "), ending ad break gracefully"));
|
|
@@ -6132,6 +6156,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6132
6156
|
_state.sent();
|
|
6133
6157
|
_state.label = 2;
|
|
6134
6158
|
case 2:
|
|
6159
|
+
if (!this.inAdBreak || epoch !== this.adBreakEpoch) {
|
|
6160
|
+
return [
|
|
6161
|
+
2
|
|
6162
|
+
];
|
|
6163
|
+
}
|
|
6135
6164
|
return [
|
|
6136
6165
|
2,
|
|
6137
6166
|
this.tryNextAvailableAd(0)
|
|
@@ -6150,6 +6179,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6150
6179
|
return _ts_generator(this, function(_state) {
|
|
6151
6180
|
switch(_state.label){
|
|
6152
6181
|
case 0:
|
|
6182
|
+
if (!this.inAdBreak) {
|
|
6183
|
+
return [
|
|
6184
|
+
2
|
|
6185
|
+
];
|
|
6186
|
+
}
|
|
6153
6187
|
remaining = this.getRemainingAdMs();
|
|
6154
6188
|
if (remaining <= 500) {
|
|
6155
6189
|
if (this.config.debugAdTiming) {
|
|
@@ -7162,6 +7196,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7162
7196
|
if (this.config.debugAdTiming) {
|
|
7163
7197
|
console.log("[StormcloudVideoPlayer] \uD83C\uDFC1 Ad pod complete - cleaning up");
|
|
7164
7198
|
}
|
|
7199
|
+
this.adBreakEpoch++;
|
|
7165
7200
|
this.clearAdRequestWatchdog();
|
|
7166
7201
|
this.clearAdFailsafeTimer();
|
|
7167
7202
|
this.activeAdRequestToken = null;
|