@livekit/rtc-node 0.11.1 → 0.12.0
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.cjs +94 -0
- package/dist/audio_frame.cjs.map +1 -0
- package/dist/audio_frame.js +64 -67
- package/dist/audio_frame.js.map +1 -1
- package/dist/audio_resampler.cjs +153 -0
- package/dist/audio_resampler.cjs.map +1 -0
- package/dist/audio_resampler.js +129 -134
- package/dist/audio_resampler.js.map +1 -1
- package/dist/audio_source.cjs +116 -0
- package/dist/audio_source.cjs.map +1 -0
- package/dist/audio_source.js +92 -85
- package/dist/audio_source.js.map +1 -1
- package/dist/audio_stream.cjs +104 -0
- package/dist/audio_stream.cjs.map +1 -0
- package/dist/audio_stream.js +77 -78
- package/dist/audio_stream.js.map +1 -1
- package/dist/e2ee.cjs +268 -0
- package/dist/e2ee.cjs.map +1 -0
- package/dist/e2ee.d.ts.map +1 -1
- package/dist/e2ee.js +244 -221
- package/dist/e2ee.js.map +1 -1
- package/dist/ffi_client.cjs +101 -0
- package/dist/ffi_client.cjs.map +1 -0
- package/dist/ffi_client.js +73 -48
- package/dist/ffi_client.js.map +1 -1
- package/dist/index.cjs +188 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +130 -48
- package/dist/index.js.map +1 -1
- package/dist/napi/native.d.cjs +17 -0
- package/dist/napi/native.d.cjs.map +1 -0
- package/dist/napi/native.d.js +1 -0
- package/dist/napi/native.d.js.map +1 -0
- package/dist/napi/native.d.ts +5 -5
- package/dist/native.cjs +301 -0
- package/dist/native.d.ts +19 -0
- package/dist/native.js +15 -0
- package/dist/participant.cjs +388 -0
- package/dist/participant.cjs.map +1 -0
- package/dist/participant.js +363 -339
- package/dist/participant.js.map +1 -1
- package/dist/proto/audio_frame_pb.cjs +193 -0
- package/dist/proto/audio_frame_pb.cjs.map +1 -0
- package/dist/proto/audio_frame_pb.js +120 -320
- package/dist/proto/audio_frame_pb.js.map +1 -1
- package/dist/proto/e2ee_pb.cjs +131 -0
- package/dist/proto/e2ee_pb.cjs.map +1 -0
- package/dist/proto/e2ee_pb.js +76 -202
- package/dist/proto/e2ee_pb.js.map +1 -1
- package/dist/proto/ffi_pb.cjs +76 -0
- package/dist/proto/ffi_pb.cjs.map +1 -0
- package/dist/proto/ffi_pb.js +33 -92
- package/dist/proto/ffi_pb.js.map +1 -1
- package/dist/proto/handle_pb.cjs +33 -0
- package/dist/proto/handle_pb.cjs.map +1 -0
- package/dist/proto/handle_pb.js +6 -22
- package/dist/proto/handle_pb.js.map +1 -1
- package/dist/proto/participant_pb.cjs +50 -0
- package/dist/proto/participant_pb.cjs.map +1 -0
- package/dist/proto/participant_pb.js +19 -57
- package/dist/proto/participant_pb.js.map +1 -1
- package/dist/proto/room_pb.cjs +370 -0
- package/dist/proto/room_pb.cjs.map +1 -0
- package/dist/proto/room_pb.js +239 -632
- package/dist/proto/room_pb.js.map +1 -1
- package/dist/proto/rpc_pb.cjs +63 -0
- package/dist/proto/rpc_pb.cjs.map +1 -0
- package/dist/proto/rpc_pb.js +26 -72
- package/dist/proto/rpc_pb.js.map +1 -1
- package/dist/proto/stats_pb.cjs +256 -0
- package/dist/proto/stats_pb.cjs.map +1 -0
- package/dist/proto/stats_pb.js +175 -456
- package/dist/proto/stats_pb.js.map +1 -1
- package/dist/proto/track_pb.cjs +116 -0
- package/dist/proto/track_pb.cjs.map +1 -0
- package/dist/proto/track_pb.js +65 -171
- package/dist/proto/track_pb.js.map +1 -1
- package/dist/proto/video_frame_pb.cjs +161 -0
- package/dist/proto/video_frame_pb.cjs.map +1 -0
- package/dist/proto/video_frame_pb.js +101 -269
- package/dist/proto/video_frame_pb.js.map +1 -1
- package/dist/room.cjs +440 -0
- package/dist/room.cjs.map +1 -0
- package/dist/room.js +384 -373
- package/dist/room.js.map +1 -1
- package/dist/rpc.cjs +89 -0
- package/dist/rpc.cjs.map +1 -0
- package/dist/rpc.js +59 -63
- package/dist/rpc.js.map +1 -1
- package/dist/track.cjs +100 -0
- package/dist/track.cjs.map +1 -0
- package/dist/track.js +66 -62
- package/dist/track.js.map +1 -1
- package/dist/track_publication.cjs +106 -0
- package/dist/track_publication.cjs.map +1 -0
- package/dist/track_publication.js +76 -74
- package/dist/track_publication.js.map +1 -1
- package/dist/transcription.cjs +17 -0
- package/dist/transcription.cjs.map +1 -0
- package/dist/transcription.js +0 -1
- package/dist/transcription.js.map +1 -1
- package/dist/types.cjs +17 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.js +0 -1
- package/dist/types.js.map +1 -1
- package/dist/version.cjs +29 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +4 -1
- package/dist/version.js.map +1 -1
- package/dist/video_frame.cjs +242 -0
- package/dist/video_frame.cjs.map +1 -0
- package/dist/video_frame.js +212 -201
- package/dist/video_frame.js.map +1 -1
- package/dist/video_source.cjs +63 -0
- package/dist/video_source.cjs.map +1 -0
- package/dist/video_source.d.ts.map +1 -1
- package/dist/video_source.js +42 -37
- package/dist/video_source.js.map +1 -1
- package/dist/video_stream.cjs +103 -0
- package/dist/video_stream.cjs.map +1 -0
- package/dist/video_stream.js +76 -77
- package/dist/video_stream.js.map +1 -1
- package/package.json +18 -9
- package/src/audio_frame.ts +2 -2
- package/src/audio_source.ts +2 -2
- package/src/e2ee.ts +2 -2
- package/src/napi/native.d.ts +5 -5
- package/src/version.ts +1 -1
- package/src/video_frame.ts +1 -1
- package/src/video_source.ts +5 -1
package/dist/ffi_client.js
CHANGED
|
@@ -1,50 +1,75 @@
|
|
|
1
|
-
import { create, fromBinary, toBinary } from
|
|
2
|
-
import EventEmitter from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
import { create, fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
2
|
+
import EventEmitter from "events";
|
|
3
|
+
import {
|
|
4
|
+
FfiHandle,
|
|
5
|
+
livekitCopyBuffer,
|
|
6
|
+
livekitDispose,
|
|
7
|
+
livekitFfiRequest,
|
|
8
|
+
livekitInitialize,
|
|
9
|
+
livekitRetrievePtr
|
|
10
|
+
} from "./napi/native.js";
|
|
11
|
+
import {
|
|
12
|
+
FfiEvent,
|
|
13
|
+
FfiEventSchema,
|
|
14
|
+
FfiRequest,
|
|
15
|
+
FfiRequestSchema,
|
|
16
|
+
FfiResponse,
|
|
17
|
+
FfiResponseSchema
|
|
18
|
+
} from "./proto/ffi_pb.js";
|
|
19
|
+
import { SDK_VERSION } from "./version.js";
|
|
20
|
+
var FfiClientEvent = /* @__PURE__ */ ((FfiClientEvent2) => {
|
|
21
|
+
FfiClientEvent2["FfiEvent"] = "ffi_event";
|
|
22
|
+
return FfiClientEvent2;
|
|
23
|
+
})(FfiClientEvent || {});
|
|
24
|
+
class FfiClient extends EventEmitter {
|
|
25
|
+
/** @internal */
|
|
26
|
+
static get instance() {
|
|
27
|
+
if (!FfiClient._client) FfiClient._client = new FfiClient();
|
|
28
|
+
return FfiClient._client;
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.setMaxListeners(0);
|
|
33
|
+
livekitInitialize(
|
|
34
|
+
(event_data) => {
|
|
35
|
+
const event = fromBinary(FfiEventSchema, event_data);
|
|
36
|
+
this.emit("ffi_event" /* FfiEvent */, event);
|
|
37
|
+
},
|
|
38
|
+
true,
|
|
39
|
+
SDK_VERSION
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
request(req) {
|
|
43
|
+
const request = create(FfiRequestSchema, req);
|
|
44
|
+
const req_data = toBinary(FfiRequestSchema, request);
|
|
45
|
+
const res_data = livekitFfiRequest(req_data);
|
|
46
|
+
return fromBinary(FfiResponseSchema, res_data).message.value;
|
|
47
|
+
}
|
|
48
|
+
copyBuffer(ptr, len) {
|
|
49
|
+
return livekitCopyBuffer(ptr, len);
|
|
50
|
+
}
|
|
51
|
+
retrievePtr(data) {
|
|
52
|
+
return livekitRetrievePtr(data);
|
|
53
|
+
}
|
|
54
|
+
async waitFor(predicate) {
|
|
55
|
+
return new Promise((resolve) => {
|
|
56
|
+
const listener = (ev) => {
|
|
57
|
+
if (predicate(ev)) {
|
|
58
|
+
this.off("ffi_event" /* FfiEvent */, listener);
|
|
59
|
+
resolve(ev.message.value);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
this.on("ffi_event" /* FfiEvent */, listener);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
49
65
|
}
|
|
66
|
+
export {
|
|
67
|
+
FfiClient,
|
|
68
|
+
FfiClientEvent,
|
|
69
|
+
FfiEvent,
|
|
70
|
+
FfiHandle,
|
|
71
|
+
FfiRequest,
|
|
72
|
+
FfiResponse,
|
|
73
|
+
livekitDispose as dispose
|
|
74
|
+
};
|
|
50
75
|
//# sourceMappingURL=ffi_client.js.map
|
package/dist/ffi_client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/ffi_client.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { MessageInitShape } from '@bufbuild/protobuf';\nimport { create, fromBinary, toBinary } from '@bufbuild/protobuf';\nimport type { TypedEventEmitter as TypedEmitter } from '@livekit/typed-emitter';\nimport EventEmitter from 'events';\nimport {\n FfiHandle,\n livekitCopyBuffer,\n livekitDispose,\n livekitFfiRequest,\n livekitInitialize,\n livekitRetrievePtr,\n} from './napi/native.js';\nimport {\n FfiEvent,\n FfiEventSchema,\n FfiRequest,\n FfiRequestSchema,\n FfiResponse,\n FfiResponseSchema,\n} from './proto/ffi_pb.js';\nimport { SDK_VERSION } from './version.js';\n\nexport { FfiHandle, FfiEvent, FfiResponse, FfiRequest, livekitDispose as dispose };\n\nexport type FfiClientCallbacks = {\n ffi_event: (event: FfiEvent) => void;\n};\n\nexport enum FfiClientEvent {\n FfiEvent = 'ffi_event',\n}\n\nexport class FfiClient extends (EventEmitter as new () => TypedEmitter<FfiClientCallbacks>) {\n static _client?: FfiClient;\n\n /** @internal */\n static get instance(): FfiClient {\n if (!FfiClient._client) FfiClient._client = new FfiClient();\n\n return FfiClient._client;\n }\n\n constructor() {\n super();\n this.setMaxListeners(0);\n\n livekitInitialize(\n (event_data: Uint8Array) => {\n const event = fromBinary(FfiEventSchema, event_data);\n this.emit(FfiClientEvent.FfiEvent, event);\n },\n true,\n SDK_VERSION,\n );\n }\n\n request<T>(req: MessageInitShape<typeof FfiRequestSchema>): T {\n const request = create(FfiRequestSchema, req);\n const req_data = toBinary(FfiRequestSchema, request);\n const res_data = livekitFfiRequest(req_data);\n return fromBinary(FfiResponseSchema, res_data).message.value as T;\n }\n\n copyBuffer(ptr: bigint, len: number): Uint8Array {\n return livekitCopyBuffer(ptr, len);\n }\n\n retrievePtr(data: Uint8Array): bigint {\n return livekitRetrievePtr(data);\n }\n\n async waitFor<T>(predicate: (ev: FfiEvent) => boolean): Promise<T> {\n return new Promise<T>((resolve) => {\n const listener = (ev: FfiEvent) => {\n if (predicate(ev)) {\n this.off(FfiClientEvent.FfiEvent, listener);\n resolve(ev.message.value as T);\n }\n };\n this.on(FfiClientEvent.FfiEvent, listener);\n });\n }\n}\n"],"mappings":"AAIA,SAAS,QAAQ,YAAY,gBAAgB;AAE7C,OAAO,kBAAkB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAQrB,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,cAAW;AADD,SAAAA;AAAA,GAAA;AAIL,MAAM,kBAAmB,aAA4D;AAAA;AAAA,EAI1F,WAAW,WAAsB;AAC/B,QAAI,CAAC,UAAU,QAAS,WAAU,UAAU,IAAI,UAAU;AAE1D,WAAO,UAAU;AAAA,EACnB;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,gBAAgB,CAAC;AAEtB;AAAA,MACE,CAAC,eAA2B;AAC1B,cAAM,QAAQ,WAAW,gBAAgB,UAAU;AACnD,aAAK,KAAK,4BAAyB,KAAK;AAAA,MAC1C;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,QAAW,KAAmD;AAC5D,UAAM,UAAU,OAAO,kBAAkB,GAAG;AAC5C,UAAM,WAAW,SAAS,kBAAkB,OAAO;AACnD,UAAM,WAAW,kBAAkB,QAAQ;AAC3C,WAAO,WAAW,mBAAmB,QAAQ,EAAE,QAAQ;AAAA,EACzD;AAAA,EAEA,WAAW,KAAa,KAAyB;AAC/C,WAAO,kBAAkB,KAAK,GAAG;AAAA,EACnC;AAAA,EAEA,YAAY,MAA0B;AACpC,WAAO,mBAAmB,IAAI;AAAA,EAChC;AAAA,EAEA,MAAM,QAAW,WAAkD;AACjE,WAAO,IAAI,QAAW,CAAC,YAAY;AACjC,YAAM,WAAW,CAAC,OAAiB;AACjC,YAAI,UAAU,EAAE,GAAG;AACjB,eAAK,IAAI,4BAAyB,QAAQ;AAC1C,kBAAQ,GAAG,QAAQ,KAAU;AAAA,QAC/B;AAAA,MACF;AACA,WAAK,GAAG,4BAAyB,QAAQ;AAAA,IAC3C,CAAC;AAAA,EACH;AACF;","names":["FfiClientEvent"]}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var src_exports = {};
|
|
20
|
+
__export(src_exports, {
|
|
21
|
+
AudioFrame: () => import_audio_frame.AudioFrame,
|
|
22
|
+
AudioResampler: () => import_audio_resampler.AudioResampler,
|
|
23
|
+
AudioResamplerQuality: () => import_audio_resampler.AudioResamplerQuality,
|
|
24
|
+
AudioSource: () => import_audio_source.AudioSource,
|
|
25
|
+
AudioStream: () => import_audio_stream.AudioStream,
|
|
26
|
+
AudioTrack: () => import_track.AudioTrack,
|
|
27
|
+
ConnectError: () => import_room.ConnectError,
|
|
28
|
+
ConnectionQuality: () => import_room_pb2.ConnectionQuality,
|
|
29
|
+
ConnectionState: () => import_room_pb2.ConnectionState,
|
|
30
|
+
ContinualGatheringPolicy: () => import_room_pb2.ContinualGatheringPolicy,
|
|
31
|
+
DataPacketKind: () => import_room_pb2.DataPacketKind,
|
|
32
|
+
E2EEManager: () => import_e2ee.E2EEManager,
|
|
33
|
+
E2EEOptions: () => import_e2ee.E2EEOptions,
|
|
34
|
+
EncryptionState: () => import_e2ee_pb.EncryptionState,
|
|
35
|
+
EncryptionType: () => import_e2ee_pb.EncryptionType,
|
|
36
|
+
FrameCryptor: () => import_e2ee.FrameCryptor,
|
|
37
|
+
IceServer: () => IceServer,
|
|
38
|
+
IceTransportType: () => import_room_pb2.IceTransportType,
|
|
39
|
+
KeyProvider: () => import_e2ee.KeyProvider,
|
|
40
|
+
KeyProviderOptions: () => import_e2ee.KeyProviderOptions,
|
|
41
|
+
LocalAudioTrack: () => import_track.LocalAudioTrack,
|
|
42
|
+
LocalParticipant: () => import_participant.LocalParticipant,
|
|
43
|
+
LocalTrack: () => import_track.LocalTrack,
|
|
44
|
+
LocalTrackPublication: () => import_track_publication.LocalTrackPublication,
|
|
45
|
+
LocalVideoTrack: () => import_track.LocalVideoTrack,
|
|
46
|
+
Participant: () => import_participant.Participant,
|
|
47
|
+
ParticipantKind: () => import_participant_pb.ParticipantKind,
|
|
48
|
+
RemoteAudioTrack: () => import_track.RemoteAudioTrack,
|
|
49
|
+
RemoteParticipant: () => import_participant.RemoteParticipant,
|
|
50
|
+
RemoteTrack: () => import_track.RemoteTrack,
|
|
51
|
+
RemoteTrackPublication: () => import_track_publication.RemoteTrackPublication,
|
|
52
|
+
RemoteVideoTrack: () => import_track.RemoteVideoTrack,
|
|
53
|
+
Room: () => import_room.Room,
|
|
54
|
+
RoomEvent: () => import_room.RoomEvent,
|
|
55
|
+
RoomOptions: () => import_room.RoomOptions,
|
|
56
|
+
RpcError: () => import_rpc.RpcError,
|
|
57
|
+
RtcConfiguration: () => import_room.RtcConfiguration,
|
|
58
|
+
StreamState: () => import_track_pb2.StreamState,
|
|
59
|
+
Track: () => import_track.Track,
|
|
60
|
+
TrackKind: () => import_track_pb2.TrackKind,
|
|
61
|
+
TrackPublication: () => import_track_publication.TrackPublication,
|
|
62
|
+
TrackPublishOptions: () => TrackPublishOptions,
|
|
63
|
+
TrackSource: () => import_track_pb2.TrackSource,
|
|
64
|
+
Transcription: () => import_transcription.Transcription,
|
|
65
|
+
TranscriptionSegment: () => import_transcription.TranscriptionSegment,
|
|
66
|
+
VideoBufferType: () => import_video_frame_pb2.VideoBufferType,
|
|
67
|
+
VideoCodec: () => import_video_frame_pb2.VideoCodec,
|
|
68
|
+
VideoFrame: () => import_video_frame.VideoFrame,
|
|
69
|
+
VideoFrameEvent: () => import_video_stream.VideoFrameEvent,
|
|
70
|
+
VideoRotation: () => import_video_frame_pb2.VideoRotation,
|
|
71
|
+
VideoSource: () => import_video_source.VideoSource,
|
|
72
|
+
VideoStream: () => import_video_stream.VideoStream,
|
|
73
|
+
VideoTrack: () => import_track.VideoTrack,
|
|
74
|
+
combineAudioFrames: () => import_audio_frame.combineAudioFrames,
|
|
75
|
+
dispose: () => import_ffi_client.dispose
|
|
76
|
+
});
|
|
77
|
+
module.exports = __toCommonJS(src_exports);
|
|
78
|
+
var import_protobuf = require("@bufbuild/protobuf");
|
|
79
|
+
var import_room_pb = require("./proto/room_pb.cjs");
|
|
80
|
+
var import_track_pb = require("./proto/track_pb.cjs");
|
|
81
|
+
var import_video_frame_pb = require("./proto/video_frame_pb.cjs");
|
|
82
|
+
var import_room = require("./room.cjs");
|
|
83
|
+
var import_participant = require("./participant.cjs");
|
|
84
|
+
var import_track = require("./track.cjs");
|
|
85
|
+
var import_video_frame = require("./video_frame.cjs");
|
|
86
|
+
var import_audio_frame = require("./audio_frame.cjs");
|
|
87
|
+
var import_audio_stream = require("./audio_stream.cjs");
|
|
88
|
+
var import_audio_resampler = require("./audio_resampler.cjs");
|
|
89
|
+
var import_video_stream = require("./video_stream.cjs");
|
|
90
|
+
var import_audio_source = require("./audio_source.cjs");
|
|
91
|
+
var import_video_source = require("./video_source.cjs");
|
|
92
|
+
var import_track_publication = require("./track_publication.cjs");
|
|
93
|
+
var import_transcription = require("./transcription.cjs");
|
|
94
|
+
var import_e2ee = require("./e2ee.cjs");
|
|
95
|
+
var import_room_pb2 = require("./proto/room_pb.cjs");
|
|
96
|
+
var import_rpc = require("./rpc.cjs");
|
|
97
|
+
var import_e2ee_pb = require("./proto/e2ee_pb.cjs");
|
|
98
|
+
var import_track_pb2 = require("./proto/track_pb.cjs");
|
|
99
|
+
var import_video_frame_pb2 = require("./proto/video_frame_pb.cjs");
|
|
100
|
+
var import_participant_pb = require("./proto/participant_pb.cjs");
|
|
101
|
+
var import_ffi_client = require("./ffi_client.cjs");
|
|
102
|
+
class IceServer {
|
|
103
|
+
constructor(init) {
|
|
104
|
+
this.$typeName = "livekit.proto.IceServer";
|
|
105
|
+
const { urls, username, password } = init;
|
|
106
|
+
this.urls = urls;
|
|
107
|
+
this.username = username ?? "";
|
|
108
|
+
this.password = password ?? "";
|
|
109
|
+
(0, import_protobuf.create)(import_room_pb.IceServerSchema, init);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
class TrackPublishOptions {
|
|
113
|
+
constructor(init = {}) {
|
|
114
|
+
this.$typeName = "livekit.proto.TrackPublishOptions";
|
|
115
|
+
const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;
|
|
116
|
+
this.videoCodec = videoCodec ?? import_video_frame_pb.VideoCodec.VP8;
|
|
117
|
+
if (videoEncoding) {
|
|
118
|
+
this.videoEncoding = (0, import_protobuf.create)(import_room_pb.VideoEncodingSchema, videoEncoding);
|
|
119
|
+
}
|
|
120
|
+
if (audioEncoding) {
|
|
121
|
+
this.audioEncoding = (0, import_protobuf.create)(import_room_pb.AudioEncodingSchema, audioEncoding);
|
|
122
|
+
}
|
|
123
|
+
this.dtx = dtx ?? false;
|
|
124
|
+
this.simulcast = simulcast ?? false;
|
|
125
|
+
this.source = source ?? import_track_pb.TrackSource.SOURCE_UNKNOWN;
|
|
126
|
+
this.stream = stream ?? "";
|
|
127
|
+
this.red = red ?? false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
131
|
+
0 && (module.exports = {
|
|
132
|
+
AudioFrame,
|
|
133
|
+
AudioResampler,
|
|
134
|
+
AudioResamplerQuality,
|
|
135
|
+
AudioSource,
|
|
136
|
+
AudioStream,
|
|
137
|
+
AudioTrack,
|
|
138
|
+
ConnectError,
|
|
139
|
+
ConnectionQuality,
|
|
140
|
+
ConnectionState,
|
|
141
|
+
ContinualGatheringPolicy,
|
|
142
|
+
DataPacketKind,
|
|
143
|
+
E2EEManager,
|
|
144
|
+
E2EEOptions,
|
|
145
|
+
EncryptionState,
|
|
146
|
+
EncryptionType,
|
|
147
|
+
FrameCryptor,
|
|
148
|
+
IceServer,
|
|
149
|
+
IceTransportType,
|
|
150
|
+
KeyProvider,
|
|
151
|
+
KeyProviderOptions,
|
|
152
|
+
LocalAudioTrack,
|
|
153
|
+
LocalParticipant,
|
|
154
|
+
LocalTrack,
|
|
155
|
+
LocalTrackPublication,
|
|
156
|
+
LocalVideoTrack,
|
|
157
|
+
Participant,
|
|
158
|
+
ParticipantKind,
|
|
159
|
+
RemoteAudioTrack,
|
|
160
|
+
RemoteParticipant,
|
|
161
|
+
RemoteTrack,
|
|
162
|
+
RemoteTrackPublication,
|
|
163
|
+
RemoteVideoTrack,
|
|
164
|
+
Room,
|
|
165
|
+
RoomEvent,
|
|
166
|
+
RoomOptions,
|
|
167
|
+
RpcError,
|
|
168
|
+
RtcConfiguration,
|
|
169
|
+
StreamState,
|
|
170
|
+
Track,
|
|
171
|
+
TrackKind,
|
|
172
|
+
TrackPublication,
|
|
173
|
+
TrackPublishOptions,
|
|
174
|
+
TrackSource,
|
|
175
|
+
Transcription,
|
|
176
|
+
TranscriptionSegment,
|
|
177
|
+
VideoBufferType,
|
|
178
|
+
VideoCodec,
|
|
179
|
+
VideoFrame,
|
|
180
|
+
VideoFrameEvent,
|
|
181
|
+
VideoRotation,
|
|
182
|
+
VideoSource,
|
|
183
|
+
VideoStream,
|
|
184
|
+
VideoTrack,
|
|
185
|
+
combineAudioFrames,
|
|
186
|
+
dispose
|
|
187
|
+
});
|
|
188
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { MessageInitShape } from '@bufbuild/protobuf';\nimport { create } from '@bufbuild/protobuf';\nimport type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';\nimport {\n AudioEncodingSchema,\n IceServerSchema,\n type IceServer as IceServerType,\n type TrackPublishOptions as TrackPublishOptionsType,\n VideoEncodingSchema,\n} from './proto/room_pb.js';\nimport { TrackSource } from './proto/track_pb.js';\nimport { VideoCodec } from './proto/video_frame_pb.js';\n\nexport { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from './room.js';\nexport { Participant, RemoteParticipant, LocalParticipant } from './participant.js';\nexport {\n Track,\n LocalTrack,\n RemoteTrack,\n VideoTrack,\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n AudioTrack,\n} from './track.js';\nexport { VideoFrame } from './video_frame.js';\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioStream } from './audio_stream.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { VideoStream, VideoFrameEvent } from './video_stream.js';\nexport { AudioSource } from './audio_source.js';\nexport { VideoSource } from './video_source.js';\nexport {\n TrackPublication,\n RemoteTrackPublication,\n LocalTrackPublication,\n} from './track_publication.js';\nexport { Transcription, TranscriptionSegment } from './transcription.js';\nexport { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from './e2ee.js';\n\nexport {\n ConnectionQuality,\n IceTransportType,\n DataPacketKind,\n ContinualGatheringPolicy,\n ConnectionState,\n} from './proto/room_pb.js';\nexport { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';\nexport { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';\nexport { ParticipantKind } from './proto/participant_pb.js';\nexport { dispose } from './ffi_client.js';\nexport type { ChatMessage } from './types.js';\n\n// exposing helpers for API compatibility with 1.x version of protobuf-es where these were class instances\n\ntype IceServerInit = MessageInitShape<typeof IceServerSchema> & {\n urls: string[];\n};\nexport class IceServer implements IceServerType {\n $typeName = 'livekit.proto.IceServer' as const;\n urls: string[];\n username: string;\n password: string;\n constructor(init: IceServerInit) {\n const { urls, username, password } = init;\n this.urls = urls;\n this.username = username ?? '';\n this.password = password ?? '';\n create(IceServerSchema, init);\n }\n}\n\nexport class TrackPublishOptions implements TrackPublishOptionsType {\n $typeName = 'livekit.proto.TrackPublishOptions' as const;\n videoCodec: VideoCodec;\n videoEncoding?: VideoEncoding | undefined;\n audioEncoding?: AudioEncoding | undefined;\n dtx: boolean;\n simulcast: boolean;\n source: TrackSource;\n stream: string;\n red: boolean;\n\n constructor(init: MessageInitShape<typeof TrackPublishOptionsSchema> = {}) {\n const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;\n this.videoCodec = videoCodec ?? VideoCodec.VP8;\n if (videoEncoding) {\n this.videoEncoding = create(VideoEncodingSchema, videoEncoding);\n }\n if (audioEncoding) {\n this.audioEncoding = create(AudioEncodingSchema, audioEncoding);\n }\n this.dtx = dtx ?? false;\n this.simulcast = simulcast ?? false;\n this.source = source ?? TrackSource.SOURCE_UNKNOWN;\n this.stream = stream ?? '';\n this.red = red ?? false;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,sBAAuB;AAEvB,qBAMO;AACP,sBAA4B;AAC5B,4BAA2B;AAE3B,kBAA6E;AAC7E,yBAAiE;AACjE,mBAUO;AACP,yBAA2B;AAC3B,yBAA+C;AAC/C,0BAA4B;AAC5B,6BAAsD;AACtD,0BAA6C;AAC7C,0BAA4B;AAC5B,0BAA4B;AAC5B,+BAIO;AACP,2BAAoD;AACpD,kBAAwF;AAExF,IAAAA,kBAMO;AACP,iBAAwE;AACxE,qBAAgD;AAChD,IAAAC,mBAAoD;AACpD,IAAAC,yBAA2D;AAC3D,4BAAgC;AAChC,wBAAwB;AAQjB,MAAM,UAAmC;AAAA,EAK9C,YAAY,MAAqB;AAJjC,qBAAY;AAKV,UAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,SAAK,OAAO;AACZ,SAAK,WAAW,YAAY;AAC5B,SAAK,WAAW,YAAY;AAC5B,gCAAO,gCAAiB,IAAI;AAAA,EAC9B;AACF;AAEO,MAAM,oBAAuD;AAAA,EAWlE,YAAY,OAA2D,CAAC,GAAG;AAV3E,qBAAY;AAWV,UAAM,EAAE,YAAY,eAAe,eAAe,KAAK,WAAW,QAAQ,QAAQ,IAAI,IAAI;AAC1F,SAAK,aAAa,cAAc,iCAAW;AAC3C,QAAI,eAAe;AACjB,WAAK,oBAAgB,wBAAO,oCAAqB,aAAa;AAAA,IAChE;AACA,QAAI,eAAe;AACjB,WAAK,oBAAgB,wBAAO,oCAAqB,aAAa;AAAA,IAChE;AACA,SAAK,MAAM,OAAO;AAClB,SAAK,YAAY,aAAa;AAC9B,SAAK,SAAS,UAAU,4BAAY;AACpC,SAAK,SAAS,UAAU;AACxB,SAAK,MAAM,OAAO;AAAA,EACpB;AACF;","names":["import_room_pb","import_track_pb","import_video_frame_pb"]}
|
package/dist/index.js
CHANGED
|
@@ -1,52 +1,134 @@
|
|
|
1
|
-
import { create } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { create } from "@bufbuild/protobuf";
|
|
2
|
+
import {
|
|
3
|
+
AudioEncodingSchema,
|
|
4
|
+
IceServerSchema,
|
|
5
|
+
VideoEncodingSchema
|
|
6
|
+
} from "./proto/room_pb.js";
|
|
7
|
+
import { TrackSource } from "./proto/track_pb.js";
|
|
8
|
+
import { VideoCodec } from "./proto/video_frame_pb.js";
|
|
9
|
+
import { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from "./room.js";
|
|
10
|
+
import { Participant, RemoteParticipant, LocalParticipant } from "./participant.js";
|
|
11
|
+
import {
|
|
12
|
+
Track,
|
|
13
|
+
LocalTrack,
|
|
14
|
+
RemoteTrack,
|
|
15
|
+
VideoTrack,
|
|
16
|
+
LocalAudioTrack,
|
|
17
|
+
LocalVideoTrack,
|
|
18
|
+
RemoteAudioTrack,
|
|
19
|
+
RemoteVideoTrack,
|
|
20
|
+
AudioTrack
|
|
21
|
+
} from "./track.js";
|
|
22
|
+
import { VideoFrame } from "./video_frame.js";
|
|
23
|
+
import { AudioFrame, combineAudioFrames } from "./audio_frame.js";
|
|
24
|
+
import { AudioStream } from "./audio_stream.js";
|
|
25
|
+
import { AudioResampler, AudioResamplerQuality } from "./audio_resampler.js";
|
|
26
|
+
import { VideoStream, VideoFrameEvent } from "./video_stream.js";
|
|
27
|
+
import { AudioSource } from "./audio_source.js";
|
|
28
|
+
import { VideoSource } from "./video_source.js";
|
|
29
|
+
import {
|
|
30
|
+
TrackPublication,
|
|
31
|
+
RemoteTrackPublication,
|
|
32
|
+
LocalTrackPublication
|
|
33
|
+
} from "./track_publication.js";
|
|
34
|
+
import { Transcription, TranscriptionSegment } from "./transcription.js";
|
|
35
|
+
import { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from "./e2ee.js";
|
|
36
|
+
import {
|
|
37
|
+
ConnectionQuality,
|
|
38
|
+
IceTransportType,
|
|
39
|
+
DataPacketKind,
|
|
40
|
+
ContinualGatheringPolicy,
|
|
41
|
+
ConnectionState
|
|
42
|
+
} from "./proto/room_pb.js";
|
|
43
|
+
import { RpcError } from "./rpc.js";
|
|
44
|
+
import { EncryptionType, EncryptionState } from "./proto/e2ee_pb.js";
|
|
45
|
+
import { StreamState, TrackKind, TrackSource as TrackSource2 } from "./proto/track_pb.js";
|
|
46
|
+
import { VideoBufferType, VideoRotation, VideoCodec as VideoCodec2 } from "./proto/video_frame_pb.js";
|
|
47
|
+
import { ParticipantKind } from "./proto/participant_pb.js";
|
|
48
|
+
import { dispose } from "./ffi_client.js";
|
|
49
|
+
class IceServer {
|
|
50
|
+
constructor(init) {
|
|
51
|
+
this.$typeName = "livekit.proto.IceServer";
|
|
52
|
+
const { urls, username, password } = init;
|
|
53
|
+
this.urls = urls;
|
|
54
|
+
this.username = username ?? "";
|
|
55
|
+
this.password = password ?? "";
|
|
56
|
+
create(IceServerSchema, init);
|
|
57
|
+
}
|
|
33
58
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
this.dtx = dtx ?? false;
|
|
46
|
-
this.simulcast = simulcast ?? false;
|
|
47
|
-
this.source = source ?? TrackSource.SOURCE_UNKNOWN;
|
|
48
|
-
this.stream = stream ?? '';
|
|
49
|
-
this.red = red ?? false;
|
|
59
|
+
class TrackPublishOptions {
|
|
60
|
+
constructor(init = {}) {
|
|
61
|
+
this.$typeName = "livekit.proto.TrackPublishOptions";
|
|
62
|
+
const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;
|
|
63
|
+
this.videoCodec = videoCodec ?? VideoCodec.VP8;
|
|
64
|
+
if (videoEncoding) {
|
|
65
|
+
this.videoEncoding = create(VideoEncodingSchema, videoEncoding);
|
|
66
|
+
}
|
|
67
|
+
if (audioEncoding) {
|
|
68
|
+
this.audioEncoding = create(AudioEncodingSchema, audioEncoding);
|
|
50
69
|
}
|
|
70
|
+
this.dtx = dtx ?? false;
|
|
71
|
+
this.simulcast = simulcast ?? false;
|
|
72
|
+
this.source = source ?? TrackSource.SOURCE_UNKNOWN;
|
|
73
|
+
this.stream = stream ?? "";
|
|
74
|
+
this.red = red ?? false;
|
|
75
|
+
}
|
|
51
76
|
}
|
|
77
|
+
export {
|
|
78
|
+
AudioFrame,
|
|
79
|
+
AudioResampler,
|
|
80
|
+
AudioResamplerQuality,
|
|
81
|
+
AudioSource,
|
|
82
|
+
AudioStream,
|
|
83
|
+
AudioTrack,
|
|
84
|
+
ConnectError,
|
|
85
|
+
ConnectionQuality,
|
|
86
|
+
ConnectionState,
|
|
87
|
+
ContinualGatheringPolicy,
|
|
88
|
+
DataPacketKind,
|
|
89
|
+
E2EEManager,
|
|
90
|
+
E2EEOptions,
|
|
91
|
+
EncryptionState,
|
|
92
|
+
EncryptionType,
|
|
93
|
+
FrameCryptor,
|
|
94
|
+
IceServer,
|
|
95
|
+
IceTransportType,
|
|
96
|
+
KeyProvider,
|
|
97
|
+
KeyProviderOptions,
|
|
98
|
+
LocalAudioTrack,
|
|
99
|
+
LocalParticipant,
|
|
100
|
+
LocalTrack,
|
|
101
|
+
LocalTrackPublication,
|
|
102
|
+
LocalVideoTrack,
|
|
103
|
+
Participant,
|
|
104
|
+
ParticipantKind,
|
|
105
|
+
RemoteAudioTrack,
|
|
106
|
+
RemoteParticipant,
|
|
107
|
+
RemoteTrack,
|
|
108
|
+
RemoteTrackPublication,
|
|
109
|
+
RemoteVideoTrack,
|
|
110
|
+
Room,
|
|
111
|
+
RoomEvent,
|
|
112
|
+
RoomOptions,
|
|
113
|
+
RpcError,
|
|
114
|
+
RtcConfiguration,
|
|
115
|
+
StreamState,
|
|
116
|
+
Track,
|
|
117
|
+
TrackKind,
|
|
118
|
+
TrackPublication,
|
|
119
|
+
TrackPublishOptions,
|
|
120
|
+
TrackSource2 as TrackSource,
|
|
121
|
+
Transcription,
|
|
122
|
+
TranscriptionSegment,
|
|
123
|
+
VideoBufferType,
|
|
124
|
+
VideoCodec2 as VideoCodec,
|
|
125
|
+
VideoFrame,
|
|
126
|
+
VideoFrameEvent,
|
|
127
|
+
VideoRotation,
|
|
128
|
+
VideoSource,
|
|
129
|
+
VideoStream,
|
|
130
|
+
VideoTrack,
|
|
131
|
+
combineAudioFrames,
|
|
132
|
+
dispose
|
|
133
|
+
};
|
|
52
134
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { MessageInitShape } from '@bufbuild/protobuf';\nimport { create } from '@bufbuild/protobuf';\nimport type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';\nimport {\n AudioEncodingSchema,\n IceServerSchema,\n type IceServer as IceServerType,\n type TrackPublishOptions as TrackPublishOptionsType,\n VideoEncodingSchema,\n} from './proto/room_pb.js';\nimport { TrackSource } from './proto/track_pb.js';\nimport { VideoCodec } from './proto/video_frame_pb.js';\n\nexport { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from './room.js';\nexport { Participant, RemoteParticipant, LocalParticipant } from './participant.js';\nexport {\n Track,\n LocalTrack,\n RemoteTrack,\n VideoTrack,\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n AudioTrack,\n} from './track.js';\nexport { VideoFrame } from './video_frame.js';\nexport { AudioFrame, combineAudioFrames } from './audio_frame.js';\nexport { AudioStream } from './audio_stream.js';\nexport { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';\nexport { VideoStream, VideoFrameEvent } from './video_stream.js';\nexport { AudioSource } from './audio_source.js';\nexport { VideoSource } from './video_source.js';\nexport {\n TrackPublication,\n RemoteTrackPublication,\n LocalTrackPublication,\n} from './track_publication.js';\nexport { Transcription, TranscriptionSegment } from './transcription.js';\nexport { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from './e2ee.js';\n\nexport {\n ConnectionQuality,\n IceTransportType,\n DataPacketKind,\n ContinualGatheringPolicy,\n ConnectionState,\n} from './proto/room_pb.js';\nexport { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';\nexport { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';\nexport { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';\nexport { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_pb.js';\nexport { ParticipantKind } from './proto/participant_pb.js';\nexport { dispose } from './ffi_client.js';\nexport type { ChatMessage } from './types.js';\n\n// exposing helpers for API compatibility with 1.x version of protobuf-es where these were class instances\n\ntype IceServerInit = MessageInitShape<typeof IceServerSchema> & {\n urls: string[];\n};\nexport class IceServer implements IceServerType {\n $typeName = 'livekit.proto.IceServer' as const;\n urls: string[];\n username: string;\n password: string;\n constructor(init: IceServerInit) {\n const { urls, username, password } = init;\n this.urls = urls;\n this.username = username ?? '';\n this.password = password ?? '';\n create(IceServerSchema, init);\n }\n}\n\nexport class TrackPublishOptions implements TrackPublishOptionsType {\n $typeName = 'livekit.proto.TrackPublishOptions' as const;\n videoCodec: VideoCodec;\n videoEncoding?: VideoEncoding | undefined;\n audioEncoding?: AudioEncoding | undefined;\n dtx: boolean;\n simulcast: boolean;\n source: TrackSource;\n stream: string;\n red: boolean;\n\n constructor(init: MessageInitShape<typeof TrackPublishOptionsSchema> = {}) {\n const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;\n this.videoCodec = videoCodec ?? VideoCodec.VP8;\n if (videoEncoding) {\n this.videoEncoding = create(VideoEncodingSchema, videoEncoding);\n }\n if (audioEncoding) {\n this.audioEncoding = create(AudioEncodingSchema, audioEncoding);\n }\n this.dtx = dtx ?? false;\n this.simulcast = simulcast ?? false;\n this.source = source ?? TrackSource.SOURCE_UNKNOWN;\n this.stream = stream ?? '';\n this.red = red ?? false;\n }\n}\n"],"mappings":"AAIA,SAAS,cAAc;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAE3B,SAAS,MAAM,WAAW,cAAc,aAAa,wBAAwB;AAC7E,SAAS,aAAa,mBAAmB,wBAAwB;AACjE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,YAAY,0BAA0B;AAC/C,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB,6BAA6B;AACtD,SAAS,aAAa,uBAAuB;AAC7C,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe,4BAA4B;AACpD,SAAS,aAAa,aAAa,oBAAoB,aAAa,oBAAoB;AAExF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAA+D;AACxE,SAAS,gBAAgB,uBAAuB;AAChD,SAAS,aAAa,WAAW,eAAAA,oBAAmB;AACpD,SAAS,iBAAiB,eAAe,cAAAC,mBAAkB;AAC3D,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAQjB,MAAM,UAAmC;AAAA,EAK9C,YAAY,MAAqB;AAJjC,qBAAY;AAKV,UAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,SAAK,OAAO;AACZ,SAAK,WAAW,YAAY;AAC5B,SAAK,WAAW,YAAY;AAC5B,WAAO,iBAAiB,IAAI;AAAA,EAC9B;AACF;AAEO,MAAM,oBAAuD;AAAA,EAWlE,YAAY,OAA2D,CAAC,GAAG;AAV3E,qBAAY;AAWV,UAAM,EAAE,YAAY,eAAe,eAAe,KAAK,WAAW,QAAQ,QAAQ,IAAI,IAAI;AAC1F,SAAK,aAAa,cAAc,WAAW;AAC3C,QAAI,eAAe;AACjB,WAAK,gBAAgB,OAAO,qBAAqB,aAAa;AAAA,IAChE;AACA,QAAI,eAAe;AACjB,WAAK,gBAAgB,OAAO,qBAAqB,aAAa;AAAA,IAChE;AACA,SAAK,MAAM,OAAO;AAClB,SAAK,YAAY,aAAa;AAC9B,SAAK,SAAS,UAAU,YAAY;AACpC,SAAK,SAAS,UAAU;AACxB,SAAK,MAAM,OAAO;AAAA,EACpB;AACF;","names":["TrackSource","VideoCodec"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var native_d_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(native_d_exports);
|
|
17
|
+
//# sourceMappingURL=native.d.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/napi/native.d.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n\n/* auto-generated by NAPI-RS */\n\nexport function livekitInitialize(\n callback: (data: Uint8Array) => void,\n captureLogs: boolean,\n sdkVersion: string,\n): void;\nexport function livekitFfiRequest(data: Uint8Array): Uint8Array;\nexport function livekitRetrievePtr(handle: Uint8Array): bigint;\nexport function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;\nexport function livekitDispose(): Promise<void>;\nexport declare class FfiHandle {\n constructor(handle: bigint);\n dispose(): void;\n get handle(): bigint;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=native.d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/napi/native.d.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function livekitInitialize(
|
|
7
7
|
callback: (data: Uint8Array) => void,
|
|
8
8
|
captureLogs: boolean,
|
|
9
9
|
sdkVersion: string,
|
|
10
10
|
): void;
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
11
|
+
export function livekitFfiRequest(data: Uint8Array): Uint8Array;
|
|
12
|
+
export function livekitRetrievePtr(handle: Uint8Array): bigint;
|
|
13
|
+
export function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
|
|
14
|
+
export function livekitDispose(): Promise<void>;
|
|
15
15
|
export declare class FfiHandle {
|
|
16
16
|
constructor(handle: bigint);
|
|
17
17
|
dispose(): void;
|