@mottosports/motto-video-player 1.0.1-rc.22 → 1.0.1-rc.23
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 +19 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1336,7 +1336,7 @@ var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
|
|
|
1336
1336
|
var import_shaka_player2 = __toESM(require("shaka-player/dist/shaka-player.ui"));
|
|
1337
1337
|
|
|
1338
1338
|
// package.json
|
|
1339
|
-
var version = "1.0.1-rc.
|
|
1339
|
+
var version = "1.0.1-rc.23";
|
|
1340
1340
|
|
|
1341
1341
|
// src/hooks/useMuxAnalytics.ts
|
|
1342
1342
|
var useMuxAnalytics = (playerRef, muxConfig, onMuxReady, onMuxDataUpdate) => {
|
|
@@ -4121,8 +4121,13 @@ var Event = ({
|
|
|
4121
4121
|
const [loadingPlaylist, setLoadingPlaylist] = (0, import_react15.useState)(true);
|
|
4122
4122
|
const videosDataError = videosData?.some((video) => !!video.error);
|
|
4123
4123
|
(0, import_react15.useEffect)(() => {
|
|
4124
|
-
if (
|
|
4125
|
-
|
|
4124
|
+
if (isEventLoading || videosIsLoading || loadingApisState) {
|
|
4125
|
+
return;
|
|
4126
|
+
}
|
|
4127
|
+
const hasPlayablePlaylist = Boolean(activePlaylist);
|
|
4128
|
+
if (eventError || videosError || videosDataError && !hasPlayablePlaylist) {
|
|
4129
|
+
const firstVideoError = videosData?.find((video) => !!video.error)?.error;
|
|
4130
|
+
const errorObj = eventError || videosError || firstVideoError && new Error(firstVideoError) || new Error("default");
|
|
4126
4131
|
setError(errorObj);
|
|
4127
4132
|
if (events?.onError) {
|
|
4128
4133
|
events.onError(errorObj);
|
|
@@ -4130,7 +4135,17 @@ var Event = ({
|
|
|
4130
4135
|
} else {
|
|
4131
4136
|
setError(null);
|
|
4132
4137
|
}
|
|
4133
|
-
}, [
|
|
4138
|
+
}, [
|
|
4139
|
+
eventError,
|
|
4140
|
+
videosError,
|
|
4141
|
+
videosDataError,
|
|
4142
|
+
videosData,
|
|
4143
|
+
events,
|
|
4144
|
+
activePlaylist,
|
|
4145
|
+
isEventLoading,
|
|
4146
|
+
videosIsLoading,
|
|
4147
|
+
loadingApisState
|
|
4148
|
+
]);
|
|
4134
4149
|
(0, import_react15.useEffect)(() => {
|
|
4135
4150
|
const eventLoadedWithNoVideos = !isEventLoading && eventData && eventData.videoIds && (!eventData.videoIds || eventData?.videoIds?.length === 0) && !loadingApisState;
|
|
4136
4151
|
const allApisLoadedWithPotentialVideos = !isEventLoading && !videosIsLoading && eventData && !loadingApisState;
|