@livekit/rtc-node 0.11.1 → 0.12.1
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 +95 -0
- package/dist/ffi_client.cjs.map +1 -0
- package/dist/ffi_client.d.ts +2 -2
- package/dist/ffi_client.d.ts.map +1 -1
- package/dist/ffi_client.js +67 -48
- package/dist/ffi_client.js.map +1 -1
- package/dist/index.cjs +166 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -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/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/ffi_client.ts +4 -4
- package/src/index.ts +14 -8
- 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,69 @@
|
|
|
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
|
+
FfiEventSchema,
|
|
13
|
+
FfiRequestSchema,
|
|
14
|
+
FfiResponseSchema
|
|
15
|
+
} from "./proto/ffi_pb.js";
|
|
16
|
+
import { SDK_VERSION } from "./version.js";
|
|
17
|
+
var FfiClientEvent = /* @__PURE__ */ ((FfiClientEvent2) => {
|
|
18
|
+
FfiClientEvent2["FfiEvent"] = "ffi_event";
|
|
19
|
+
return FfiClientEvent2;
|
|
20
|
+
})(FfiClientEvent || {});
|
|
21
|
+
class FfiClient extends EventEmitter {
|
|
22
|
+
/** @internal */
|
|
23
|
+
static get instance() {
|
|
24
|
+
if (!FfiClient._client) FfiClient._client = new FfiClient();
|
|
25
|
+
return FfiClient._client;
|
|
26
|
+
}
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
this.setMaxListeners(0);
|
|
30
|
+
livekitInitialize(
|
|
31
|
+
(event_data) => {
|
|
32
|
+
const event = fromBinary(FfiEventSchema, event_data);
|
|
33
|
+
this.emit("ffi_event" /* FfiEvent */, event);
|
|
34
|
+
},
|
|
35
|
+
true,
|
|
36
|
+
SDK_VERSION
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
request(req) {
|
|
40
|
+
const request = create(FfiRequestSchema, req);
|
|
41
|
+
const req_data = toBinary(FfiRequestSchema, request);
|
|
42
|
+
const res_data = livekitFfiRequest(req_data);
|
|
43
|
+
return fromBinary(FfiResponseSchema, res_data).message.value;
|
|
44
|
+
}
|
|
45
|
+
copyBuffer(ptr, len) {
|
|
46
|
+
return livekitCopyBuffer(ptr, len);
|
|
47
|
+
}
|
|
48
|
+
retrievePtr(data) {
|
|
49
|
+
return livekitRetrievePtr(data);
|
|
50
|
+
}
|
|
51
|
+
async waitFor(predicate) {
|
|
52
|
+
return new Promise((resolve) => {
|
|
53
|
+
const listener = (ev) => {
|
|
54
|
+
if (predicate(ev)) {
|
|
55
|
+
this.off("ffi_event" /* FfiEvent */, listener);
|
|
56
|
+
resolve(ev.message.value);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
this.on("ffi_event" /* FfiEvent */, listener);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
49
62
|
}
|
|
63
|
+
export {
|
|
64
|
+
FfiClient,
|
|
65
|
+
FfiClientEvent,
|
|
66
|
+
FfiHandle,
|
|
67
|
+
livekitDispose as dispose
|
|
68
|
+
};
|
|
50
69
|
//# 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 type FfiEvent,\n FfiEventSchema,\n type FfiRequest,\n FfiRequestSchema,\n type FfiResponse,\n FfiResponseSchema,\n} from './proto/ffi_pb.js';\nimport { SDK_VERSION } from './version.js';\n\nexport { FfiHandle, type FfiEvent, type FfiResponse, type 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.F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,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,166 @@
|
|
|
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
|
+
ConnectError: () => import_room.ConnectError,
|
|
27
|
+
ConnectionQuality: () => import_room_pb2.ConnectionQuality,
|
|
28
|
+
ConnectionState: () => import_room_pb2.ConnectionState,
|
|
29
|
+
ContinualGatheringPolicy: () => import_room_pb2.ContinualGatheringPolicy,
|
|
30
|
+
DataPacketKind: () => import_room_pb2.DataPacketKind,
|
|
31
|
+
E2EEManager: () => import_e2ee.E2EEManager,
|
|
32
|
+
EncryptionState: () => import_e2ee_pb.EncryptionState,
|
|
33
|
+
EncryptionType: () => import_e2ee_pb.EncryptionType,
|
|
34
|
+
FrameCryptor: () => import_e2ee.FrameCryptor,
|
|
35
|
+
IceServer: () => IceServer,
|
|
36
|
+
IceTransportType: () => import_room_pb2.IceTransportType,
|
|
37
|
+
KeyProvider: () => import_e2ee.KeyProvider,
|
|
38
|
+
LocalAudioTrack: () => import_track.LocalAudioTrack,
|
|
39
|
+
LocalParticipant: () => import_participant.LocalParticipant,
|
|
40
|
+
LocalTrackPublication: () => import_track_publication.LocalTrackPublication,
|
|
41
|
+
LocalVideoTrack: () => import_track.LocalVideoTrack,
|
|
42
|
+
Participant: () => import_participant.Participant,
|
|
43
|
+
ParticipantKind: () => import_participant_pb.ParticipantKind,
|
|
44
|
+
RemoteAudioTrack: () => import_track.RemoteAudioTrack,
|
|
45
|
+
RemoteParticipant: () => import_participant.RemoteParticipant,
|
|
46
|
+
RemoteTrackPublication: () => import_track_publication.RemoteTrackPublication,
|
|
47
|
+
RemoteVideoTrack: () => import_track.RemoteVideoTrack,
|
|
48
|
+
Room: () => import_room.Room,
|
|
49
|
+
RoomEvent: () => import_room.RoomEvent,
|
|
50
|
+
RpcError: () => import_rpc.RpcError,
|
|
51
|
+
StreamState: () => import_track_pb2.StreamState,
|
|
52
|
+
Track: () => import_track.Track,
|
|
53
|
+
TrackKind: () => import_track_pb2.TrackKind,
|
|
54
|
+
TrackPublication: () => import_track_publication.TrackPublication,
|
|
55
|
+
TrackPublishOptions: () => TrackPublishOptions,
|
|
56
|
+
TrackSource: () => import_track_pb2.TrackSource,
|
|
57
|
+
VideoBufferType: () => import_video_frame_pb2.VideoBufferType,
|
|
58
|
+
VideoCodec: () => import_video_frame_pb2.VideoCodec,
|
|
59
|
+
VideoFrame: () => import_video_frame.VideoFrame,
|
|
60
|
+
VideoRotation: () => import_video_frame_pb2.VideoRotation,
|
|
61
|
+
VideoSource: () => import_video_source.VideoSource,
|
|
62
|
+
VideoStream: () => import_video_stream.VideoStream,
|
|
63
|
+
combineAudioFrames: () => import_audio_frame.combineAudioFrames,
|
|
64
|
+
dispose: () => import_ffi_client.dispose
|
|
65
|
+
});
|
|
66
|
+
module.exports = __toCommonJS(src_exports);
|
|
67
|
+
var import_protobuf = require("@bufbuild/protobuf");
|
|
68
|
+
var import_room_pb = require("./proto/room_pb.cjs");
|
|
69
|
+
var import_track_pb = require("./proto/track_pb.cjs");
|
|
70
|
+
var import_video_frame_pb = require("./proto/video_frame_pb.cjs");
|
|
71
|
+
var import_room = require("./room.cjs");
|
|
72
|
+
var import_participant = require("./participant.cjs");
|
|
73
|
+
var import_track = require("./track.cjs");
|
|
74
|
+
var import_video_frame = require("./video_frame.cjs");
|
|
75
|
+
var import_audio_frame = require("./audio_frame.cjs");
|
|
76
|
+
var import_audio_stream = require("./audio_stream.cjs");
|
|
77
|
+
var import_audio_resampler = require("./audio_resampler.cjs");
|
|
78
|
+
var import_video_stream = require("./video_stream.cjs");
|
|
79
|
+
var import_audio_source = require("./audio_source.cjs");
|
|
80
|
+
var import_video_source = require("./video_source.cjs");
|
|
81
|
+
var import_track_publication = require("./track_publication.cjs");
|
|
82
|
+
var import_transcription = require("./transcription.cjs");
|
|
83
|
+
var import_e2ee = require("./e2ee.cjs");
|
|
84
|
+
var import_room_pb2 = require("./proto/room_pb.cjs");
|
|
85
|
+
var import_rpc = require("./rpc.cjs");
|
|
86
|
+
var import_e2ee_pb = require("./proto/e2ee_pb.cjs");
|
|
87
|
+
var import_track_pb2 = require("./proto/track_pb.cjs");
|
|
88
|
+
var import_video_frame_pb2 = require("./proto/video_frame_pb.cjs");
|
|
89
|
+
var import_participant_pb = require("./proto/participant_pb.cjs");
|
|
90
|
+
var import_ffi_client = require("./ffi_client.cjs");
|
|
91
|
+
class IceServer {
|
|
92
|
+
constructor(init) {
|
|
93
|
+
this.$typeName = "livekit.proto.IceServer";
|
|
94
|
+
const { urls, username, password } = init;
|
|
95
|
+
this.urls = urls;
|
|
96
|
+
this.username = username ?? "";
|
|
97
|
+
this.password = password ?? "";
|
|
98
|
+
(0, import_protobuf.create)(import_room_pb.IceServerSchema, init);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
class TrackPublishOptions {
|
|
102
|
+
constructor(init = {}) {
|
|
103
|
+
this.$typeName = "livekit.proto.TrackPublishOptions";
|
|
104
|
+
const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;
|
|
105
|
+
this.videoCodec = videoCodec ?? import_video_frame_pb.VideoCodec.VP8;
|
|
106
|
+
if (videoEncoding) {
|
|
107
|
+
this.videoEncoding = (0, import_protobuf.create)(import_room_pb.VideoEncodingSchema, videoEncoding);
|
|
108
|
+
}
|
|
109
|
+
if (audioEncoding) {
|
|
110
|
+
this.audioEncoding = (0, import_protobuf.create)(import_room_pb.AudioEncodingSchema, audioEncoding);
|
|
111
|
+
}
|
|
112
|
+
this.dtx = dtx ?? false;
|
|
113
|
+
this.simulcast = simulcast ?? false;
|
|
114
|
+
this.source = source ?? import_track_pb.TrackSource.SOURCE_UNKNOWN;
|
|
115
|
+
this.stream = stream ?? "";
|
|
116
|
+
this.red = red ?? false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
+
0 && (module.exports = {
|
|
121
|
+
AudioFrame,
|
|
122
|
+
AudioResampler,
|
|
123
|
+
AudioResamplerQuality,
|
|
124
|
+
AudioSource,
|
|
125
|
+
AudioStream,
|
|
126
|
+
ConnectError,
|
|
127
|
+
ConnectionQuality,
|
|
128
|
+
ConnectionState,
|
|
129
|
+
ContinualGatheringPolicy,
|
|
130
|
+
DataPacketKind,
|
|
131
|
+
E2EEManager,
|
|
132
|
+
EncryptionState,
|
|
133
|
+
EncryptionType,
|
|
134
|
+
FrameCryptor,
|
|
135
|
+
IceServer,
|
|
136
|
+
IceTransportType,
|
|
137
|
+
KeyProvider,
|
|
138
|
+
LocalAudioTrack,
|
|
139
|
+
LocalParticipant,
|
|
140
|
+
LocalTrackPublication,
|
|
141
|
+
LocalVideoTrack,
|
|
142
|
+
Participant,
|
|
143
|
+
ParticipantKind,
|
|
144
|
+
RemoteAudioTrack,
|
|
145
|
+
RemoteParticipant,
|
|
146
|
+
RemoteTrackPublication,
|
|
147
|
+
RemoteVideoTrack,
|
|
148
|
+
Room,
|
|
149
|
+
RoomEvent,
|
|
150
|
+
RpcError,
|
|
151
|
+
StreamState,
|
|
152
|
+
Track,
|
|
153
|
+
TrackKind,
|
|
154
|
+
TrackPublication,
|
|
155
|
+
TrackPublishOptions,
|
|
156
|
+
TrackSource,
|
|
157
|
+
VideoBufferType,
|
|
158
|
+
VideoCodec,
|
|
159
|
+
VideoFrame,
|
|
160
|
+
VideoRotation,
|
|
161
|
+
VideoSource,
|
|
162
|
+
VideoStream,
|
|
163
|
+
combineAudioFrames,
|
|
164
|
+
dispose
|
|
165
|
+
});
|
|
166
|
+
//# 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, type RoomOptions, type RtcConfiguration } from './room.js';\nexport { Participant, RemoteParticipant, LocalParticipant } from './participant.js';\nexport {\n Track,\n type LocalTrack,\n type RemoteTrack,\n type VideoTrack,\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n type 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, type 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 { type Transcription, type TranscriptionSegment } from './transcription.js';\nexport {\n E2EEManager,\n type E2EEOptions,\n type KeyProviderOptions,\n KeyProvider,\n FrameCryptor,\n} 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;AAIA,sBAAuB;AAEvB,qBAMO;AACP,sBAA4B;AAC5B,4BAA2B;AAE3B,kBAAuF;AACvF,yBAAiE;AACjE,mBAUO;AACP,yBAA2B;AAC3B,yBAA+C;AAC/C,0BAA4B;AAC5B,6BAAsD;AACtD,0BAAkD;AAClD,0BAA4B;AAC5B,0BAA4B;AAC5B,+BAIO;AACP,2BAA8D;AAC9D,kBAMO;AAEP,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.d.ts
CHANGED
|
@@ -3,19 +3,19 @@ import type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './
|
|
|
3
3
|
import { IceServerSchema, type IceServer as IceServerType, type TrackPublishOptions as TrackPublishOptionsType } from './proto/room_pb.js';
|
|
4
4
|
import { TrackSource } from './proto/track_pb.js';
|
|
5
5
|
import { VideoCodec } from './proto/video_frame_pb.js';
|
|
6
|
-
export { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from './room.js';
|
|
6
|
+
export { Room, RoomEvent, ConnectError, type RoomOptions, type RtcConfiguration } from './room.js';
|
|
7
7
|
export { Participant, RemoteParticipant, LocalParticipant } from './participant.js';
|
|
8
|
-
export { Track, LocalTrack, RemoteTrack, VideoTrack, LocalAudioTrack, LocalVideoTrack, RemoteAudioTrack, RemoteVideoTrack, AudioTrack, } from './track.js';
|
|
8
|
+
export { Track, type LocalTrack, type RemoteTrack, type VideoTrack, LocalAudioTrack, LocalVideoTrack, RemoteAudioTrack, RemoteVideoTrack, type AudioTrack, } from './track.js';
|
|
9
9
|
export { VideoFrame } from './video_frame.js';
|
|
10
10
|
export { AudioFrame, combineAudioFrames } from './audio_frame.js';
|
|
11
11
|
export { AudioStream } from './audio_stream.js';
|
|
12
12
|
export { AudioResampler, AudioResamplerQuality } from './audio_resampler.js';
|
|
13
|
-
export { VideoStream, VideoFrameEvent } from './video_stream.js';
|
|
13
|
+
export { VideoStream, type VideoFrameEvent } from './video_stream.js';
|
|
14
14
|
export { AudioSource } from './audio_source.js';
|
|
15
15
|
export { VideoSource } from './video_source.js';
|
|
16
16
|
export { TrackPublication, RemoteTrackPublication, LocalTrackPublication, } from './track_publication.js';
|
|
17
|
-
export { Transcription, TranscriptionSegment } from './transcription.js';
|
|
18
|
-
export { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from './e2ee.js';
|
|
17
|
+
export { type Transcription, type TranscriptionSegment } from './transcription.js';
|
|
18
|
+
export { E2EEManager, type E2EEOptions, type KeyProviderOptions, KeyProvider, FrameCryptor, } from './e2ee.js';
|
|
19
19
|
export { ConnectionQuality, IceTransportType, DataPacketKind, ContinualGatheringPolicy, ConnectionState, } from './proto/room_pb.js';
|
|
20
20
|
export { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';
|
|
21
21
|
export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAEL,eAAe,EACf,KAAK,SAAS,IAAI,aAAa,EAC/B,KAAK,mBAAmB,IAAI,u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QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;gBACL,IAAI,EAAE,aAAa;CAOhC;AAED,qBAAa,mBAAoB,YAAW,uBAAuB;IACjE,SAAS,sCAAgD;IACzD,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;gBAED,IAAI,GAAE,gBAAgB,CAAC,OAAO,yBAAyB,CAAM;CAe1E"}
|
package/dist/index.js
CHANGED
|
@@ -1,52 +1,123 @@
|
|
|
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 } from "./room.js";
|
|
10
|
+
import { Participant, RemoteParticipant, LocalParticipant } from "./participant.js";
|
|
11
|
+
import {
|
|
12
|
+
Track,
|
|
13
|
+
LocalAudioTrack,
|
|
14
|
+
LocalVideoTrack,
|
|
15
|
+
RemoteAudioTrack,
|
|
16
|
+
RemoteVideoTrack
|
|
17
|
+
} from "./track.js";
|
|
18
|
+
import { VideoFrame } from "./video_frame.js";
|
|
19
|
+
import { AudioFrame, combineAudioFrames } from "./audio_frame.js";
|
|
20
|
+
import { AudioStream } from "./audio_stream.js";
|
|
21
|
+
import { AudioResampler, AudioResamplerQuality } from "./audio_resampler.js";
|
|
22
|
+
import { VideoStream } from "./video_stream.js";
|
|
23
|
+
import { AudioSource } from "./audio_source.js";
|
|
24
|
+
import { VideoSource } from "./video_source.js";
|
|
25
|
+
import {
|
|
26
|
+
TrackPublication,
|
|
27
|
+
RemoteTrackPublication,
|
|
28
|
+
LocalTrackPublication
|
|
29
|
+
} from "./track_publication.js";
|
|
30
|
+
import {} from "./transcription.js";
|
|
31
|
+
import {
|
|
32
|
+
E2EEManager,
|
|
33
|
+
KeyProvider,
|
|
34
|
+
FrameCryptor
|
|
35
|
+
} 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
|
+
ConnectError,
|
|
84
|
+
ConnectionQuality,
|
|
85
|
+
ConnectionState,
|
|
86
|
+
ContinualGatheringPolicy,
|
|
87
|
+
DataPacketKind,
|
|
88
|
+
E2EEManager,
|
|
89
|
+
EncryptionState,
|
|
90
|
+
EncryptionType,
|
|
91
|
+
FrameCryptor,
|
|
92
|
+
IceServer,
|
|
93
|
+
IceTransportType,
|
|
94
|
+
KeyProvider,
|
|
95
|
+
LocalAudioTrack,
|
|
96
|
+
LocalParticipant,
|
|
97
|
+
LocalTrackPublication,
|
|
98
|
+
LocalVideoTrack,
|
|
99
|
+
Participant,
|
|
100
|
+
ParticipantKind,
|
|
101
|
+
RemoteAudioTrack,
|
|
102
|
+
RemoteParticipant,
|
|
103
|
+
RemoteTrackPublication,
|
|
104
|
+
RemoteVideoTrack,
|
|
105
|
+
Room,
|
|
106
|
+
RoomEvent,
|
|
107
|
+
RpcError,
|
|
108
|
+
StreamState,
|
|
109
|
+
Track,
|
|
110
|
+
TrackKind,
|
|
111
|
+
TrackPublication,
|
|
112
|
+
TrackPublishOptions,
|
|
113
|
+
TrackSource2 as TrackSource,
|
|
114
|
+
VideoBufferType,
|
|
115
|
+
VideoCodec2 as VideoCodec,
|
|
116
|
+
VideoFrame,
|
|
117
|
+
VideoRotation,
|
|
118
|
+
VideoSource,
|
|
119
|
+
VideoStream,
|
|
120
|
+
combineAudioFrames,
|
|
121
|
+
dispose
|
|
122
|
+
};
|
|
52
123
|
//# 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, type RoomOptions, type RtcConfiguration } from './room.js';\nexport { Participant, RemoteParticipant, LocalParticipant } from './participant.js';\nexport {\n Track,\n type LocalTrack,\n type RemoteTrack,\n type VideoTrack,\n LocalAudioTrack,\n LocalVideoTrack,\n RemoteAudioTrack,\n RemoteVideoTrack,\n type 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, type 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 { type Transcription, type TranscriptionSegment } from './transcription.js';\nexport {\n E2EEManager,\n type E2EEOptions,\n type KeyProviderOptions,\n KeyProvider,\n FrameCryptor,\n} 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,oBAA6D;AACvF,SAAS,aAAa,mBAAmB,wBAAwB;AACjE;AAAA,EACE;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,kBAAkB;AAC3B,SAAS,YAAY,0BAA0B;AAC/C,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB,6BAA6B;AACtD,SAAS,mBAAyC;AAClD,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,eAA8D;AAC9D;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAEP;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 declare function livekitInitialize(\n callback: (data: Uint8Array) => void,\n captureLogs: boolean,\n sdkVersion: string,\n): void;\nexport declare function livekitFfiRequest(data: Uint8Array): Uint8Array;\nexport declare function livekitRetrievePtr(handle: Uint8Array): bigint;\nexport declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;\nexport declare 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":[]}
|