steep-balloon-41261
10/28/2022, 5:42 PMdry-elephant-14928
10/28/2022, 10:45 PMnarrow-action-3234
10/31/2022, 3:39 PMnarrow-action-3234
10/31/2022, 3:39 PMnarrow-action-3234
10/31/2022, 3:39 PMnarrow-action-3234
10/31/2022, 3:47 PMconst [roomParticipants, setRoomParticipants] = useState<
|
{
participants: Map<string,
RemoteParticipant>;
} |
undefined>
();
<LiveKitRoom
url={process.env.REACT_APP_LIVEKIT_WS_URL as string}
token={token}
onConnected={room => {
setLogLevel('debug');
onConnected(room);
room.on(RoomEvent.ParticipantConnected, () => {
updateParticipantSize(room);
});
room.on(RoomEvent.ParticipantDisconnected, () =>
updateParticipantSize(room),
);
updateParticipantSize(room);
setRoomCall(room);
}}
connectOptions={{}}
roomOptions={{
publishDefaults: {
simulcast: true,
},
videoCaptureDefaults: {
resolution: VideoPresets.h720.resolution,
},
}}
onLeave={() => history.push('/')}
/>;
Array.from(roomParticipants?.participants ?? []).length > 0 &&
Array.from(
room?.participants ?? [],
([key, value]: [
key: any,
value: RemoteParticipant,
]) => {
const peer = JSON.parse(
value.metadata as string,
);
if (value.permissions?.hidden) return null;
return (<
Participant peer={
peer
}
value={
value
}
/>
);
},
)
const Particiant = ({value}) => {
const {
isSpeaking,
microphonePublication
} = useParticipant(value);
console.log({
isSpeaking,
microphonePublication
})
}narrow-action-3234
10/31/2022, 3:53 PMnarrow-action-3234
10/31/2022, 3:57 PMnarrow-action-3234
10/31/2022, 3:57 PMnarrow-action-3234
10/31/2022, 4:01 PMmicrophonePublication and instead use value.isMicrophoneEnabled and works as expectednarrow-action-3234
10/31/2022, 4:02 PMdry-elephant-14928
11/01/2022, 10:17 AM