stormcloud-video-player 0.8.33 → 0.8.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.
Files changed (44) hide show
  1. package/dist/stormcloud-vp.min.js +1 -1
  2. package/lib/index.cjs +143 -19
  3. package/lib/index.cjs.map +1 -1
  4. package/lib/index.d.cts +2 -0
  5. package/lib/index.d.ts +2 -0
  6. package/lib/index.js +143 -19
  7. package/lib/index.js.map +1 -1
  8. package/lib/player/AdBreakOrchestrator.cjs +36 -16
  9. package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
  10. package/lib/player/AdBreakOrchestrator.d.cts +3 -7
  11. package/lib/player/AdConfigManager.cjs +36 -1
  12. package/lib/player/AdConfigManager.cjs.map +1 -1
  13. package/lib/player/AdConfigManager.d.cts +1 -1
  14. package/lib/player/AdTimingService.d.cts +1 -1
  15. package/lib/player/HlsEngine.d.cts +1 -1
  16. package/lib/player/PlayerControls.d.cts +1 -1
  17. package/lib/player/Scte35CueManager.d.cts +1 -1
  18. package/lib/player/Scte35Parser.d.cts +1 -1
  19. package/lib/player/StormcloudVideoPlayer.cjs +143 -19
  20. package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
  21. package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
  22. package/lib/player/playerTypes.d.cts +1 -1
  23. package/lib/players/HlsPlayer.cjs +143 -19
  24. package/lib/players/HlsPlayer.cjs.map +1 -1
  25. package/lib/players/HlsPlayer.d.cts +1 -1
  26. package/lib/players/index.cjs +143 -19
  27. package/lib/players/index.cjs.map +1 -1
  28. package/lib/sdk/hlsAdPlayer.cjs +62 -0
  29. package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
  30. package/lib/sdk/hlsAdPlayer.d.cts +1 -1
  31. package/lib/sdk/pal.cjs +38 -2
  32. package/lib/sdk/pal.cjs.map +1 -1
  33. package/lib/{types-CSHvCbhZ.d.cts → types-cTqIKw_D.d.cts} +1 -0
  34. package/lib/ui/StormcloudVideoPlayer.cjs +143 -19
  35. package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
  36. package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
  37. package/lib/utils/browserCompat.cjs +1 -0
  38. package/lib/utils/browserCompat.cjs.map +1 -1
  39. package/lib/utils/browserCompat.d.cts +1 -0
  40. package/lib/utils/devUrl.cjs +102 -0
  41. package/lib/utils/devUrl.cjs.map +1 -0
  42. package/lib/utils/devUrl.d.cts +4 -0
  43. package/lib/utils/tracking.d.cts +1 -1
  44. package/package.json +1 -1
@@ -1291,12 +1291,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
1291
1291
  // ───────────────────────────────────────────────────────────────
1292
1292
  // IMA event listeners
1293
1293
  // ───────────────────────────────────────────────────────────────
1294
- /**
1295
- * Produces the next pod ad-request URL for the current break. Every request
1296
- * (initial and continuous-fetch top-up) carries pod macros (pmad/pmnd/pmxd,
1297
- * no ppos); pmxd tracks the remaining break time so top-up pods only ask for
1298
- * what still fits.
1299
- */ key: "nextAdRequestUrl",
1294
+ key: "nextAdRequestUrl",
1300
1295
  value: function nextAdRequestUrl(baseVastUrl) {
1301
1296
  var remaining = Math.min(this.timing.getWallClockRemainingAdMs(), this.timing.getDurationBudgetRemainingMs());
1302
1297
  var breakDurationMs = remaining > 0 ? remaining : void 0;
@@ -2425,7 +2420,9 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
2425
2420
  if (Math.abs(this.host.video.volume - restoredVolume) > 0.01) {
2426
2421
  this.host.video.volume = restoredVolume;
2427
2422
  }
2428
- if (this.host.shouldContinueLiveStreamDuringAds()) {
2423
+ this.host.video.style.visibility = "visible";
2424
+ this.host.video.style.opacity = "1";
2425
+ if (this.host.isLiveStream()) {
2429
2426
  var liveSyncPos = this.host.getLiveSyncPosition();
2430
2427
  if (liveSyncPos != null && liveSyncPos > this.host.video.currentTime) {
2431
2428
  if (this.debug) {
@@ -2433,16 +2430,39 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
2433
2430
  }
2434
2431
  this.host.video.currentTime = liveSyncPos;
2435
2432
  }
2436
- if (this.host.video.paused) {
2437
- var _this_host_video_play;
2438
- if (this.debug) console.log("[StormcloudVideoPlayer] Content video paused in live mode after ads, resuming playback");
2439
- (_this_host_video_play = this.host.video.play()) === null || _this_host_video_play === void 0 ? void 0 : _this_host_video_play.catch(function() {});
2440
- } else {
2441
- if (this.debug) console.log("[StormcloudVideoPlayer] Content video already playing in live mode after ads");
2433
+ }
2434
+ this.resumeContentPlayback();
2435
+ }
2436
+ },
2437
+ {
2438
+ key: "resumeContentPlayback",
2439
+ value: function resumeContentPlayback() {
2440
+ var _this = this;
2441
+ var attempt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
2442
+ var maxAttempts = 3;
2443
+ if (!this.host.video.paused) {
2444
+ if (this.debug && attempt === 0) {
2445
+ console.log("[StormcloudVideoPlayer] Content video already playing after ads");
2442
2446
  }
2443
- } else if (this.host.video.paused) {
2444
- var _this_host_video_play1;
2445
- (_this_host_video_play1 = this.host.video.play()) === null || _this_host_video_play1 === void 0 ? void 0 : _this_host_video_play1.catch(function() {});
2447
+ return;
2448
+ }
2449
+ if (this.debug) {
2450
+ console.log("[StormcloudVideoPlayer] Resuming content playback after ads (attempt ".concat(attempt + 1, "/").concat(maxAttempts, ")"));
2451
+ }
2452
+ var playResult = this.host.video.play();
2453
+ if (playResult && typeof playResult.catch === "function") {
2454
+ playResult.catch(function(error) {
2455
+ if (attempt + 1 >= maxAttempts) {
2456
+ if (_this.debug) {
2457
+ console.warn("[StormcloudVideoPlayer] Failed to resume content playback after ads:", error);
2458
+ }
2459
+ return;
2460
+ }
2461
+ var backoffMs = 250 * (attempt + 1);
2462
+ window.setTimeout(function() {
2463
+ _this.resumeContentPlayback(attempt + 1);
2464
+ }, backoffMs);
2465
+ });
2446
2466
  }
2447
2467
  }
2448
2468
  },