@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.js +18 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -490,7 +490,7 @@ var supportsWidevinePersistentLicenses = () => {
|
|
|
490
490
|
var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
|
|
491
491
|
|
|
492
492
|
// package.json
|
|
493
|
-
var version = "1.0.1-rc.
|
|
493
|
+
var version = "1.0.1-rc.81";
|
|
494
494
|
|
|
495
495
|
// src/utils/licenseCache.ts
|
|
496
496
|
var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
|
|
@@ -1660,23 +1660,21 @@ var useLiveIndicator = (containerRef, playerRef, options = {}) => {
|
|
|
1660
1660
|
return { isLive: false, isNearEdge: false };
|
|
1661
1661
|
}
|
|
1662
1662
|
try {
|
|
1663
|
-
if (
|
|
1663
|
+
if (typeof player.isLive !== "function") {
|
|
1664
1664
|
return { isLive: false, isNearEdge: false };
|
|
1665
1665
|
}
|
|
1666
|
-
const
|
|
1667
|
-
if (!manifest) {
|
|
1668
|
-
return { isLive: false, isNearEdge: false };
|
|
1669
|
-
}
|
|
1670
|
-
const timeline = manifest.presentationTimeline;
|
|
1671
|
-
if (!timeline || typeof timeline.isLive !== "function") {
|
|
1672
|
-
return { isLive: false, isNearEdge: false };
|
|
1673
|
-
}
|
|
1674
|
-
const isLiveStream = timeline.isLive();
|
|
1666
|
+
const isLiveStream = player.isLive();
|
|
1675
1667
|
if (!isLiveStream) return { isLive: false, isNearEdge: false };
|
|
1676
1668
|
const videoElement = player.getMediaElement?.();
|
|
1677
1669
|
if (!videoElement) return { isLive: true, isNearEdge: false };
|
|
1678
|
-
|
|
1679
|
-
|
|
1670
|
+
if (typeof player.seekRange !== "function") {
|
|
1671
|
+
return { isLive: true, isNearEdge: false };
|
|
1672
|
+
}
|
|
1673
|
+
const seekRange = player.seekRange();
|
|
1674
|
+
if (!seekRange || seekRange.end === void 0) {
|
|
1675
|
+
return { isLive: true, isNearEdge: false };
|
|
1676
|
+
}
|
|
1677
|
+
const liveEdge = seekRange.end;
|
|
1680
1678
|
const currentTime = videoElement.currentTime;
|
|
1681
1679
|
const timeBehindLive = liveEdge - currentTime;
|
|
1682
1680
|
return {
|
|
@@ -1693,15 +1691,13 @@ var useLiveIndicator = (containerRef, playerRef, options = {}) => {
|
|
|
1693
1691
|
const player = playerRef.current;
|
|
1694
1692
|
if (!player) return;
|
|
1695
1693
|
try {
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
const liveEdge =
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
videoElement.currentTime = liveEdge;
|
|
1704
|
-
}
|
|
1694
|
+
if (typeof player.seekRange !== "function") return;
|
|
1695
|
+
const seekRange = player.seekRange();
|
|
1696
|
+
if (!seekRange || seekRange.end === void 0) return;
|
|
1697
|
+
const liveEdge = seekRange.end;
|
|
1698
|
+
const videoElement = player.getMediaElement?.();
|
|
1699
|
+
if (videoElement) {
|
|
1700
|
+
videoElement.currentTime = liveEdge;
|
|
1705
1701
|
}
|
|
1706
1702
|
} catch (error) {
|
|
1707
1703
|
console.error("Error seeking to live edge:", error);
|