chore: show call participant mute and camera-off state #279
Reference in New Issue
Block a user
Delete Branch "userAdityaa/flotilla:call-participants"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #273. Other participants can now see when someone is muted or has their camera off. LiveKit track events keep remote state updated; your own state comes from the session. The sidebar participant list shows red mic/camera-off badges, and active video tiles show mute (or camera-off on camera streams only). Avatar-only tiles skip badges since that state is already obvious there. Call controls use matching purple-on / red-off styling with microphone-off and videocamera-off icons.
Screenshot
df1c66f240to4c5cf70ebc4c5cf70ebcto442829695b442829695bto2d37c24ba5@@ -44,2 +44,4 @@export const speakingParticipants = writable<VoiceParticipant[]>([])export const participantMediaState = writable<Map<string, {muted: boolean; cameraOn: boolean}>>(new Map(),Put the type annotation on the map, not the writable (to avoid redundant Map type)
@@ -93,0 +97,4 @@if (!m.has(identity)) return mconst next = new Map(m)next.delete(identity)return nextCould be simplified as
m => new Map([...m].filter(nthEq(0, identity)). Same thing below. No need to guard changes,updatetriggers regardless.@@ -290,9 +321,12 @@ export const joinVoiceRoom = async (}participantPubkeyMap.set(new Map())participantMediaState.set(new Map())These two stores seem redundant, I bet you could refactor pubkeyMap to mediaState instead of keep track of things separately
@@ -126,0 +139,4 @@source: Track.Source.Camera,})}for (const rp of room.remoteParticipants.values()) {We already loop over this, I don't see how this code will ever add a video tile?
@@ -189,3 +188,3 @@mediaToggleClass,"overflow-visible",!$voiceMicMuted && $isLocalSpeaking && "text-primary",!$voiceMicMuted && "text-primary",While we're at it, I think the unmuted state should not be primary colored.
2d37c24ba5tofd58de5de4