stormcloud-video-player 0.8.36 → 0.8.38

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.
@@ -2429,11 +2429,56 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
2429
2429
  console.log("[StormcloudVideoPlayer] Live break end — snapping to live edge: ".concat(this.host.video.currentTime.toFixed(2), "s → ").concat(liveSyncPos.toFixed(2), "s"));
2430
2430
  }
2431
2431
  this.host.video.currentTime = liveSyncPos;
2432
+ this.host.restartHlsLoad(liveSyncPos);
2432
2433
  }
2434
+ this.resumeContentPlayback();
2435
+ this.monitorLiveResumeStall(0, this.host.video.currentTime);
2436
+ return;
2433
2437
  }
2434
2438
  this.resumeContentPlayback();
2435
2439
  }
2436
2440
  },
2441
+ {
2442
+ key: "monitorLiveResumeStall",
2443
+ value: function monitorLiveResumeStall(attempt, lastTime) {
2444
+ var _this = this;
2445
+ var maxAttempts = 3;
2446
+ var checkDelayMs = 2500;
2447
+ window.setTimeout(function() {
2448
+ if (_this.inAdBreak) {
2449
+ return;
2450
+ }
2451
+ var currentTime = _this.host.video.currentTime;
2452
+ var advanced = currentTime > lastTime + 0.25;
2453
+ if (advanced && !_this.host.video.paused) {
2454
+ if (_this.debug) {
2455
+ console.log("[StormcloudVideoPlayer] Live stream resumed successfully after ad break");
2456
+ }
2457
+ return;
2458
+ }
2459
+ if (attempt >= maxAttempts) {
2460
+ if (_this.debug) {
2461
+ console.warn("[StormcloudVideoPlayer] Live stream failed to resume after ".concat(maxAttempts, " recovery attempts (t=").concat(currentTime.toFixed(2), "s)"));
2462
+ }
2463
+ return;
2464
+ }
2465
+ if (_this.debug) {
2466
+ console.warn("[StormcloudVideoPlayer] Content stalled after ad break (t=".concat(currentTime.toFixed(2), "s) — forcing HLS reload at live edge (attempt ").concat(attempt + 1, "/").concat(maxAttempts, ")"));
2467
+ }
2468
+ var liveSyncPos = _this.host.getLiveSyncPosition();
2469
+ var reloadPos = liveSyncPos != null && liveSyncPos > currentTime ? liveSyncPos : currentTime;
2470
+ if (liveSyncPos != null && liveSyncPos > currentTime) {
2471
+ _this.host.video.currentTime = liveSyncPos;
2472
+ }
2473
+ _this.host.restartHlsLoad(reloadPos);
2474
+ if (_this.host.video.paused) {
2475
+ var _this_host_video_play;
2476
+ (_this_host_video_play = _this.host.video.play()) === null || _this_host_video_play === void 0 ? void 0 : _this_host_video_play.catch(function() {});
2477
+ }
2478
+ _this.monitorLiveResumeStall(attempt + 1, _this.host.video.currentTime);
2479
+ }, checkDelayMs);
2480
+ }
2481
+ },
2437
2482
  {
2438
2483
  key: "resumeContentPlayback",
2439
2484
  value: function resumeContentPlayback() {