Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,13 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
// find the participant
const participant = this.remoteParticipants.get(packet.participantIdentity);
if (packet.value.case === 'user') {
this.handleUserPacket(participant, packet.value.value, packet.kind, encryptionType);
this.handleUserPacket(
participant,
packet.value.value,
packet.kind,
encryptionType,
packet.participantIdentity,
);
} else if (packet.value.case === 'transcription') {
this.handleTranscription(participant, packet.value.value);
} else if (packet.value.case === 'sipDtmf') {
Expand Down Expand Up @@ -2148,6 +2154,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
userPacket: UserPacket,
kind: DataPacket_Kind,
encryptionType: Encryption_Type,
participantIdentity: string,
) => {
this.emit(
RoomEvent.DataReceived,
Expand All @@ -2156,6 +2163,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
kind,
userPacket.topic,
encryptionType,
participantIdentity,
);

// also emit on the participant
Expand Down Expand Up @@ -3061,6 +3069,7 @@ export type RoomEventCallbacks = {
kind?: DataPacket_Kind,
topic?: string,
encryptionType?: Encryption_Type,
participantIdentity?: string,
) => void;
sipDTMFReceived: (dtmf: SipDTMF, participant?: RemoteParticipant) => void;
transcriptionReceived: (
Expand Down
2 changes: 1 addition & 1 deletion src/room/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export enum RoomEvent {
* Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
* All participants in the room will receive the messages sent to the room.
*
* args: (payload: NonSharedUint8Array, participant: [[Participant]], kind: [[DataPacket_Kind]], topic?: string)
* args: (payload: NonSharedUint8Array, participant: [[Participant]] | undefined, kind: [[DataPacket_Kind]], topic?: string, encryptionType?: Encryption_Type, participantIdentity?: string)
*/
DataReceived = 'dataReceived',

Expand Down
Loading