Skip to content
Draft
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
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,
type RoomOptions,
type RtcConfiguration,
} from './room.js';
export { RpcError, type PerformRpcParams, type RpcInvocationData } from './rpc.js';
export {
LocalAudioTrack,
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
Loading