Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/thirty-steaks-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/rtc-node': patch
---

Update to livekit ffi 0.12.73
2 changes: 1 addition & 1 deletion packages/livekit-rtc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@datastructures-js/deque": "1.0.8",
"@livekit/mutex": "^1.0.0",
"@livekit/rtc-ffi-bindings": "0.12.68",
"@livekit/rtc-ffi-bindings": "0.12.73",
"@livekit/typed-emitter": "^3.0.0",
"pino": "^9.0.0",
"pino-pretty": "^13.0.0"
Expand Down
9 changes: 8 additions & 1 deletion packages/livekit-rtc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ export {
TrackSource,
} from '@livekit/rtc-ffi-bindings';
export { VideoBufferType, VideoCodec, VideoRotation } from '@livekit/rtc-ffi-bindings';
export { ConnectError, Room, RoomEvent, type RoomOptions, type RtcConfiguration } from './room.js';
export {
ConnectError,
Room,
RoomEvent,
type RoomDataStreamOptions,
Comment thread
lukasIO marked this conversation as resolved.
type RoomOptions,
type RtcConfiguration,
} from './room.js';
Comment thread
1egoman marked this conversation as resolved.
export { RpcError, type PerformRpcParams, type RpcInvocationData } from './rpc.js';
export {
LocalAudioTrack,
Expand Down
8 changes: 7 additions & 1 deletion packages/livekit-rtc/src/participant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ export class LocalParticipant extends Participant {
destinationIdentities?: Array<string>;
streamId?: string;
senderIdentity?: string;
totalSize?: number;
}): Promise<TextStreamWriter> {
Comment thread
1egoman marked this conversation as resolved.
const senderIdentity = options?.senderIdentity ?? this.identity;
const streamId = options?.streamId ?? crypto.randomUUID();
Expand All @@ -287,6 +288,7 @@ export class LocalParticipant extends Participant {
mimeType: 'text/plain',
topic: options?.topic ?? '',
timestamp: Date.now(),
totalSize: options?.totalSize,
};

const headerReq = new SendStreamHeaderRequest({
Expand All @@ -298,6 +300,7 @@ export class LocalParticipant extends Participant {
mimeType: info.mimeType,
topic: info.topic,
timestamp: numberToBigInt(info.timestamp),
totalLength: numberToBigInt(info.totalSize),
Comment thread
1egoman marked this conversation as resolved.
attributes: options?.attributes,
contentHeader: {
case: 'textHeader',
Expand Down Expand Up @@ -384,7 +387,10 @@ export class LocalParticipant extends Participant {
streamId?: string;
},
) {
const writer = await this.streamText(options);
const writer = await this.streamText({
...options,
totalSize: new TextEncoder().encode(text).byteLength,
Comment thread
1egoman marked this conversation as resolved.
});
await writer.write(text);
await writer.close();
return writer.info;
Expand Down
10 changes: 10 additions & 0 deletions packages/livekit-rtc/src/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
type IceServer,
IceTransportType,
type ReadyForRoomEventResponse,
RoomDataStreamOptions,
type RoomInfo,
type SimulateScenarioCallback,
type SimulateScenarioKind,
Expand Down Expand Up @@ -58,6 +59,8 @@ import { RemoteTrackPublication } from './track_publication.js';
import type { ChatMessage } from './types.js';
import { bigIntToNumber } from './utils.js';

export { RoomDataStreamOptions };

export interface RtcConfiguration {
iceTransportType: IceTransportType;
continualGatheringPolicy: ContinualGatheringPolicy;
Expand Down Expand Up @@ -273,6 +276,13 @@ export class Room extends (EventEmitter as new () => TypedEmitter<RoomCallbacks>
*/
async connect(url: string, token: string, opts?: RoomOptions) {
const options = { ...defaultRoomOptions, ...opts };
// The Node SDK still implements data streams in TypeScript on top of raw FFI
// packets, so always advertise only legacy (v1) data stream support to other
// clients, preserving any other data stream options provided by the user.
options.dataStream = new RoomDataStreamOptions({
...options.dataStream,
useLegacyClientImplementation: true,
});
const e2eeEnabled = options.encryption || options.e2ee;
const e2eeOptions = options.encryption
? { ...defaultE2EEOptions, ...options.encryption }
Expand Down
50 changes: 25 additions & 25 deletions pnpm-lock.yaml
Comment thread
1egoman marked this conversation as resolved.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading