stormcloud-video-player 0.8.45 → 0.8.47

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.
@@ -18,6 +18,8 @@ interface AdBreakOrchestratorHost {
18
18
  getLiveSyncPosition(): number | undefined;
19
19
  restartHlsLoad(position: number): void;
20
20
  reloadLiveStream(): void;
21
+ recoverMediaError(): void;
22
+ requiresMediaPipelineResetAfterAds(): boolean;
21
23
  generatePodVastUrl(baseUrl: string, breakDurationMs?: number): string;
22
24
  }
23
25
  declare class AdBreakOrchestrator {
@@ -1511,31 +1511,67 @@ var HlsEngine = /*#__PURE__*/ function() {
1511
1511
  }
1512
1512
  }
1513
1513
  },
1514
+ {
1515
+ key: "recoverMediaError",
1516
+ value: function recoverMediaError() {
1517
+ if (!this.hls) {
1518
+ return;
1519
+ }
1520
+ try {
1521
+ this.hls.recoverMediaError();
1522
+ } catch (error) {
1523
+ if (this.debug) {
1524
+ console.warn("[StormcloudVideoPlayer] recoverMediaError() failed:", error);
1525
+ }
1526
+ }
1527
+ }
1528
+ },
1514
1529
  {
1515
1530
  key: "reloadLiveStream",
1516
1531
  value: function reloadLiveStream() {
1532
+ var _this = this;
1517
1533
  var hls = this.hls;
1518
1534
  if (!hls) {
1519
1535
  return;
1520
1536
  }
1521
1537
  if (this.debug) {
1522
- console.log("[StormcloudVideoPlayer] Hard-reloading live stream (detach \u2192 reset video \u2192 re-attach)");
1538
+ console.log("[StormcloudVideoPlayer] Hard-reloading live stream (destroy hls \u2192 reset video \u2192 fresh setupHls)");
1523
1539
  }
1524
1540
  try {
1525
1541
  this.reloadingLiveStream = true;
1526
1542
  hls.stopLoad();
1527
1543
  hls.detachMedia();
1544
+ hls.destroy();
1545
+ this.hls = void 0;
1528
1546
  try {
1529
1547
  this.video.removeAttribute("src");
1530
1548
  this.video.load();
1531
- } catch (unused) {}
1532
- hls.attachMedia(this.video);
1549
+ } catch (error) {
1550
+ console.warn("[StormcloudVideoPlayer] video.load() threw after src removal:", error);
1551
+ }
1533
1552
  } catch (error) {
1534
1553
  this.reloadingLiveStream = false;
1554
+ this.hls = void 0;
1535
1555
  if (this.debug) {
1536
- console.warn("[StormcloudVideoPlayer] Failed to hard-reload live stream:", error);
1556
+ console.warn("[StormcloudVideoPlayer] Failed to tear down during hard-reload:", error);
1537
1557
  }
1558
+ return;
1538
1559
  }
1560
+ var recreateDelayMs = 600;
1561
+ window.setTimeout(function() {
1562
+ if (_this.hls) {
1563
+ _this.reloadingLiveStream = false;
1564
+ return;
1565
+ }
1566
+ try {
1567
+ _this.setupHls();
1568
+ } catch (error) {
1569
+ _this.reloadingLiveStream = false;
1570
+ if (_this.debug) {
1571
+ console.warn("[StormcloudVideoPlayer] Failed to rebuild pipeline during hard-reload:", error);
1572
+ }
1573
+ }
1574
+ }, recreateDelayMs);
1539
1575
  }
1540
1576
  },
1541
1577
  {