@stream-io/video-react-sdk 1.18.0 → 1.18.2

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.
@@ -14,3 +14,4 @@ export declare const useFilteredParticipants: ({ excludeLocalParticipant, filter
14
14
  export declare const applyParticipantsFilter: (participants: StreamVideoParticipant[], filter: ParticipantPredicate | ParticipantFilter) => StreamVideoParticipant[];
15
15
  export declare const usePaginatedLayoutSortPreset: (call: Call | undefined) => void;
16
16
  export declare const useSpeakerLayoutSortPreset: (call: Call | undefined, isOneOnOneCall: boolean) => void;
17
+ export declare const useRawRemoteParticipants: () => StreamVideoParticipant[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-sdk",
3
- "version": "1.18.0",
3
+ "version": "1.18.2",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -30,9 +30,9 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "@floating-ui/react": "^0.27.6",
33
- "@stream-io/video-client": "1.23.2",
33
+ "@stream-io/video-client": "1.23.3",
34
34
  "@stream-io/video-filters-web": "0.2.1",
35
- "@stream-io/video-react-bindings": "1.6.5",
35
+ "@stream-io/video-react-bindings": "1.6.6",
36
36
  "chart.js": "^4.4.4",
37
37
  "clsx": "^2.0.0",
38
38
  "react-chartjs-2": "^5.3.0"
@@ -45,7 +45,7 @@
45
45
  "@rollup/plugin-json": "^6.1.0",
46
46
  "@rollup/plugin-replace": "^6.0.2",
47
47
  "@rollup/plugin-typescript": "^12.1.2",
48
- "@stream-io/audio-filters-web": "^0.4.0",
48
+ "@stream-io/audio-filters-web": "^0.4.2",
49
49
  "@stream-io/video-styling": "^1.2.0",
50
50
  "@types/react": "^19.1.3",
51
51
  "@types/react-dom": "^19.1.3",
@@ -111,7 +111,7 @@ export const NoiseCancellationProvider = (
111
111
  noiseCancellation.isEnabled().then((e) => setIsEnabled(e));
112
112
  const unsubscribe = noiseCancellation.on('change', (v) => setIsEnabled(v));
113
113
  const init = (deinit.current || Promise.resolve())
114
- .then(() => noiseCancellation.init())
114
+ .then(() => noiseCancellation.init({ tracer: call.tracer }))
115
115
  .then(() => call.microphone.enableNoiseCancellation(noiseCancellation))
116
116
  .catch((e) => console.error(`Can't initialize noise cancellation`, e));
117
117
 
@@ -8,7 +8,10 @@ import {
8
8
  import { hasScreenShare } from '@stream-io/video-client';
9
9
  import { ParticipantView, useParticipantViewContext } from '../ParticipantView';
10
10
  import { ParticipantsAudio } from '../Audio';
11
- import { usePaginatedLayoutSortPreset } from './hooks';
11
+ import {
12
+ usePaginatedLayoutSortPreset,
13
+ useRawRemoteParticipants,
14
+ } from './hooks';
12
15
 
13
16
  /**
14
17
  * The props for the {@link LivestreamLayout} component.
@@ -62,12 +65,11 @@ export type LivestreamLayoutProps = {
62
65
  };
63
66
 
64
67
  export const LivestreamLayout = (props: LivestreamLayoutProps) => {
65
- const { useParticipants, useRemoteParticipants, useHasOngoingScreenShare } =
66
- useCallStateHooks();
68
+ const { useParticipants, useHasOngoingScreenShare } = useCallStateHooks();
67
69
  const call = useCall();
68
70
  const participants = useParticipants();
69
71
  const [currentSpeaker] = participants;
70
- const remoteParticipants = useRemoteParticipants();
72
+ const remoteParticipants = useRawRemoteParticipants();
71
73
  const hasOngoingScreenShare = useHasOngoingScreenShare();
72
74
  const presenter = hasOngoingScreenShare
73
75
  ? participants.find(hasScreenShare)
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useMemo, useState } from 'react';
2
- import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
2
+ import { useCall } from '@stream-io/video-react-bindings';
3
3
  import { StreamVideoParticipant } from '@stream-io/video-client';
4
4
  import clsx from 'clsx';
5
5
 
@@ -16,6 +16,7 @@ import {
16
16
  ParticipantPredicate,
17
17
  useFilteredParticipants,
18
18
  usePaginatedLayoutSortPreset,
19
+ useRawRemoteParticipants,
19
20
  } from './hooks';
20
21
 
21
22
  const GROUP_SIZE = 16;
@@ -137,8 +138,7 @@ export const PaginatedGridLayout = (props: PaginatedGridLayoutProps) => {
137
138
  ] = useState<HTMLDivElement | null>(null);
138
139
 
139
140
  const call = useCall();
140
- const { useRemoteParticipants } = useCallStateHooks();
141
- const remoteParticipants = useRemoteParticipants();
141
+ const remoteParticipants = useRawRemoteParticipants();
142
142
  const participants = useFilteredParticipants({
143
143
  excludeLocalParticipant,
144
144
  filterParticipants,
@@ -1,10 +1,8 @@
1
- import {
2
- useCall,
3
- useCallStateHooks,
4
- useI18n,
5
- } from '@stream-io/video-react-bindings';
1
+ import { useCall, useI18n } from '@stream-io/video-react-bindings';
6
2
  import { useEffect, useState } from 'react';
7
3
 
4
+ import { hasScreenShare } from '@stream-io/video-client';
5
+ import { Icon } from '../../../components';
8
6
  import { ParticipantsAudio } from '../Audio';
9
7
  import {
10
8
  DefaultParticipantViewUI,
@@ -16,9 +14,8 @@ import {
16
14
  ParticipantPredicate,
17
15
  useFilteredParticipants,
18
16
  usePaginatedLayoutSortPreset,
17
+ useRawRemoteParticipants,
19
18
  } from './hooks';
20
- import { hasScreenShare } from '@stream-io/video-client';
21
- import { Icon } from '../../../components';
22
19
 
23
20
  export type PipLayoutProps = {
24
21
  /**
@@ -121,8 +118,7 @@ const Pip = (props: PipLayoutProps) => {
121
118
  Pip.displayName = 'PipLayout.Pip';
122
119
 
123
120
  const Host = () => {
124
- const { useRemoteParticipants } = useCallStateHooks();
125
- const remoteParticipants = useRemoteParticipants();
121
+ const remoteParticipants = useRawRemoteParticipants();
126
122
  return <ParticipantsAudio participants={remoteParticipants} />;
127
123
  };
128
124
 
@@ -17,6 +17,7 @@ import {
17
17
  ParticipantFilter,
18
18
  ParticipantPredicate,
19
19
  useFilteredParticipants,
20
+ useRawRemoteParticipants,
20
21
  useSpeakerLayoutSortPreset,
21
22
  } from './hooks';
22
23
  import { useCalculateHardLimit } from '../../hooks/useCalculateHardLimit';
@@ -110,9 +111,9 @@ export const SpeakerLayout = ({
110
111
  muted,
111
112
  }: SpeakerLayoutProps) => {
112
113
  const call = useCall();
113
- const { useParticipants, useRemoteParticipants } = useCallStateHooks();
114
+ const { useParticipants } = useCallStateHooks();
114
115
  const allParticipants = useParticipants();
115
- const remoteParticipants = useRemoteParticipants();
116
+ const remoteParticipants = useRawRemoteParticipants();
116
117
  const [participantInSpotlight, ...otherParticipants] =
117
118
  useFilteredParticipants({ excludeLocalParticipant, filterParticipants });
118
119
  const [participantsBarWrapperElement, setParticipantsBarWrapperElement] =
@@ -109,6 +109,15 @@ export const useSpeakerLayoutSortPreset = (
109
109
  }, [call, isOneOnOneCall]);
110
110
  };
111
111
 
112
+ export const useRawRemoteParticipants = () => {
113
+ const { useRawParticipants } = useCallStateHooks();
114
+ const rawParicipants = useRawParticipants();
115
+ return useMemo(
116
+ () => rawParicipants.filter((p) => !p.isLocalParticipant),
117
+ [rawParicipants],
118
+ );
119
+ };
120
+
112
121
  const resetSortPreset = (call: Call) => {
113
122
  // reset the sorting to the default for the call type
114
123
  const callConfig = CallTypes.get(call.type);