@livekit/rtc-node 0.13.17 → 0.13.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio_frame.d.ts.map +1 -1
- package/dist/audio_source.cjs +1 -1
- package/dist/audio_source.cjs.map +1 -1
- package/dist/audio_source.js +1 -1
- package/dist/audio_source.js.map +1 -1
- package/dist/data_streams/stream_reader.cjs +2 -2
- package/dist/data_streams/stream_reader.cjs.map +1 -1
- package/dist/data_streams/stream_reader.js +2 -2
- package/dist/data_streams/stream_reader.js.map +1 -1
- package/dist/proto/audio_frame_pb.cjs.map +1 -1
- package/dist/proto/audio_frame_pb.js.map +1 -1
- package/dist/proto/data_stream_pb.cjs.map +1 -1
- package/dist/proto/data_stream_pb.js.map +1 -1
- package/dist/proto/e2ee_pb.cjs.map +1 -1
- package/dist/proto/e2ee_pb.js.map +1 -1
- package/dist/proto/ffi_pb.cjs.map +1 -1
- package/dist/proto/ffi_pb.js.map +1 -1
- package/dist/proto/handle_pb.cjs.map +1 -1
- package/dist/proto/handle_pb.js.map +1 -1
- package/dist/proto/participant_pb.cjs.map +1 -1
- package/dist/proto/participant_pb.js.map +1 -1
- package/dist/proto/room_pb.cjs.map +1 -1
- package/dist/proto/room_pb.js.map +1 -1
- package/dist/proto/rpc_pb.cjs.map +1 -1
- package/dist/proto/rpc_pb.js.map +1 -1
- package/dist/proto/stats_pb.cjs.map +1 -1
- package/dist/proto/stats_pb.js.map +1 -1
- package/dist/proto/track_pb.cjs.map +1 -1
- package/dist/proto/track_pb.js.map +1 -1
- package/dist/proto/track_publication_pb.cjs.map +1 -1
- package/dist/proto/track_publication_pb.js.map +1 -1
- package/dist/proto/video_frame_pb.cjs.map +1 -1
- package/dist/proto/video_frame_pb.js.map +1 -1
- package/dist/room.cjs +25 -4
- package/dist/room.cjs.map +1 -1
- package/dist/room.d.cts +2 -0
- package/dist/room.d.ts +2 -0
- package/dist/room.d.ts.map +1 -1
- package/dist/room.js +25 -4
- package/dist/room.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +9 -9
- package/src/audio_source.ts +1 -1
- package/src/data_streams/stream_reader.ts +4 -4
- package/src/proto/audio_frame_pb.ts +1 -1
- package/src/proto/data_stream_pb.ts +1 -1
- package/src/proto/e2ee_pb.ts +1 -1
- package/src/proto/ffi_pb.ts +1 -1
- package/src/proto/handle_pb.ts +1 -1
- package/src/proto/participant_pb.ts +1 -1
- package/src/proto/room_pb.ts +1 -1
- package/src/proto/rpc_pb.ts +1 -1
- package/src/proto/stats_pb.ts +1 -1
- package/src/proto/track_pb.ts +1 -1
- package/src/proto/track_publication_pb.ts +1 -1
- package/src/proto/video_frame_pb.ts +1 -1
- package/src/room.ts +31 -5
- package/src/version.ts +1 -1
package/src/room.ts
CHANGED
|
@@ -82,6 +82,8 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
|
|
|
82
82
|
private byteStreamHandlers = new Map<string, ByteStreamHandler>();
|
|
83
83
|
private textStreamHandlers = new Map<string, TextStreamHandler>();
|
|
84
84
|
|
|
85
|
+
private preConnectEvents: FfiEvent[] = [];
|
|
86
|
+
|
|
85
87
|
e2eeManager?: E2EEManager;
|
|
86
88
|
connectionState: ConnectionState = ConnectionState.CONN_DISCONNECTED;
|
|
87
89
|
|
|
@@ -180,6 +182,8 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
|
|
|
180
182
|
options,
|
|
181
183
|
});
|
|
182
184
|
|
|
185
|
+
FfiClient.instance.on(FfiClientEvent.FfiEvent, this.onFfiEvent);
|
|
186
|
+
|
|
183
187
|
const res = FfiClient.instance.request<ConnectResponse>({
|
|
184
188
|
message: {
|
|
185
189
|
case: 'connect',
|
|
@@ -210,8 +214,6 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
|
|
|
210
214
|
rp.trackPublications.set(publication.sid!, publication);
|
|
211
215
|
}
|
|
212
216
|
}
|
|
213
|
-
|
|
214
|
-
FfiClient.instance.on(FfiClientEvent.FfiEvent, this.onFfiEvent);
|
|
215
217
|
break;
|
|
216
218
|
case 'error':
|
|
217
219
|
default:
|
|
@@ -279,7 +281,22 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
|
|
|
279
281
|
|
|
280
282
|
private onFfiEvent = (ffiEvent: FfiEvent) => {
|
|
281
283
|
if (!this.localParticipant || !this.ffiHandle || !this.info) {
|
|
282
|
-
|
|
284
|
+
this.preConnectEvents.push(ffiEvent);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// process preConnectEvents if we received the connectCallback after the events were queued
|
|
289
|
+
for (const ev of this.preConnectEvents) {
|
|
290
|
+
this.processFfiEvent(ev);
|
|
291
|
+
}
|
|
292
|
+
this.preConnectEvents = [];
|
|
293
|
+
|
|
294
|
+
this.processFfiEvent(ffiEvent);
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
private processFfiEvent = (ffiEvent: FfiEvent) => {
|
|
298
|
+
if (!this.localParticipant || !this.ffiHandle || !this.info) {
|
|
299
|
+
throw new Error('processFfiEvent called before connect');
|
|
283
300
|
}
|
|
284
301
|
|
|
285
302
|
if (ffiEvent.message.case == 'rpcMethodInvocation') {
|
|
@@ -304,6 +321,9 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
|
|
|
304
321
|
}
|
|
305
322
|
|
|
306
323
|
const ev = ffiEvent.message.value.message;
|
|
324
|
+
if (process.env.LIVEKIT_DEBUG_LOG_ROOM_EVENTS) {
|
|
325
|
+
console.log('Room event:', ev);
|
|
326
|
+
}
|
|
307
327
|
if (ev.case == 'participantConnected') {
|
|
308
328
|
const participant = this.createRemoteParticipant(ev.value.info!);
|
|
309
329
|
this.remoteParticipants.set(participant.identity!, participant);
|
|
@@ -557,7 +577,10 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
|
|
|
557
577
|
const streamHandlerCallback = this.byteStreamHandlers.get(streamHeader.topic ?? '');
|
|
558
578
|
|
|
559
579
|
if (!streamHandlerCallback) {
|
|
560
|
-
log.debug(
|
|
580
|
+
log.debug(
|
|
581
|
+
'ignoring incoming byte stream due to no handler for topic: %s',
|
|
582
|
+
streamHeader.topic ?? 'undefined',
|
|
583
|
+
);
|
|
561
584
|
return;
|
|
562
585
|
}
|
|
563
586
|
let streamController: ReadableStreamDefaultController<DataStream_Chunk>;
|
|
@@ -588,7 +611,10 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
|
|
|
588
611
|
const streamHandlerCallback = this.textStreamHandlers.get(streamHeader.topic ?? '');
|
|
589
612
|
|
|
590
613
|
if (!streamHandlerCallback) {
|
|
591
|
-
log.debug(
|
|
614
|
+
log.debug(
|
|
615
|
+
'ignoring incoming text stream due to no handler for topic: %s',
|
|
616
|
+
streamHeader.topic ?? 'undefined',
|
|
617
|
+
);
|
|
592
618
|
return;
|
|
593
619
|
}
|
|
594
620
|
let streamController: ReadableStreamDefaultController<DataStream_Chunk>;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.13.
|
|
1
|
+
export const SDK_VERSION = "0.13.19";
|