@stream-io/video-react-sdk 1.23.1 → 1.24.1

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.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { hasAudio, hasScreenShareAudio, CallingState, hasVideo, hasScreenShare, OwnCapability, Browsers, VisibilityState, hasPausedTrack, getLogger, disposeOfMediaStream, SfuModels, isPinned, name, NoiseCancellationSettingsModeEnum, paginatedLayoutSortPreset, combineComparators, screenSharing, speakerLayoutSortPreset, CallTypes, defaultSortPreset, setSdkInfo } from '@stream-io/video-client';
2
2
  export * from '@stream-io/video-client';
3
- import { useCall, useCallStateHooks, useI18n, Restricted, useToggleCallRecording, useConnectedUser, StreamCallProvider, StreamVideoProvider, useStreamVideoClient } from '@stream-io/video-react-bindings';
3
+ import { useCall, useCallStateHooks, useI18n, Restricted, useToggleCallRecording, useConnectedUser, StreamCallProvider, StreamVideoProvider, useStreamVideoClient, useEffectEvent } from '@stream-io/video-react-bindings';
4
4
  export * from '@stream-io/video-react-bindings';
5
5
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
6
  import { useState, useEffect, Fragment as Fragment$1, createContext, useContext, useCallback, useMemo, useRef, isValidElement, forwardRef, useLayoutEffect, lazy, Suspense } from 'react';
@@ -2584,6 +2584,7 @@ const applyParticipantsFilter = (participants, filter) => {
2584
2584
  isPinned: isPinned(participant),
2585
2585
  hasVideo: hasVideo(participant),
2586
2586
  hasAudio: hasAudio(participant),
2587
+ hasScreenShare: hasScreenShare(participant),
2587
2588
  }, filter);
2588
2589
  return participants.filter(filterCallback);
2589
2590
  };
@@ -2615,8 +2616,8 @@ const useSpeakerLayoutSortPreset = (call, isOneOnOneCall) => {
2615
2616
  };
2616
2617
  const useRawRemoteParticipants = () => {
2617
2618
  const { useRawParticipants } = useCallStateHooks();
2618
- const rawParicipants = useRawParticipants();
2619
- return useMemo(() => rawParicipants.filter((p) => !p.isLocalParticipant), [rawParicipants]);
2619
+ const rawParticipants = useRawParticipants();
2620
+ return useMemo(() => rawParticipants.filter((p) => !p.isLocalParticipant), [rawParticipants]);
2620
2621
  };
2621
2622
  const resetSortPreset = (call) => {
2622
2623
  // reset the sorting to the default for the call type
@@ -2924,22 +2925,11 @@ const Host = () => {
2924
2925
  Host.displayName = 'PipLayout.Host';
2925
2926
  const PipLayout = { Pip, Host };
2926
2927
 
2927
- function useEffectEvent(cb) {
2928
- const cbRef = useRef(undefined);
2929
- useLayoutEffect(() => {
2930
- cbRef.current = cb;
2931
- }, [cb]);
2932
- return useCallback((...args) => {
2933
- const callback = cbRef.current;
2934
- callback?.(...args);
2935
- }, []);
2936
- }
2937
-
2938
2928
  const LivestreamPlayer = (props) => {
2939
2929
  const { callType, callId, ...restProps } = props;
2940
2930
  const client = useStreamVideoClient();
2941
2931
  const [call, setCall] = useState();
2942
- const onError = useEffectEvent(props.onError);
2932
+ const onError = useEffectEvent(props.onError ?? (() => { }));
2943
2933
  useEffect(() => {
2944
2934
  if (!client)
2945
2935
  return;
@@ -2955,7 +2945,7 @@ const LivestreamPlayer = (props) => {
2955
2945
  });
2956
2946
  setCall(undefined);
2957
2947
  };
2958
- }, [callId, callType, client, onError]);
2948
+ }, [callId, callType, client]);
2959
2949
  if (!call) {
2960
2950
  return null;
2961
2951
  }
@@ -2982,7 +2972,7 @@ const useLivestreamCall = (props) => {
2982
2972
  const joinBehavior = props.joinBehavior ?? 'asap';
2983
2973
  const canJoin = (joinBehavior === 'asap' && canJoinAsap) ||
2984
2974
  (joinBehavior === 'live' && canJoinLive);
2985
- const onError = useEffectEvent(props.onError);
2975
+ const onError = useEffectEvent(props.onError ?? (() => { }));
2986
2976
  useEffect(() => {
2987
2977
  if (call && call.state.callingState === CallingState.IDLE && canJoin) {
2988
2978
  call.join().catch((e) => {
@@ -2990,7 +2980,7 @@ const useLivestreamCall = (props) => {
2990
2980
  onError(e);
2991
2981
  });
2992
2982
  }
2993
- }, [call, canJoin, onError]);
2983
+ }, [call, canJoin]);
2994
2984
  return call;
2995
2985
  };
2996
2986
  const useCanJoinEarly = () => {
@@ -3016,7 +3006,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
3016
3006
  return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
3017
3007
  };
3018
3008
 
3019
- const [major, minor, patch] = ("1.23.1").split('.');
3009
+ const [major, minor, patch] = ("1.24.1").split('.');
3020
3010
  setSdkInfo({
3021
3011
  type: SfuModels.SdkType.REACT,
3022
3012
  major,