chore: show call participant mute and camera-off state

This commit is contained in:
2026-05-21 16:43:42 +05:30
parent 6267e52bdf
commit 4c5cf70ebc
7 changed files with 162 additions and 22 deletions
+15
View File
@@ -41,6 +41,21 @@ export const participantKey = (p: VoiceParticipant) => p.pubkey ?? p.identity
export const speakingParticipants = writable<VoiceParticipant[]>([])
export const participantMediaState = writable<
Map<string, {muted: boolean; cameraOn: boolean}>
>(new Map())
export const mediaStateByIdentity = derived(
[participantMediaState, currentVoiceSession],
([$media, $session]) =>
(identity: string) => {
if ($session?.room.localParticipant.identity === identity) {
return {muted: $session.muted, cameraOn: $session.cameraOn}
}
return $media.get(identity) ?? {muted: true, cameraOn: false}
},
)
export const isParticipantSpeaking = derived(
speakingParticipants,
$participants => (p: VoiceParticipant) =>