@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/track.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/track.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { create } from '@bufbuild/protobuf';\nimport type { AudioSource } from './audio_source.js';\nimport { FfiClient, FfiHandle } from './ffi_client.js';\nimport type {\n CreateAudioTrackResponse,\n CreateVideoTrackResponse,\n OwnedTrack,\n StreamState,\n TrackInfo,\n TrackKind,\n} from './proto/track_pb.js';\nimport { CreateAudioTrackRequestSchema, CreateVideoTrackRequestSchema } from './proto/track_pb.js';\nimport type { VideoSource } from './video_source.js';\n\nexport abstract class Track {\n /** @internal */\n info: TrackInfo;\n\n /** @internal */\n ffi_handle: FfiHandle;\n\n constructor(owned: OwnedTrack) {\n this.info = owned.info!;\n this.ffi_handle = new FfiHandle(owned.handle!.id);\n }\n\n get sid(): string {\n return this.info.sid;\n }\n\n get name(): string {\n return this.info.name;\n }\n\n get kind(): TrackKind {\n return this.info.kind;\n }\n\n get stream_state(): StreamState {\n return this.info.streamState;\n }\n\n get muted(): boolean {\n return this.info.muted;\n }\n}\n\nexport class LocalAudioTrack extends Track {\n constructor(owned: OwnedTrack) {\n super(owned);\n }\n\n static createAudioTrack(name: string, source: AudioSource): LocalAudioTrack {\n const req = create(CreateAudioTrackRequestSchema, {\n name: name,\n sourceHandle: source.ffiHandle.handle,\n });\n\n const res = FfiClient.instance.request<CreateAudioTrackResponse>({\n message: { case: 'createAudioTrack', value: req },\n });\n\n return new LocalAudioTrack(res.track!);\n }\n}\n\nexport class LocalVideoTrack extends Track {\n constructor(owned: OwnedTrack) {\n super(owned);\n }\n\n static createVideoTrack(name: string, source: VideoSource): LocalVideoTrack {\n const req = create(CreateVideoTrackRequestSchema, {\n name: name,\n sourceHandle: source.ffiHandle.handle,\n });\n\n const res = FfiClient.instance.request<CreateVideoTrackResponse>({\n message: { case: 'createVideoTrack', value: req },\n });\n\n return new LocalVideoTrack(res.track!);\n }\n}\n\nexport class RemoteVideoTrack extends Track {\n constructor(owned: OwnedTrack) {\n super(owned);\n }\n}\n\nexport class RemoteAudioTrack extends Track {\n constructor(owned: OwnedTrack) {\n super(owned);\n }\n}\n\nexport type LocalTrack = LocalVideoTrack | LocalAudioTrack;\nexport type RemoteTrack = RemoteVideoTrack | RemoteAudioTrack;\nexport type AudioTrack = LocalAudioTrack | RemoteAudioTrack;\nexport type VideoTrack = LocalVideoTrack | RemoteVideoTrack;\n"],"mappings":"AAGA,SAAS,cAAc;AAEvB,SAAS,WAAW,iBAAiB;AASrC,SAAS,+BAA+B,qCAAqC;AAGtE,MAAe,MAAM;AAAA,EAO1B,YAAY,OAAmB;AAC7B,SAAK,OAAO,MAAM;AAClB,SAAK,aAAa,IAAI,UAAU,MAAM,OAAQ,EAAE;AAAA,EAClD;AAAA,EAEA,IAAI,MAAc;AAChB,WAAO,KAAK,KAAK;AAAA,EACnB;AAAA,EAEA,IAAI,OAAe;AACjB,WAAO,KAAK,KAAK;AAAA,EACnB;AAAA,EAEA,IAAI,OAAkB;AACpB,WAAO,KAAK,KAAK;AAAA,EACnB;AAAA,EAEA,IAAI,eAA4B;AAC9B,WAAO,KAAK,KAAK;AAAA,EACnB;AAAA,EAEA,IAAI,QAAiB;AACnB,WAAO,KAAK,KAAK;AAAA,EACnB;AACF;AAEO,MAAM,wBAAwB,MAAM;AAAA,EACzC,YAAY,OAAmB;AAC7B,UAAM,KAAK;AAAA,EACb;AAAA,EAEA,OAAO,iBAAiB,MAAc,QAAsC;AAC1E,UAAM,MAAM,OAAO,+BAA+B;AAAA,MAChD;AAAA,MACA,cAAc,OAAO,UAAU;AAAA,IACjC,CAAC;AAED,UAAM,MAAM,UAAU,SAAS,QAAkC;AAAA,MAC/D,SAAS,EAAE,MAAM,oBAAoB,OAAO,IAAI;AAAA,IAClD,CAAC;AAED,WAAO,IAAI,gBAAgB,IAAI,KAAM;AAAA,EACvC;AACF;AAEO,MAAM,wBAAwB,MAAM;AAAA,EACzC,YAAY,OAAmB;AAC7B,UAAM,KAAK;AAAA,EACb;AAAA,EAEA,OAAO,iBAAiB,MAAc,QAAsC;AAC1E,UAAM,MAAM,OAAO,+BAA+B;AAAA,MAChD;AAAA,MACA,cAAc,OAAO,UAAU;AAAA,IACjC,CAAC;AAED,UAAM,MAAM,UAAU,SAAS,QAAkC;AAAA,MAC/D,SAAS,EAAE,MAAM,oBAAoB,OAAO,IAAI;AAAA,IAClD,CAAC;AAED,WAAO,IAAI,gBAAgB,IAAI,KAAM;AAAA,EACvC;AACF;AAEO,MAAM,yBAAyB,MAAM;AAAA,EAC1C,YAAY,OAAmB;AAC7B,UAAM,KAAK;AAAA,EACb;AACF;AAEO,MAAM,yBAAyB,MAAM;AAAA,EAC1C,YAAY,OAAmB;AAC7B,UAAM,KAAK;AAAA,EACb;AACF;","names":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
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 track_publication_exports = {};
|
|
20
|
+
__export(track_publication_exports, {
|
|
21
|
+
LocalTrackPublication: () => LocalTrackPublication,
|
|
22
|
+
RemoteTrackPublication: () => RemoteTrackPublication,
|
|
23
|
+
TrackPublication: () => TrackPublication
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(track_publication_exports);
|
|
26
|
+
var import_protobuf = require("@bufbuild/protobuf");
|
|
27
|
+
var import_ffi_client = require("./ffi_client.cjs");
|
|
28
|
+
var import_native = require("./napi/native.cjs");
|
|
29
|
+
var import_room_pb = require("./proto/room_pb.cjs");
|
|
30
|
+
class TrackPublication {
|
|
31
|
+
constructor(ownedInfo) {
|
|
32
|
+
this.info = ownedInfo.info;
|
|
33
|
+
this.ffiHandle = new import_native.FfiHandle(ownedInfo.handle.id);
|
|
34
|
+
}
|
|
35
|
+
get sid() {
|
|
36
|
+
return this.info.sid;
|
|
37
|
+
}
|
|
38
|
+
get name() {
|
|
39
|
+
return this.info.name;
|
|
40
|
+
}
|
|
41
|
+
get kind() {
|
|
42
|
+
return this.info.kind;
|
|
43
|
+
}
|
|
44
|
+
get source() {
|
|
45
|
+
return this.info.source;
|
|
46
|
+
}
|
|
47
|
+
get simulcasted() {
|
|
48
|
+
return this.info.simulcasted;
|
|
49
|
+
}
|
|
50
|
+
get width() {
|
|
51
|
+
return this.info.width;
|
|
52
|
+
}
|
|
53
|
+
get height() {
|
|
54
|
+
return this.info.height;
|
|
55
|
+
}
|
|
56
|
+
get mimeType() {
|
|
57
|
+
return this.info.mimeType;
|
|
58
|
+
}
|
|
59
|
+
get muted() {
|
|
60
|
+
return this.info.muted;
|
|
61
|
+
}
|
|
62
|
+
get encryptionType() {
|
|
63
|
+
return this.info.encryptionType;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
class LocalTrackPublication extends TrackPublication {
|
|
67
|
+
constructor(ownedInfo) {
|
|
68
|
+
super(ownedInfo);
|
|
69
|
+
this.firstSubscriptionResolver = null;
|
|
70
|
+
this.firstSubscription = new Promise((resolve) => {
|
|
71
|
+
this.firstSubscriptionResolver = resolve;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
async waitForSubscription() {
|
|
75
|
+
await this.firstSubscription;
|
|
76
|
+
}
|
|
77
|
+
/** @internal */
|
|
78
|
+
resolveFirstSubscription() {
|
|
79
|
+
if (this.firstSubscriptionResolver) {
|
|
80
|
+
this.firstSubscriptionResolver();
|
|
81
|
+
this.firstSubscriptionResolver = null;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
class RemoteTrackPublication extends TrackPublication {
|
|
86
|
+
constructor(ownedInfo) {
|
|
87
|
+
super(ownedInfo);
|
|
88
|
+
this.subscribed = false;
|
|
89
|
+
}
|
|
90
|
+
setSubscribed(subscribed) {
|
|
91
|
+
const req = (0, import_protobuf.create)(import_room_pb.SetSubscribedRequestSchema, {
|
|
92
|
+
subscribe: subscribed,
|
|
93
|
+
publicationHandle: this.ffiHandle.handle
|
|
94
|
+
});
|
|
95
|
+
import_ffi_client.FfiClient.instance.request({
|
|
96
|
+
message: { case: "setSubscribed", value: req }
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
+
0 && (module.exports = {
|
|
102
|
+
LocalTrackPublication,
|
|
103
|
+
RemoteTrackPublication,
|
|
104
|
+
TrackPublication
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=track_publication.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/track_publication.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { create } from '@bufbuild/protobuf';\nimport { FfiClient } from './ffi_client.js';\nimport { FfiHandle } from './napi/native.js';\nimport type { EncryptionType } from './proto/e2ee_pb.js';\nimport type { SetSubscribedResponse } from './proto/room_pb.js';\nimport { SetSubscribedRequestSchema } from './proto/room_pb.js';\nimport type {\n OwnedTrackPublication,\n TrackKind,\n TrackPublicationInfo,\n TrackSource,\n} from './proto/track_pb.js';\nimport type { Track } from './track.js';\n\nexport abstract class TrackPublication {\n /** @internal */\n ffiHandle: FfiHandle;\n\n /** @internal */\n info: TrackPublicationInfo;\n track?: Track;\n\n constructor(ownedInfo: OwnedTrackPublication) {\n this.info = ownedInfo.info!;\n this.ffiHandle = new FfiHandle(ownedInfo!.handle!.id);\n }\n\n get sid(): string {\n return this.info.sid;\n }\n\n get name(): string {\n return this.info.name;\n }\n\n get kind(): TrackKind {\n return this.info.kind;\n }\n\n get source(): TrackSource {\n return this.info.source;\n }\n\n get simulcasted(): boolean {\n return this.info.simulcasted;\n }\n\n get width(): number {\n return this.info.width;\n }\n\n get height(): number {\n return this.info.height;\n }\n\n get mimeType(): string {\n return this.info.mimeType;\n }\n\n get muted(): boolean {\n return this.info.muted;\n }\n\n get encryptionType(): EncryptionType {\n return this.info.encryptionType;\n }\n}\n\nexport class LocalTrackPublication extends TrackPublication {\n private firstSubscription: Promise<void>;\n private firstSubscriptionResolver: (() => void) | null = null;\n\n constructor(ownedInfo: OwnedTrackPublication) {\n super(ownedInfo);\n this.firstSubscription = new Promise<void>((resolve) => {\n this.firstSubscriptionResolver = resolve;\n });\n }\n\n async waitForSubscription(): Promise<void> {\n await this.firstSubscription;\n }\n\n /** @internal */\n resolveFirstSubscription(): void {\n if (this.firstSubscriptionResolver) {\n this.firstSubscriptionResolver();\n this.firstSubscriptionResolver = null;\n }\n }\n}\n\nexport class RemoteTrackPublication extends TrackPublication {\n subscribed: boolean = false;\n\n constructor(ownedInfo: OwnedTrackPublication) {\n super(ownedInfo);\n }\n\n setSubscribed(subscribed: boolean) {\n const req = create(SetSubscribedRequestSchema, {\n subscribe: subscribed,\n publicationHandle: this.ffiHandle.handle,\n });\n\n FfiClient.instance.request<SetSubscribedResponse>({\n message: { case: 'setSubscribed', value: req },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuB;AACvB,wBAA0B;AAC1B,oBAA0B;AAG1B,qBAA2C;AASpC,MAAe,iBAAiB;AAAA,EAQrC,YAAY,WAAkC;AAC5C,SAAK,OAAO,UAAU;AACtB,SAAK,YA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AmB,KAAK,UAAU;AAAA,IACpC,CAAC;AAED,gCAAU,SAAS,QAA+B;AAAA,MAChD,SAAS,EAAE,MAAM,iBAAiB,OAAO,IAAI;AAAA,IAC/C,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1,78 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
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
|
-
get encryptionType() {
|
|
41
|
-
return this.info.encryptionType;
|
|
42
|
-
}
|
|
1
|
+
import { create } from "@bufbuild/protobuf";
|
|
2
|
+
import { FfiClient } from "./ffi_client.js";
|
|
3
|
+
import { FfiHandle } from "./napi/native.js";
|
|
4
|
+
import { SetSubscribedRequestSchema } from "./proto/room_pb.js";
|
|
5
|
+
class TrackPublication {
|
|
6
|
+
constructor(ownedInfo) {
|
|
7
|
+
this.info = ownedInfo.info;
|
|
8
|
+
this.ffiHandle = new FfiHandle(ownedInfo.handle.id);
|
|
9
|
+
}
|
|
10
|
+
get sid() {
|
|
11
|
+
return this.info.sid;
|
|
12
|
+
}
|
|
13
|
+
get name() {
|
|
14
|
+
return this.info.name;
|
|
15
|
+
}
|
|
16
|
+
get kind() {
|
|
17
|
+
return this.info.kind;
|
|
18
|
+
}
|
|
19
|
+
get source() {
|
|
20
|
+
return this.info.source;
|
|
21
|
+
}
|
|
22
|
+
get simulcasted() {
|
|
23
|
+
return this.info.simulcasted;
|
|
24
|
+
}
|
|
25
|
+
get width() {
|
|
26
|
+
return this.info.width;
|
|
27
|
+
}
|
|
28
|
+
get height() {
|
|
29
|
+
return this.info.height;
|
|
30
|
+
}
|
|
31
|
+
get mimeType() {
|
|
32
|
+
return this.info.mimeType;
|
|
33
|
+
}
|
|
34
|
+
get muted() {
|
|
35
|
+
return this.info.muted;
|
|
36
|
+
}
|
|
37
|
+
get encryptionType() {
|
|
38
|
+
return this.info.encryptionType;
|
|
39
|
+
}
|
|
43
40
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
class LocalTrackPublication extends TrackPublication {
|
|
42
|
+
constructor(ownedInfo) {
|
|
43
|
+
super(ownedInfo);
|
|
44
|
+
this.firstSubscriptionResolver = null;
|
|
45
|
+
this.firstSubscription = new Promise((resolve) => {
|
|
46
|
+
this.firstSubscriptionResolver = resolve;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async waitForSubscription() {
|
|
50
|
+
await this.firstSubscription;
|
|
51
|
+
}
|
|
52
|
+
/** @internal */
|
|
53
|
+
resolveFirstSubscription() {
|
|
54
|
+
if (this.firstSubscriptionResolver) {
|
|
55
|
+
this.firstSubscriptionResolver();
|
|
56
|
+
this.firstSubscriptionResolver = null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
62
59
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
class RemoteTrackPublication extends TrackPublication {
|
|
61
|
+
constructor(ownedInfo) {
|
|
62
|
+
super(ownedInfo);
|
|
63
|
+
this.subscribed = false;
|
|
64
|
+
}
|
|
65
|
+
setSubscribed(subscribed) {
|
|
66
|
+
const req = create(SetSubscribedRequestSchema, {
|
|
67
|
+
subscribe: subscribed,
|
|
68
|
+
publicationHandle: this.ffiHandle.handle
|
|
69
|
+
});
|
|
70
|
+
FfiClient.instance.request({
|
|
71
|
+
message: { case: "setSubscribed", value: req }
|
|
72
|
+
});
|
|
73
|
+
}
|
|
77
74
|
}
|
|
75
|
+
export {
|
|
76
|
+
LocalTrackPublication,
|
|
77
|
+
RemoteTrackPublication,
|
|
78
|
+
TrackPublication
|
|
79
|
+
};
|
|
78
80
|
//# sourceMappingURL=track_publication.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/track_publication.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { create } from '@bufbuild/protobuf';\nimport { FfiClient } from './ffi_client.js';\nimport { FfiHandle } from './napi/native.js';\nimport type { EncryptionType } from './proto/e2ee_pb.js';\nimport type { SetSubscribedResponse } from './proto/room_pb.js';\nimport { SetSubscribedRequestSchema } from './proto/room_pb.js';\nimport type {\n OwnedTrackPublication,\n TrackKind,\n TrackPublicationInfo,\n TrackSource,\n} from './proto/track_pb.js';\nimport type { Track } from './track.js';\n\nexport abstract class TrackPublication {\n /** @internal */\n ffiHandle: FfiHandle;\n\n /** @internal */\n info: TrackPublicationInfo;\n track?: Track;\n\n constructor(ownedInfo: OwnedTrackPublication) {\n this.info = ownedInfo.info!;\n this.ffiHandle = new FfiHandle(ownedInfo!.handle!.id);\n }\n\n get sid(): string {\n return this.info.sid;\n }\n\n get name(): string {\n return this.info.name;\n }\n\n get kind(): TrackKind {\n return this.info.kind;\n }\n\n get source(): TrackSource {\n return this.info.source;\n }\n\n get simulcasted(): boolean {\n return this.info.simulcasted;\n }\n\n get width(): number {\n return this.info.width;\n }\n\n get height(): number {\n return this.info.height;\n }\n\n get mimeType(): string {\n return this.info.mimeType;\n }\n\n get muted(): boolean {\n return this.info.muted;\n }\n\n get encryptionType(): EncryptionType {\n return this.info.encryptionType;\n }\n}\n\nexport class LocalTrackPublication extends TrackPublication {\n private firstSubscription: Promise<void>;\n private firstSubscriptionResolver: (() => void) | null = null;\n\n constructor(ownedInfo: OwnedTrackPublication) {\n super(ownedInfo);\n this.firstSubscription = new Promise<void>((resolve) => {\n this.firstSubscriptionResolver = resolve;\n });\n }\n\n async waitForSubscription(): Promise<void> {\n await this.firstSubscription;\n }\n\n /** @internal */\n resolveFirstSubscription(): void {\n if (this.firstSubscriptionResolver) {\n this.firstSubscriptionResolver();\n this.firstSubscriptionResolver = null;\n }\n }\n}\n\nexport class RemoteTrackPublication extends TrackPublication {\n subscribed: boolean = false;\n\n constructor(ownedInfo: OwnedTrackPublication) {\n super(ownedInfo);\n }\n\n setSubscribed(subscribed: boolean) {\n const req = create(SetSubscribedRequestSchema, {\n subscribe: subscribed,\n publicationHandle: this.ffiHandle.handle,\n });\n\n FfiClient.instance.request<SetSubscribedResponse>({\n message: { case: 'setSubscribed', value: req },\n });\n }\n}\n"],"mappings":"AAGA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,kCAAkC;AASpC,MAAe,iBAAiB;AAAA,EAQrC,YAAY,WAAkC;AAC5C,SAAK,OAAO,UAAU;AACtB,SAAK,YAAY,IAAI,UAAU,UAAW,OAAQ,EAAE;AAAA,EACtD;AAAA,EAEA,IAAI,MAAc;AAChB,WAAO,KAAK,KAAK;AAAA,EACnB;AAAA,EAEA,IAAI,OAAe;AACjB,WAAO,KAAK,KAAK;AAAA,EACnB;AAAA,EAEA,IAAI,OAAkB;AACpB,WAAO,KAAK,KAAK;AAAA,EACnB;AAAA,EAE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
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 transcription_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(transcription_exports);
|
|
17
|
+
//# sourceMappingURL=transcription.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/transcription.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nexport interface TranscriptionSegment {\n id: string;\n text: string;\n startTime: bigint;\n endTime: bigint;\n language: string;\n final: boolean;\n}\n\nexport interface Transcription {\n participantIdentity: string;\n trackSid: string;\n segments: TranscriptionSegment[];\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/transcription.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/types.cjs
ADDED
|
@@ -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 types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nexport interface ChatMessage {\n id: string;\n timestamp: number;\n message: string;\n editTimestamp?: number;\n generated?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/version.cjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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 version_exports = {};
|
|
20
|
+
__export(version_exports, {
|
|
21
|
+
SDK_VERSION: () => SDK_VERSION
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(version_exports);
|
|
24
|
+
const SDK_VERSION = "0.12.1";
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
SDK_VERSION
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=version.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const SDK_VERSION = \"0.12.1\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;","names":[]}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const SDK_VERSION = \"0.12.1\";\n"],"mappings":"AAAO,MAAM,cAAc;","names":[]}
|