@mottosports/motto-video-player 1.0.1-rc.80 → 1.0.1-rc.81

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/index.mjs CHANGED
@@ -449,7 +449,7 @@ var supportsWidevinePersistentLicenses = () => {
449
449
  import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
450
450
 
451
451
  // package.json
452
- var version = "1.0.1-rc.80";
452
+ var version = "1.0.1-rc.81";
453
453
 
454
454
  // src/utils/licenseCache.ts
455
455
  var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
@@ -1619,23 +1619,21 @@ var useLiveIndicator = (containerRef, playerRef, options = {}) => {
1619
1619
  return { isLive: false, isNearEdge: false };
1620
1620
  }
1621
1621
  try {
1622
- if (!player.getManifest || typeof player.getManifest !== "function") {
1622
+ if (typeof player.isLive !== "function") {
1623
1623
  return { isLive: false, isNearEdge: false };
1624
1624
  }
1625
- const manifest = player.getManifest();
1626
- if (!manifest) {
1627
- return { isLive: false, isNearEdge: false };
1628
- }
1629
- const timeline = manifest.presentationTimeline;
1630
- if (!timeline || typeof timeline.isLive !== "function") {
1631
- return { isLive: false, isNearEdge: false };
1632
- }
1633
- const isLiveStream = timeline.isLive();
1625
+ const isLiveStream = player.isLive();
1634
1626
  if (!isLiveStream) return { isLive: false, isNearEdge: false };
1635
1627
  const videoElement = player.getMediaElement?.();
1636
1628
  if (!videoElement) return { isLive: true, isNearEdge: false };
1637
- const liveEdge = timeline.getSeekRangeEnd?.() ?? timeline.getSegmentAvailabilityEnd?.();
1638
- if (liveEdge === void 0) return { isLive: true, isNearEdge: false };
1629
+ if (typeof player.seekRange !== "function") {
1630
+ return { isLive: true, isNearEdge: false };
1631
+ }
1632
+ const seekRange = player.seekRange();
1633
+ if (!seekRange || seekRange.end === void 0) {
1634
+ return { isLive: true, isNearEdge: false };
1635
+ }
1636
+ const liveEdge = seekRange.end;
1639
1637
  const currentTime = videoElement.currentTime;
1640
1638
  const timeBehindLive = liveEdge - currentTime;
1641
1639
  return {
@@ -1652,15 +1650,13 @@ var useLiveIndicator = (containerRef, playerRef, options = {}) => {
1652
1650
  const player = playerRef.current;
1653
1651
  if (!player) return;
1654
1652
  try {
1655
- const manifest = player.getManifest();
1656
- if (!manifest) return;
1657
- const timeline = manifest.presentationTimeline;
1658
- const liveEdge = timeline?.getSeekRangeEnd?.() ?? timeline?.getSegmentAvailabilityEnd?.();
1659
- if (liveEdge !== void 0) {
1660
- const videoElement = player.getMediaElement?.();
1661
- if (videoElement) {
1662
- videoElement.currentTime = liveEdge;
1663
- }
1653
+ if (typeof player.seekRange !== "function") return;
1654
+ const seekRange = player.seekRange();
1655
+ if (!seekRange || seekRange.end === void 0) return;
1656
+ const liveEdge = seekRange.end;
1657
+ const videoElement = player.getMediaElement?.();
1658
+ if (videoElement) {
1659
+ videoElement.currentTime = liveEdge;
1664
1660
  }
1665
1661
  } catch (error) {
1666
1662
  console.error("Error seeking to live edge:", error);