Create media items for session members not joined to LiveKit

This commit is contained in:
Robin
2025-10-03 19:14:48 -04:00
parent 86fb026be8
commit 1820cac3f6
5 changed files with 32 additions and 45 deletions

View File

@@ -66,7 +66,7 @@ export class Connection {
this.livekitAlias,
);
public readonly participantsIncludingSubscribers$;
private readonly participantsIncludingSubscribers$;
public readonly publishingParticipants$;
public readonly livekitRoom: LivekitRoom;
@@ -105,13 +105,11 @@ export class Connection {
? [membership]
: [],
)
// Find all associated publishing livekit participant objects
.flatMap((membership) => {
const participant = participants.find(
(p) =>
p.identity === `${membership.sender}:${membership.deviceId}`,
);
return participant ? [{ participant, membership }] : [];
// Pair with their associated LiveKit participant (if any)
.map((membership) => {
const id = `${membership.sender}:${membership.deviceId}`;
const participant = participants.find((p) => p.identity === id);
return { participant, membership };
}),
),
[],