@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.mjs CHANGED
@@ -1295,7 +1295,7 @@ import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
1295
1295
  import shaka from "shaka-player/dist/shaka-player.ui";
1296
1296
 
1297
1297
  // package.json
1298
- var version = "1.0.1-rc.22";
1298
+ var version = "1.0.1-rc.23";
1299
1299
 
1300
1300
  // src/hooks/useMuxAnalytics.ts
1301
1301
  var useMuxAnalytics = (playerRef, muxConfig, onMuxReady, onMuxDataUpdate) => {
@@ -4080,8 +4080,13 @@ var Event = ({
4080
4080
  const [loadingPlaylist, setLoadingPlaylist] = useState4(true);
4081
4081
  const videosDataError = videosData?.some((video) => !!video.error);
4082
4082
  useEffect8(() => {
4083
- if (eventError || videosError || videosDataError) {
4084
- const errorObj = eventError || videosError || videosData?.find((video) => !!video.error)?.error && new Error(videosData?.find((video) => !!video.error)?.error) || new Error("default");
4083
+ if (isEventLoading || videosIsLoading || loadingApisState) {
4084
+ return;
4085
+ }
4086
+ const hasPlayablePlaylist = Boolean(activePlaylist);
4087
+ if (eventError || videosError || videosDataError && !hasPlayablePlaylist) {
4088
+ const firstVideoError = videosData?.find((video) => !!video.error)?.error;
4089
+ const errorObj = eventError || videosError || firstVideoError && new Error(firstVideoError) || new Error("default");
4085
4090
  setError(errorObj);
4086
4091
  if (events?.onError) {
4087
4092
  events.onError(errorObj);
@@ -4089,7 +4094,17 @@ var Event = ({
4089
4094
  } else {
4090
4095
  setError(null);
4091
4096
  }
4092
- }, [eventError, videosError, videosDataError, videosData, events]);
4097
+ }, [
4098
+ eventError,
4099
+ videosError,
4100
+ videosDataError,
4101
+ videosData,
4102
+ events,
4103
+ activePlaylist,
4104
+ isEventLoading,
4105
+ videosIsLoading,
4106
+ loadingApisState
4107
+ ]);
4093
4108
  useEffect8(() => {
4094
4109
  const eventLoadedWithNoVideos = !isEventLoading && eventData && eventData.videoIds && (!eventData.videoIds || eventData?.videoIds?.length === 0) && !loadingApisState;
4095
4110
  const allApisLoadedWithPotentialVideos = !isEventLoading && !videosIsLoading && eventData && !loadingApisState;