@livekit/rtc-node 0.12.1 → 0.13.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 +2 -2
- package/dist/audio_frame.cjs.map +1 -1
- package/dist/audio_frame.d.cts +31 -0
- package/dist/audio_frame.d.ts +11 -5
- package/dist/audio_frame.d.ts.map +1 -1
- package/dist/audio_frame.js +3 -3
- package/dist/audio_frame.js.map +1 -1
- package/dist/audio_resampler.cjs +10 -7
- package/dist/audio_resampler.cjs.map +1 -1
- package/dist/audio_resampler.d.cts +59 -0
- package/dist/audio_resampler.d.ts +11 -3
- package/dist/audio_resampler.d.ts.map +1 -1
- package/dist/audio_resampler.js +13 -10
- package/dist/audio_resampler.js.map +1 -1
- package/dist/audio_source.cjs +6 -4
- package/dist/audio_source.cjs.map +1 -1
- package/dist/audio_source.d.cts +37 -0
- package/dist/audio_source.d.ts +13 -5
- package/dist/audio_source.d.ts.map +1 -1
- package/dist/audio_source.js +9 -7
- package/dist/audio_source.js.map +1 -1
- package/dist/audio_stream.cjs +1 -2
- package/dist/audio_stream.cjs.map +1 -1
- package/dist/audio_stream.d.cts +37 -0
- package/dist/audio_stream.d.ts +16 -5
- package/dist/audio_stream.d.ts.map +1 -1
- package/dist/audio_stream.js +2 -3
- package/dist/audio_stream.js.map +1 -1
- package/dist/e2ee.cjs +19 -20
- package/dist/e2ee.cjs.map +1 -1
- package/dist/e2ee.d.cts +47 -0
- package/dist/e2ee.d.ts +11 -8
- package/dist/e2ee.d.ts.map +1 -1
- package/dist/e2ee.js +29 -30
- package/dist/e2ee.js.map +1 -1
- package/dist/ffi_client.cjs +6 -5
- package/dist/ffi_client.cjs.map +1 -1
- package/dist/ffi_client.d.cts +35 -0
- package/dist/ffi_client.d.ts +23 -11
- package/dist/ffi_client.d.ts.map +1 -1
- package/dist/ffi_client.js +6 -10
- package/dist/ffi_client.js.map +1 -1
- package/dist/index.cjs +16 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -0
- package/dist/index.d.ts +20 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -46
- package/dist/index.js.map +1 -1
- package/dist/napi/native.d.cjs.map +1 -1
- package/dist/napi/native.d.d.cts +21 -0
- package/dist/napi/native.d.d.ts +21 -0
- package/dist/napi/native.d.ts +5 -5
- package/dist/native.d.ts +5 -5
- package/dist/participant.cjs +57 -34
- package/dist/participant.cjs.map +1 -1
- package/dist/participant.d.cts +126 -0
- package/dist/participant.d.ts +34 -20
- package/dist/participant.d.ts.map +1 -1
- package/dist/participant.js +75 -50
- package/dist/participant.js.map +1 -1
- package/dist/proto/audio_frame_pb.cjs +977 -125
- package/dist/proto/audio_frame_pb.cjs.map +1 -1
- package/dist/proto/audio_frame_pb.d.cts +898 -0
- package/dist/proto/audio_frame_pb.d.ts +506 -417
- package/dist/proto/audio_frame_pb.d.ts.map +1 -1
- package/dist/proto/audio_frame_pb.js +943 -85
- package/dist/proto/audio_frame_pb.js.map +1 -1
- package/dist/proto/e2ee_pb.cjs +700 -85
- package/dist/proto/e2ee_pb.cjs.map +1 -1
- package/dist/proto/e2ee_pb.d.cts +653 -0
- package/dist/proto/e2ee_pb.d.ts +333 -263
- package/dist/proto/e2ee_pb.d.ts.map +1 -1
- package/dist/proto/e2ee_pb.js +675 -57
- package/dist/proto/e2ee_pb.js.map +1 -1
- package/dist/proto/ffi_pb.cjs +369 -36
- package/dist/proto/ffi_pb.cjs.map +1 -1
- package/dist/proto/ffi_pb.d.cts +898 -0
- package/dist/proto/ffi_pb.d.ts +164 -112
- package/dist/proto/ffi_pb.d.ts.map +1 -1
- package/dist/proto/ffi_pb.js +364 -29
- package/dist/proto/ffi_pb.js.map +1 -1
- package/dist/proto/handle_pb.cjs +27 -7
- package/dist/proto/handle_pb.cjs.map +1 -1
- package/dist/proto/handle_pb.d.cts +31 -0
- package/dist/proto/handle_pb.d.ts +15 -15
- package/dist/proto/handle_pb.d.ts.map +1 -1
- package/dist/proto/handle_pb.js +26 -5
- package/dist/proto/handle_pb.js.map +1 -1
- package/dist/proto/participant_pb.cjs +112 -15
- package/dist/proto/participant_pb.cjs.map +1 -1
- package/dist/proto/participant_pb.d.cts +181 -0
- package/dist/proto/participant_pb.d.ts +143 -53
- package/dist/proto/participant_pb.d.ts.map +1 -1
- package/dist/proto/participant_pb.js +109 -11
- package/dist/proto/participant_pb.js.map +1 -1
- package/dist/proto/room_pb.cjs +2693 -302
- package/dist/proto/room_pb.cjs.map +1 -1
- package/dist/proto/room_pb.d.cts +2475 -0
- package/dist/proto/room_pb.d.ts +1269 -864
- package/dist/proto/room_pb.d.ts.map +1 -1
- package/dist/proto/room_pb.js +2603 -210
- package/dist/proto/room_pb.js.map +1 -1
- package/dist/proto/rpc_pb.cjs +302 -37
- package/dist/proto/rpc_pb.cjs.map +1 -1
- package/dist/proto/rpc_pb.d.cts +267 -0
- package/dist/proto/rpc_pb.d.ts +140 -108
- package/dist/proto/rpc_pb.d.ts.map +1 -1
- package/dist/proto/rpc_pb.js +291 -25
- package/dist/proto/rpc_pb.js.map +1 -1
- package/dist/proto/stats_pb.cjs +1253 -139
- package/dist/proto/stats_pb.cjs.map +1 -1
- package/dist/proto/stats_pb.d.cts +1764 -0
- package/dist/proto/stats_pb.d.ts +806 -693
- package/dist/proto/stats_pb.d.ts.map +1 -1
- package/dist/proto/stats_pb.js +1216 -93
- package/dist/proto/stats_pb.js.map +1 -1
- package/dist/proto/track_pb.cjs +462 -64
- package/dist/proto/track_pb.cjs.map +1 -1
- package/dist/proto/track_pb.d.cts +434 -0
- package/dist/proto/track_pb.d.ts +254 -220
- package/dist/proto/track_pb.d.ts.map +1 -1
- package/dist/proto/track_pb.js +447 -45
- package/dist/proto/track_pb.js.map +1 -1
- package/dist/proto/track_publication_pb.cjs +130 -0
- package/dist/proto/track_publication_pb.cjs.map +1 -0
- package/dist/proto/track_publication_pb.d.cts +80 -0
- package/dist/proto/track_publication_pb.d.ts +80 -0
- package/dist/proto/track_publication_pb.d.ts.map +1 -0
- package/dist/proto/track_publication_pb.js +103 -0
- package/dist/proto/track_publication_pb.js.map +1 -0
- package/dist/proto/video_frame_pb.cjs +648 -88
- package/dist/proto/video_frame_pb.cjs.map +1 -1
- package/dist/proto/video_frame_pb.d.cts +660 -0
- package/dist/proto/video_frame_pb.d.ts +375 -328
- package/dist/proto/video_frame_pb.d.ts.map +1 -1
- package/dist/proto/video_frame_pb.js +626 -60
- package/dist/proto/video_frame_pb.js.map +1 -1
- package/dist/room.cjs +93 -125
- package/dist/room.cjs.map +1 -1
- package/dist/room.d.cts +123 -0
- package/dist/room.d.ts +37 -34
- package/dist/room.d.ts.map +1 -1
- package/dist/room.js +92 -122
- package/dist/room.js.map +1 -1
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +81 -0
- package/dist/rpc.d.ts +10 -7
- package/dist/rpc.js.map +1 -1
- package/dist/track.cjs +12 -8
- package/dist/track.cjs.map +1 -1
- package/dist/track.d.cts +45 -0
- package/dist/track.d.ts +30 -20
- package/dist/track.d.ts.map +1 -1
- package/dist/track.js +13 -9
- package/dist/track.js.map +1 -1
- package/dist/track_publication.cjs +21 -12
- package/dist/track_publication.cjs.map +1 -1
- package/dist/track_publication.d.cts +47 -0
- package/dist/track_publication.d.ts +30 -19
- package/dist/track_publication.d.ts.map +1 -1
- package/dist/track_publication.js +22 -13
- package/dist/track_publication.js.map +1 -1
- package/dist/transcription.d.cts +15 -0
- package/dist/transcription.d.ts +4 -3
- package/dist/types.d.cts +9 -0
- package/dist/types.d.ts +3 -2
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +3 -0
- package/dist/version.d.ts +3 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/video_frame.cjs +26 -45
- package/dist/video_frame.cjs.map +1 -1
- package/dist/video_frame.d.cts +24 -0
- package/dist/video_frame.d.ts +10 -4
- package/dist/video_frame.d.ts.map +1 -1
- package/dist/video_frame.js +29 -48
- package/dist/video_frame.js.map +1 -1
- package/dist/video_source.cjs +7 -4
- package/dist/video_source.cjs.map +1 -1
- package/dist/video_source.d.cts +22 -0
- package/dist/video_source.d.ts +14 -7
- package/dist/video_source.d.ts.map +1 -1
- package/dist/video_source.js +9 -6
- package/dist/video_source.js.map +1 -1
- package/dist/video_stream.cjs +16 -5
- package/dist/video_stream.cjs.map +1 -1
- package/dist/video_stream.d.cts +40 -0
- package/dist/video_stream.d.ts +18 -7
- package/dist/video_stream.d.ts.map +1 -1
- package/dist/video_stream.js +17 -6
- package/dist/video_stream.js.map +1 -1
- package/package.json +17 -12
- package/src/audio_frame.ts +10 -10
- package/src/audio_resampler.ts +15 -13
- package/src/audio_source.ts +11 -8
- package/src/audio_stream.ts +3 -4
- package/src/e2ee.ts +36 -37
- package/src/ffi_client.ts +8 -16
- package/src/index.ts +5 -68
- package/src/napi/native.d.ts +5 -5
- package/src/participant.ts +100 -72
- package/src/proto/audio_frame_pb.ts +1220 -496
- package/src/proto/e2ee_pb.ts +858 -337
- package/src/proto/ffi_pb.ts +442 -135
- package/src/proto/handle_pb.ts +33 -19
- package/src/proto/participant_pb.ts +225 -60
- package/src/proto/room_pb.ts +3149 -1013
- package/src/proto/rpc_pb.ts +358 -129
- package/src/proto/stats_pb.ts +1891 -877
- package/src/proto/track_pb.ts +587 -253
- package/src/proto/track_publication_pb.ts +180 -0
- package/src/proto/video_frame_pb.ts +861 -394
- package/src/room.ts +143 -188
- package/src/rpc.ts +1 -1
- package/src/track.ts +16 -17
- package/src/track_publication.ts +25 -26
- package/src/version.ts +1 -1
- package/src/video_frame.ts +48 -72
- package/src/video_source.ts +11 -8
- package/src/video_stream.ts +18 -8
package/dist/rpc.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RpcError as RpcError$1 } from './proto/rpc_pb.js';
|
|
2
|
+
import '@bufbuild/protobuf';
|
|
3
|
+
|
|
2
4
|
/** Parameters for initiating an RPC call */
|
|
3
|
-
|
|
5
|
+
interface PerformRpcParams {
|
|
4
6
|
/** The `identity` of the destination participant */
|
|
5
7
|
destinationIdentity: string;
|
|
6
8
|
/** The method name to call */
|
|
@@ -13,7 +15,7 @@ export interface PerformRpcParams {
|
|
|
13
15
|
/**
|
|
14
16
|
* Data passed to method handler for incoming RPC invocations
|
|
15
17
|
*/
|
|
16
|
-
|
|
18
|
+
interface RpcInvocationData {
|
|
17
19
|
/**
|
|
18
20
|
* The unique request ID. Will match at both sides of the call, useful for debugging or logging.
|
|
19
21
|
*/
|
|
@@ -39,7 +41,7 @@ export interface RpcInvocationData {
|
|
|
39
41
|
*
|
|
40
42
|
* Built-in types are included but developers may use any string, with a max length of 256 bytes.
|
|
41
43
|
*/
|
|
42
|
-
|
|
44
|
+
declare class RpcError extends Error {
|
|
43
45
|
code: typeof RpcError.ErrorCode | number;
|
|
44
46
|
data?: string;
|
|
45
47
|
/**
|
|
@@ -50,8 +52,8 @@ export declare class RpcError extends Error {
|
|
|
50
52
|
* Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCode for their meanings).
|
|
51
53
|
*/
|
|
52
54
|
constructor(code: number, message: string, data?: string);
|
|
53
|
-
static fromProto(proto:
|
|
54
|
-
toProto():
|
|
55
|
+
static fromProto(proto: RpcError$1): RpcError;
|
|
56
|
+
toProto(): RpcError$1;
|
|
55
57
|
static ErrorCode: {
|
|
56
58
|
readonly APPLICATION_ERROR: 1500;
|
|
57
59
|
readonly CONNECTION_TIMEOUT: 1501;
|
|
@@ -75,4 +77,5 @@ export declare class RpcError extends Error {
|
|
|
75
77
|
*/
|
|
76
78
|
static builtIn(key: keyof typeof RpcError.ErrorCode, data?: string): RpcError;
|
|
77
79
|
}
|
|
78
|
-
|
|
80
|
+
|
|
81
|
+
export { type PerformRpcParams, RpcError, type RpcInvocationData };
|
package/dist/rpc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rpc.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { RpcError as RpcError_Proto } from './proto/rpc_pb.js';\n\n/** Parameters for initiating an RPC call */\nexport interface PerformRpcParams {\n /** The `identity` of the destination participant */\n destinationIdentity: string;\n /** The method name to call */\n method: string;\n /** The method payload */\n payload: string;\n /** Timeout for receiving a response after initial connection (milliseconds). Default: 10000 */\n responseTimeout?: number;\n}\n\n/**\n * Data passed to method handler for incoming RPC invocations\n */\nexport interface RpcInvocationData {\n /**\n * The unique request ID. Will match at both sides of the call, useful for debugging or logging.\n */\n requestId: string;\n\n /**\n * The unique participant identity of the caller.\n */\n callerIdentity: string;\n\n /**\n * The payload of the request. User-definable format, typically JSON.\n */\n payload: string;\n\n /**\n * The maximum time the caller will wait for a response.\n */\n responseTimeout: number;\n}\n\n/**\n * Specialized error handling for RPC methods.\n *\n * Instances of this type, when thrown in a method handler, will have their `message`\n * serialized and sent across the wire. The caller will receive an equivalent error on the other side.\n *\n * Built-in types are included but developers may use any string, with a max length of 256 bytes.\n */\n\nexport class RpcError extends Error {\n code: typeof RpcError.ErrorCode | number;\n data?: string;\n\n /**\n * Creates an error object with the given code and message, plus an optional data payload.\n *\n * If thrown in an RPC method handler, the error will be sent back to the caller.\n *\n * Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCode for their meanings).\n */\n constructor(code: number, message: string, data?: string) {\n super(message);\n this.code = code;\n this.message = message;\n this.data = data;\n }\n\n static fromProto(proto: RpcError_Proto) {\n return new RpcError(proto.code
|
|
1
|
+
{"version":3,"sources":["../src/rpc.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { RpcError as RpcError_Proto } from './proto/rpc_pb.js';\n\n/** Parameters for initiating an RPC call */\nexport interface PerformRpcParams {\n /** The `identity` of the destination participant */\n destinationIdentity: string;\n /** The method name to call */\n method: string;\n /** The method payload */\n payload: string;\n /** Timeout for receiving a response after initial connection (milliseconds). Default: 10000 */\n responseTimeout?: number;\n}\n\n/**\n * Data passed to method handler for incoming RPC invocations\n */\nexport interface RpcInvocationData {\n /**\n * The unique request ID. Will match at both sides of the call, useful for debugging or logging.\n */\n requestId: string;\n\n /**\n * The unique participant identity of the caller.\n */\n callerIdentity: string;\n\n /**\n * The payload of the request. User-definable format, typically JSON.\n */\n payload: string;\n\n /**\n * The maximum time the caller will wait for a response.\n */\n responseTimeout: number;\n}\n\n/**\n * Specialized error handling for RPC methods.\n *\n * Instances of this type, when thrown in a method handler, will have their `message`\n * serialized and sent across the wire. The caller will receive an equivalent error on the other side.\n *\n * Built-in types are included but developers may use any string, with a max length of 256 bytes.\n */\n\nexport class RpcError extends Error {\n code: typeof RpcError.ErrorCode | number;\n data?: string;\n\n /**\n * Creates an error object with the given code and message, plus an optional data payload.\n *\n * If thrown in an RPC method handler, the error will be sent back to the caller.\n *\n * Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCode for their meanings).\n */\n constructor(code: number, message: string, data?: string) {\n super(message);\n this.code = code;\n this.message = message;\n this.data = data;\n }\n\n static fromProto(proto: RpcError_Proto) {\n return new RpcError(proto.code!, proto.message!, proto.data);\n }\n\n toProto() {\n return {\n code: this.code as number,\n message: this.message,\n data: this.data,\n } as RpcError_Proto;\n }\n\n static ErrorCode = {\n APPLICATION_ERROR: 1500,\n CONNECTION_TIMEOUT: 1501,\n RESPONSE_TIMEOUT: 1502,\n RECIPIENT_DISCONNECTED: 1503,\n RESPONSE_PAYLOAD_TOO_LARGE: 1504,\n SEND_FAILED: 1505,\n\n UNSUPPORTED_METHOD: 1400,\n RECIPIENT_NOT_FOUND: 1401,\n REQUEST_PAYLOAD_TOO_LARGE: 1402,\n UNSUPPORTED_SERVER: 1403,\n } as const;\n\n /**\n * @internal\n */\n static ErrorMessage: Record<keyof typeof RpcError.ErrorCode, string> = {\n APPLICATION_ERROR: 'Application error in method handler',\n CONNECTION_TIMEOUT: 'Connection timeout',\n RESPONSE_TIMEOUT: 'Response timeout',\n RECIPIENT_DISCONNECTED: 'Recipient disconnected',\n RESPONSE_PAYLOAD_TOO_LARGE: 'Response payload too large',\n SEND_FAILED: 'Failed to send',\n\n UNSUPPORTED_METHOD: 'Method not supported at destination',\n RECIPIENT_NOT_FOUND: 'Recipient not found',\n REQUEST_PAYLOAD_TOO_LARGE: 'Request payload too large',\n UNSUPPORTED_SERVER: 'RPC not supported by server',\n } as const;\n\n /**\n * Creates an error object from the code, with an auto-populated message.\n *\n * @internal\n */\n static builtIn(key: keyof typeof RpcError.ErrorCode, data?: string): RpcError {\n return new RpcError(RpcError.ErrorCode[key], RpcError.ErrorMessage[key], data);\n }\n}\n"],"mappings":"AAmDO,MAAM,YAAN,MAAM,kBAAiB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWlC,YAAY,MAAc,SAAiB,MAAe;AACxD,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,OAAO,UAAU,OAAuB;AACtC,WAAO,IAAI,UAAS,MAAM,MAAO,MAAM,SAAU,MAAM,IAAI;AAAA,EAC7D;AAAA,EAEA,UAAU;AACR,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,SAAS,KAAK;AAAA,MACd,MAAM,KAAK;AAAA,IACb;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsCA,OAAO,QAAQ,KAAsC,MAAyB;AAC5E,WAAO,IAAI,UAAS,UAAS,UAAU,GAAG,GAAG,UAAS,aAAa,GAAG,GAAG,IAAI;AAAA,EAC/E;AACF;AArEa,UA8BJ,YAAY;AAAA,EACjB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,wBAAwB;AAAA,EACxB,4BAA4B;AAAA,EAC5B,aAAa;AAAA,EAEb,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,2BAA2B;AAAA,EAC3B,oBAAoB;AACtB;AAAA;AAAA;AAAA;AA1CW,UA+CJ,eAAgE;AAAA,EACrE,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,wBAAwB;AAAA,EACxB,4BAA4B;AAAA,EAC5B,aAAa;AAAA,EAEb,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,2BAA2B;AAAA,EAC3B,oBAAoB;AACtB;AA3DK,IAAM,WAAN;","names":[]}
|
package/dist/track.cjs
CHANGED
|
@@ -25,7 +25,6 @@ __export(track_exports, {
|
|
|
25
25
|
Track: () => Track
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(track_exports);
|
|
28
|
-
var import_protobuf = require("@bufbuild/protobuf");
|
|
29
28
|
var import_ffi_client = require("./ffi_client.cjs");
|
|
30
29
|
var import_track_pb = require("./proto/track_pb.cjs");
|
|
31
30
|
class Track {
|
|
@@ -34,19 +33,24 @@ class Track {
|
|
|
34
33
|
this.ffi_handle = new import_ffi_client.FfiHandle(owned.handle.id);
|
|
35
34
|
}
|
|
36
35
|
get sid() {
|
|
37
|
-
|
|
36
|
+
var _a;
|
|
37
|
+
return (_a = this.info) == null ? void 0 : _a.sid;
|
|
38
38
|
}
|
|
39
39
|
get name() {
|
|
40
|
-
|
|
40
|
+
var _a;
|
|
41
|
+
return (_a = this.info) == null ? void 0 : _a.name;
|
|
41
42
|
}
|
|
42
43
|
get kind() {
|
|
43
|
-
|
|
44
|
+
var _a;
|
|
45
|
+
return (_a = this.info) == null ? void 0 : _a.kind;
|
|
44
46
|
}
|
|
45
47
|
get stream_state() {
|
|
46
|
-
|
|
48
|
+
var _a;
|
|
49
|
+
return (_a = this.info) == null ? void 0 : _a.streamState;
|
|
47
50
|
}
|
|
48
51
|
get muted() {
|
|
49
|
-
|
|
52
|
+
var _a;
|
|
53
|
+
return (_a = this.info) == null ? void 0 : _a.muted;
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
class LocalAudioTrack extends Track {
|
|
@@ -54,7 +58,7 @@ class LocalAudioTrack extends Track {
|
|
|
54
58
|
super(owned);
|
|
55
59
|
}
|
|
56
60
|
static createAudioTrack(name, source) {
|
|
57
|
-
const req =
|
|
61
|
+
const req = new import_track_pb.CreateAudioTrackRequest({
|
|
58
62
|
name,
|
|
59
63
|
sourceHandle: source.ffiHandle.handle
|
|
60
64
|
});
|
|
@@ -69,7 +73,7 @@ class LocalVideoTrack extends Track {
|
|
|
69
73
|
super(owned);
|
|
70
74
|
}
|
|
71
75
|
static createVideoTrack(name, source) {
|
|
72
|
-
const req =
|
|
76
|
+
const req = new import_track_pb.CreateVideoTrackRequest({
|
|
73
77
|
name,
|
|
74
78
|
sourceHandle: source.ffiHandle.handle
|
|
75
79
|
});
|
package/dist/track.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/track.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport
|
|
1
|
+
{"version":3,"sources":["../src/track.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\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 { CreateAudioTrackRequest, CreateVideoTrackRequest } 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 | undefined {\n return this.info?.sid;\n }\n\n get name(): string | undefined {\n return this.info?.name;\n }\n\n get kind(): TrackKind | undefined {\n return this.info?.kind;\n }\n\n get stream_state(): StreamState | undefined {\n return this.info?.streamState;\n }\n\n get muted(): boolean | undefined {\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 = new CreateAudioTrackRequest({\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 = new CreateVideoTrackRequest({\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":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wBAAqC;AASrC,sBAAiE;AAG1D,MAAe,MAAM;AAAA,EAO1B,YAAY,OAAmB;AAC7B,SAAK,OAAO,MAAM;AAClB,SAAK,aAAa,IAAI,4BAAU,MAAM,OAAQ,EAAG;AAAA,EACnD;AAAA,EAEA,IAAI,MAA0B;AA5BhC;AA6BI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,OAA2B;AAhCjC;AAiCI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,OAA8B;AApCpC;AAqCI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,eAAwC;AAxC9C;AAyCI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,QAA6B;AA5CnC;AA6CI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AACF;AAEO,MAAM,wBAAwB,MAAM;AAAA,EACzC,YAAY,OAAmB;AAC7B,UAAM,KAAK;AAAA,EACb;AAAA,EAEA,OAAO,iBAAiB,MAAc,QAAsC;AAC1E,UAAM,MAAM,IAAI,wCAAwB;AAAA,MACtC;AAAA,MACA,cAAc,OAAO,UAAU;AAAA,IACjC,CAAC;AAED,UAAM,MAAM,4BAAU,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,IAAI,wCAAwB;AAAA,MACtC;AAAA,MACA,cAAc,OAAO,UAAU;AAAA,IACjC,CAAC;AAED,UAAM,MAAM,4BAAU,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":[]}
|
package/dist/track.d.cts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AudioSource } from './audio_source.cjs';
|
|
2
|
+
import { FfiHandle } from './napi/native.d.cjs';
|
|
3
|
+
import { TrackInfo, OwnedTrack, TrackKind, StreamState } from './proto/track_pb.cjs';
|
|
4
|
+
import { VideoSource } from './video_source.cjs';
|
|
5
|
+
import './audio_frame.cjs';
|
|
6
|
+
import './proto/audio_frame_pb.cjs';
|
|
7
|
+
import '@bufbuild/protobuf';
|
|
8
|
+
import './proto/handle_pb.cjs';
|
|
9
|
+
import './proto/stats_pb.cjs';
|
|
10
|
+
import './proto/e2ee_pb.cjs';
|
|
11
|
+
import './proto/video_frame_pb.cjs';
|
|
12
|
+
import './video_frame.cjs';
|
|
13
|
+
|
|
14
|
+
declare abstract class Track {
|
|
15
|
+
/** @internal */
|
|
16
|
+
info?: TrackInfo;
|
|
17
|
+
/** @internal */
|
|
18
|
+
ffi_handle: FfiHandle;
|
|
19
|
+
constructor(owned: OwnedTrack);
|
|
20
|
+
get sid(): string | undefined;
|
|
21
|
+
get name(): string | undefined;
|
|
22
|
+
get kind(): TrackKind | undefined;
|
|
23
|
+
get stream_state(): StreamState | undefined;
|
|
24
|
+
get muted(): boolean | undefined;
|
|
25
|
+
}
|
|
26
|
+
declare class LocalAudioTrack extends Track {
|
|
27
|
+
constructor(owned: OwnedTrack);
|
|
28
|
+
static createAudioTrack(name: string, source: AudioSource): LocalAudioTrack;
|
|
29
|
+
}
|
|
30
|
+
declare class LocalVideoTrack extends Track {
|
|
31
|
+
constructor(owned: OwnedTrack);
|
|
32
|
+
static createVideoTrack(name: string, source: VideoSource): LocalVideoTrack;
|
|
33
|
+
}
|
|
34
|
+
declare class RemoteVideoTrack extends Track {
|
|
35
|
+
constructor(owned: OwnedTrack);
|
|
36
|
+
}
|
|
37
|
+
declare class RemoteAudioTrack extends Track {
|
|
38
|
+
constructor(owned: OwnedTrack);
|
|
39
|
+
}
|
|
40
|
+
type LocalTrack = LocalVideoTrack | LocalAudioTrack;
|
|
41
|
+
type RemoteTrack = RemoteVideoTrack | RemoteAudioTrack;
|
|
42
|
+
type AudioTrack = LocalAudioTrack | RemoteAudioTrack;
|
|
43
|
+
type VideoTrack = LocalVideoTrack | RemoteVideoTrack;
|
|
44
|
+
|
|
45
|
+
export { type AudioTrack, LocalAudioTrack, type LocalTrack, LocalVideoTrack, RemoteAudioTrack, type RemoteTrack, RemoteVideoTrack, Track, type VideoTrack };
|
package/dist/track.d.ts
CHANGED
|
@@ -1,35 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FfiHandle } from './
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { AudioSource } from './audio_source.js';
|
|
2
|
+
import { FfiHandle } from './napi/native.d.js';
|
|
3
|
+
import { TrackInfo, OwnedTrack, TrackKind, StreamState } from './proto/track_pb.js';
|
|
4
|
+
import { VideoSource } from './video_source.js';
|
|
5
|
+
import './audio_frame.js';
|
|
6
|
+
import './proto/audio_frame_pb.js';
|
|
7
|
+
import '@bufbuild/protobuf';
|
|
8
|
+
import './proto/handle_pb.js';
|
|
9
|
+
import './proto/stats_pb.js';
|
|
10
|
+
import './proto/e2ee_pb.js';
|
|
11
|
+
import './proto/video_frame_pb.js';
|
|
12
|
+
import './video_frame.js';
|
|
13
|
+
|
|
14
|
+
declare abstract class Track {
|
|
6
15
|
/** @internal */
|
|
7
|
-
info
|
|
16
|
+
info?: TrackInfo;
|
|
8
17
|
/** @internal */
|
|
9
18
|
ffi_handle: FfiHandle;
|
|
10
19
|
constructor(owned: OwnedTrack);
|
|
11
|
-
get sid(): string;
|
|
12
|
-
get name(): string;
|
|
13
|
-
get kind(): TrackKind;
|
|
14
|
-
get stream_state(): StreamState;
|
|
15
|
-
get muted(): boolean;
|
|
20
|
+
get sid(): string | undefined;
|
|
21
|
+
get name(): string | undefined;
|
|
22
|
+
get kind(): TrackKind | undefined;
|
|
23
|
+
get stream_state(): StreamState | undefined;
|
|
24
|
+
get muted(): boolean | undefined;
|
|
16
25
|
}
|
|
17
|
-
|
|
26
|
+
declare class LocalAudioTrack extends Track {
|
|
18
27
|
constructor(owned: OwnedTrack);
|
|
19
28
|
static createAudioTrack(name: string, source: AudioSource): LocalAudioTrack;
|
|
20
29
|
}
|
|
21
|
-
|
|
30
|
+
declare class LocalVideoTrack extends Track {
|
|
22
31
|
constructor(owned: OwnedTrack);
|
|
23
32
|
static createVideoTrack(name: string, source: VideoSource): LocalVideoTrack;
|
|
24
33
|
}
|
|
25
|
-
|
|
34
|
+
declare class RemoteVideoTrack extends Track {
|
|
26
35
|
constructor(owned: OwnedTrack);
|
|
27
36
|
}
|
|
28
|
-
|
|
37
|
+
declare class RemoteAudioTrack extends Track {
|
|
29
38
|
constructor(owned: OwnedTrack);
|
|
30
39
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
type LocalTrack = LocalVideoTrack | LocalAudioTrack;
|
|
41
|
+
type RemoteTrack = RemoteVideoTrack | RemoteAudioTrack;
|
|
42
|
+
type AudioTrack = LocalAudioTrack | RemoteAudioTrack;
|
|
43
|
+
type VideoTrack = LocalVideoTrack | RemoteVideoTrack;
|
|
44
|
+
|
|
45
|
+
export { type AudioTrack, LocalAudioTrack, type LocalTrack, LocalVideoTrack, RemoteAudioTrack, type RemoteTrack, RemoteVideoTrack, Track, type VideoTrack };
|
package/dist/track.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../src/track.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../src/track.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAGV,UAAU,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,8BAAsB,KAAK;IACzB,gBAAgB;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,gBAAgB;IAChB,UAAU,EAAE,SAAS,CAAC;gBAEV,KAAK,EAAE,UAAU;IAK7B,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;IAED,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,IAAI,SAAS,GAAG,SAAS,CAEhC;IAED,IAAI,YAAY,IAAI,WAAW,GAAG,SAAS,CAE1C;IAED,IAAI,KAAK,IAAI,OAAO,GAAG,SAAS,CAE/B;CACF;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,KAAK,EAAE,UAAU;IAI7B,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,eAAe;CAY5E;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,KAAK,EAAE,UAAU;IAI7B,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,eAAe;CAY5E;AAED,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,KAAK,EAAE,UAAU;CAG9B;AAED,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,KAAK,EAAE,UAAU;CAG9B;AAED,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,eAAe,CAAC;AAC3D,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,gBAAgB,CAAC"}
|
package/dist/track.js
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { create } from "@bufbuild/protobuf";
|
|
2
1
|
import { FfiClient, FfiHandle } from "./ffi_client.js";
|
|
3
|
-
import {
|
|
2
|
+
import { CreateAudioTrackRequest, CreateVideoTrackRequest } from "./proto/track_pb.js";
|
|
4
3
|
class Track {
|
|
5
4
|
constructor(owned) {
|
|
6
5
|
this.info = owned.info;
|
|
7
6
|
this.ffi_handle = new FfiHandle(owned.handle.id);
|
|
8
7
|
}
|
|
9
8
|
get sid() {
|
|
10
|
-
|
|
9
|
+
var _a;
|
|
10
|
+
return (_a = this.info) == null ? void 0 : _a.sid;
|
|
11
11
|
}
|
|
12
12
|
get name() {
|
|
13
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = this.info) == null ? void 0 : _a.name;
|
|
14
15
|
}
|
|
15
16
|
get kind() {
|
|
16
|
-
|
|
17
|
+
var _a;
|
|
18
|
+
return (_a = this.info) == null ? void 0 : _a.kind;
|
|
17
19
|
}
|
|
18
20
|
get stream_state() {
|
|
19
|
-
|
|
21
|
+
var _a;
|
|
22
|
+
return (_a = this.info) == null ? void 0 : _a.streamState;
|
|
20
23
|
}
|
|
21
24
|
get muted() {
|
|
22
|
-
|
|
25
|
+
var _a;
|
|
26
|
+
return (_a = this.info) == null ? void 0 : _a.muted;
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
class LocalAudioTrack extends Track {
|
|
@@ -27,7 +31,7 @@ class LocalAudioTrack extends Track {
|
|
|
27
31
|
super(owned);
|
|
28
32
|
}
|
|
29
33
|
static createAudioTrack(name, source) {
|
|
30
|
-
const req =
|
|
34
|
+
const req = new CreateAudioTrackRequest({
|
|
31
35
|
name,
|
|
32
36
|
sourceHandle: source.ffiHandle.handle
|
|
33
37
|
});
|
|
@@ -42,7 +46,7 @@ class LocalVideoTrack extends Track {
|
|
|
42
46
|
super(owned);
|
|
43
47
|
}
|
|
44
48
|
static createVideoTrack(name, source) {
|
|
45
|
-
const req =
|
|
49
|
+
const req = new CreateVideoTrackRequest({
|
|
46
50
|
name,
|
|
47
51
|
sourceHandle: source.ffiHandle.handle
|
|
48
52
|
});
|
package/dist/track.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/track.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport
|
|
1
|
+
{"version":3,"sources":["../src/track.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\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 { CreateAudioTrackRequest, CreateVideoTrackRequest } 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 | undefined {\n return this.info?.sid;\n }\n\n get name(): string | undefined {\n return this.info?.name;\n }\n\n get kind(): TrackKind | undefined {\n return this.info?.kind;\n }\n\n get stream_state(): StreamState | undefined {\n return this.info?.streamState;\n }\n\n get muted(): boolean | undefined {\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 = new CreateAudioTrackRequest({\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 = new CreateVideoTrackRequest({\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":"AAIA,SAAS,WAAW,iBAAiB;AASrC,SAAS,yBAAyB,+BAA+B;AAG1D,MAAe,MAAM;AAAA,EAO1B,YAAY,OAAmB;AAC7B,SAAK,OAAO,MAAM;AAClB,SAAK,aAAa,IAAI,UAAU,MAAM,OAAQ,EAAG;AAAA,EACnD;AAAA,EAEA,IAAI,MAA0B;AA5BhC;AA6BI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,OAA2B;AAhCjC;AAiCI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,OAA8B;AApCpC;AAqCI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,eAAwC;AAxC9C;AAyCI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,QAA6B;AA5CnC;AA6CI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AACF;AAEO,MAAM,wBAAwB,MAAM;AAAA,EACzC,YAAY,OAAmB;AAC7B,UAAM,KAAK;AAAA,EACb;AAAA,EAEA,OAAO,iBAAiB,MAAc,QAAsC;AAC1E,UAAM,MAAM,IAAI,wBAAwB;AAAA,MACtC;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,IAAI,wBAAwB;AAAA,MACtC;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":[]}
|
|
@@ -23,7 +23,6 @@ __export(track_publication_exports, {
|
|
|
23
23
|
TrackPublication: () => TrackPublication
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(track_publication_exports);
|
|
26
|
-
var import_protobuf = require("@bufbuild/protobuf");
|
|
27
26
|
var import_ffi_client = require("./ffi_client.cjs");
|
|
28
27
|
var import_native = require("./napi/native.cjs");
|
|
29
28
|
var import_room_pb = require("./proto/room_pb.cjs");
|
|
@@ -33,34 +32,44 @@ class TrackPublication {
|
|
|
33
32
|
this.ffiHandle = new import_native.FfiHandle(ownedInfo.handle.id);
|
|
34
33
|
}
|
|
35
34
|
get sid() {
|
|
36
|
-
|
|
35
|
+
var _a;
|
|
36
|
+
return (_a = this.info) == null ? void 0 : _a.sid;
|
|
37
37
|
}
|
|
38
38
|
get name() {
|
|
39
|
-
|
|
39
|
+
var _a;
|
|
40
|
+
return (_a = this.info) == null ? void 0 : _a.name;
|
|
40
41
|
}
|
|
41
42
|
get kind() {
|
|
42
|
-
|
|
43
|
+
var _a;
|
|
44
|
+
return (_a = this.info) == null ? void 0 : _a.kind;
|
|
43
45
|
}
|
|
44
46
|
get source() {
|
|
45
|
-
|
|
47
|
+
var _a;
|
|
48
|
+
return (_a = this.info) == null ? void 0 : _a.source;
|
|
46
49
|
}
|
|
47
50
|
get simulcasted() {
|
|
48
|
-
|
|
51
|
+
var _a;
|
|
52
|
+
return (_a = this.info) == null ? void 0 : _a.simulcasted;
|
|
49
53
|
}
|
|
50
54
|
get width() {
|
|
51
|
-
|
|
55
|
+
var _a;
|
|
56
|
+
return (_a = this.info) == null ? void 0 : _a.width;
|
|
52
57
|
}
|
|
53
58
|
get height() {
|
|
54
|
-
|
|
59
|
+
var _a;
|
|
60
|
+
return (_a = this.info) == null ? void 0 : _a.height;
|
|
55
61
|
}
|
|
56
62
|
get mimeType() {
|
|
57
|
-
|
|
63
|
+
var _a;
|
|
64
|
+
return (_a = this.info) == null ? void 0 : _a.mimeType;
|
|
58
65
|
}
|
|
59
66
|
get muted() {
|
|
60
|
-
|
|
67
|
+
var _a;
|
|
68
|
+
return (_a = this.info) == null ? void 0 : _a.muted;
|
|
61
69
|
}
|
|
62
70
|
get encryptionType() {
|
|
63
|
-
|
|
71
|
+
var _a;
|
|
72
|
+
return (_a = this.info) == null ? void 0 : _a.encryptionType;
|
|
64
73
|
}
|
|
65
74
|
}
|
|
66
75
|
class LocalTrackPublication extends TrackPublication {
|
|
@@ -88,7 +97,7 @@ class RemoteTrackPublication extends TrackPublication {
|
|
|
88
97
|
this.subscribed = false;
|
|
89
98
|
}
|
|
90
99
|
setSubscribed(subscribed) {
|
|
91
|
-
const req =
|
|
100
|
+
const req = new import_room_pb.SetSubscribedRequest({
|
|
92
101
|
subscribe: subscribed,
|
|
93
102
|
publicationHandle: this.ffiHandle.handle
|
|
94
103
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/track_publication.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/track_publication.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\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 { SetSubscribedRequest } 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 | undefined {\n return this.info?.sid;\n }\n\n get name(): string | undefined {\n return this.info?.name;\n }\n\n get kind(): TrackKind | undefined {\n return this.info?.kind;\n }\n\n get source(): TrackSource | undefined {\n return this.info?.source;\n }\n\n get simulcasted(): boolean | undefined {\n return this.info?.simulcasted;\n }\n\n get width(): number | undefined {\n return this.info?.width;\n }\n\n get height(): number | undefined {\n return this.info?.height;\n }\n\n get mimeType(): string | undefined {\n return this.info?.mimeType;\n }\n\n get muted(): boolean | undefined {\n return this.info?.muted;\n }\n\n get encryptionType(): EncryptionType | undefined {\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 = new SetSubscribedRequest({\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,wBAA0B;AAC1B,oBAA0B;AAG1B,qBAAqC;AAS9B,MAAe,iBAAiB;AAAA,EAQrC,YAAY,WAAkC;AAC5C,SAAK,OAAO,UAAU;AACtB,SAAK,YAAY,IAAI,wBAAU,UAAU,OAAQ,EAAG;AAAA,EACtD;AAAA,EAEA,IAAI,MAA0B;AA7BhC;AA8BI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,OAA2B;AAjCjC;AAkCI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,OAA8B;AArCpC;AAsCI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,SAAkC;AAzCxC;AA0CI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,cAAmC;AA7CzC;AA8CI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,QAA4B;AAjDlC;AAkDI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,SAA6B;AArDnC;AAsDI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,WAA+B;AAzDrC;AA0DI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,QAA6B;AA7DnC;AA8DI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AAAA,EAEA,IAAI,iBAA6C;AAjEnD;AAkEI,YAAO,UAAK,SAAL,mBAAW;AAAA,EACpB;AACF;AAEO,MAAM,8BAA8B,iBAAiB;AAAA,EAI1D,YAAY,WAAkC;AAC5C,UAAM,SAAS;AAHjB,SAAQ,4BAAiD;AAIvD,SAAK,oBAAoB,IAAI,QAAc,CAAC,YAAY;AACtD,WAAK,4BAA4B;AAAA,IACnC,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,sBAAqC;AACzC,UAAM,KAAK;AAAA,EACb;AAAA;AAAA,EAGA,2BAAiC;AAC/B,QAAI,KAAK,2BAA2B;AAClC,WAAK,0BAA0B;AAC/B,WAAK,4BAA4B;AAAA,IACnC;AAAA,EACF;AACF;AAEO,MAAM,+BAA+B,iBAAiB;AAAA,EAG3D,YAAY,WAAkC;AAC5C,UAAM,SAAS;AAHjB,sBAAsB;AAAA,EAItB;AAAA,EAEA,cAAc,YAAqB;AACjC,UAAM,MAAM,IAAI,oCAAqB;AAAA,MACnC,WAAW;AAAA,MACX,mBAAmB,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":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { FfiHandle } from './napi/native.d.cjs';
|
|
2
|
+
import { EncryptionType } from './proto/e2ee_pb.cjs';
|
|
3
|
+
import { TrackPublicationInfo, OwnedTrackPublication, TrackKind, TrackSource } from './proto/track_pb.cjs';
|
|
4
|
+
import { Track } from './track.cjs';
|
|
5
|
+
import '@bufbuild/protobuf';
|
|
6
|
+
import './proto/stats_pb.cjs';
|
|
7
|
+
import './proto/handle_pb.cjs';
|
|
8
|
+
import './audio_source.cjs';
|
|
9
|
+
import './audio_frame.cjs';
|
|
10
|
+
import './proto/audio_frame_pb.cjs';
|
|
11
|
+
import './video_source.cjs';
|
|
12
|
+
import './proto/video_frame_pb.cjs';
|
|
13
|
+
import './video_frame.cjs';
|
|
14
|
+
|
|
15
|
+
declare abstract class TrackPublication {
|
|
16
|
+
/** @internal */
|
|
17
|
+
ffiHandle: FfiHandle;
|
|
18
|
+
/** @internal */
|
|
19
|
+
info?: TrackPublicationInfo;
|
|
20
|
+
track?: Track;
|
|
21
|
+
constructor(ownedInfo: OwnedTrackPublication);
|
|
22
|
+
get sid(): string | undefined;
|
|
23
|
+
get name(): string | undefined;
|
|
24
|
+
get kind(): TrackKind | undefined;
|
|
25
|
+
get source(): TrackSource | undefined;
|
|
26
|
+
get simulcasted(): boolean | undefined;
|
|
27
|
+
get width(): number | undefined;
|
|
28
|
+
get height(): number | undefined;
|
|
29
|
+
get mimeType(): string | undefined;
|
|
30
|
+
get muted(): boolean | undefined;
|
|
31
|
+
get encryptionType(): EncryptionType | undefined;
|
|
32
|
+
}
|
|
33
|
+
declare class LocalTrackPublication extends TrackPublication {
|
|
34
|
+
private firstSubscription;
|
|
35
|
+
private firstSubscriptionResolver;
|
|
36
|
+
constructor(ownedInfo: OwnedTrackPublication);
|
|
37
|
+
waitForSubscription(): Promise<void>;
|
|
38
|
+
/** @internal */
|
|
39
|
+
resolveFirstSubscription(): void;
|
|
40
|
+
}
|
|
41
|
+
declare class RemoteTrackPublication extends TrackPublication {
|
|
42
|
+
subscribed: boolean;
|
|
43
|
+
constructor(ownedInfo: OwnedTrackPublication);
|
|
44
|
+
setSubscribed(subscribed: boolean): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { LocalTrackPublication, RemoteTrackPublication, TrackPublication };
|
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
import { FfiHandle } from './napi/native.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { FfiHandle } from './napi/native.d.js';
|
|
2
|
+
import { EncryptionType } from './proto/e2ee_pb.js';
|
|
3
|
+
import { TrackPublicationInfo, OwnedTrackPublication, TrackKind, TrackSource } from './proto/track_pb.js';
|
|
4
|
+
import { Track } from './track.js';
|
|
5
|
+
import '@bufbuild/protobuf';
|
|
6
|
+
import './proto/stats_pb.js';
|
|
7
|
+
import './proto/handle_pb.js';
|
|
8
|
+
import './audio_source.js';
|
|
9
|
+
import './audio_frame.js';
|
|
10
|
+
import './proto/audio_frame_pb.js';
|
|
11
|
+
import './video_source.js';
|
|
12
|
+
import './proto/video_frame_pb.js';
|
|
13
|
+
import './video_frame.js';
|
|
14
|
+
|
|
15
|
+
declare abstract class TrackPublication {
|
|
6
16
|
/** @internal */
|
|
7
17
|
ffiHandle: FfiHandle;
|
|
8
18
|
/** @internal */
|
|
9
|
-
info
|
|
19
|
+
info?: TrackPublicationInfo;
|
|
10
20
|
track?: Track;
|
|
11
21
|
constructor(ownedInfo: OwnedTrackPublication);
|
|
12
|
-
get sid(): string;
|
|
13
|
-
get name(): string;
|
|
14
|
-
get kind(): TrackKind;
|
|
15
|
-
get source(): TrackSource;
|
|
16
|
-
get simulcasted(): boolean;
|
|
17
|
-
get width(): number;
|
|
18
|
-
get height(): number;
|
|
19
|
-
get mimeType(): string;
|
|
20
|
-
get muted(): boolean;
|
|
21
|
-
get encryptionType(): EncryptionType;
|
|
22
|
+
get sid(): string | undefined;
|
|
23
|
+
get name(): string | undefined;
|
|
24
|
+
get kind(): TrackKind | undefined;
|
|
25
|
+
get source(): TrackSource | undefined;
|
|
26
|
+
get simulcasted(): boolean | undefined;
|
|
27
|
+
get width(): number | undefined;
|
|
28
|
+
get height(): number | undefined;
|
|
29
|
+
get mimeType(): string | undefined;
|
|
30
|
+
get muted(): boolean | undefined;
|
|
31
|
+
get encryptionType(): EncryptionType | undefined;
|
|
22
32
|
}
|
|
23
|
-
|
|
33
|
+
declare class LocalTrackPublication extends TrackPublication {
|
|
24
34
|
private firstSubscription;
|
|
25
35
|
private firstSubscriptionResolver;
|
|
26
36
|
constructor(ownedInfo: OwnedTrackPublication);
|
|
@@ -28,9 +38,10 @@ export declare class LocalTrackPublication extends TrackPublication {
|
|
|
28
38
|
/** @internal */
|
|
29
39
|
resolveFirstSubscription(): void;
|
|
30
40
|
}
|
|
31
|
-
|
|
41
|
+
declare class RemoteTrackPublication extends TrackPublication {
|
|
32
42
|
subscribed: boolean;
|
|
33
43
|
constructor(ownedInfo: OwnedTrackPublication);
|
|
34
44
|
setSubscribed(subscribed: boolean): void;
|
|
35
45
|
}
|
|
36
|
-
|
|
46
|
+
|
|
47
|
+
export { LocalTrackPublication, RemoteTrackPublication, TrackPublication };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track_publication.d.ts","sourceRoot":"","sources":["../src/track_publication.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"track_publication.d.ts","sourceRoot":"","sources":["../src/track_publication.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,oBAAoB,EACpB,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,8BAAsB,gBAAgB;IACpC,gBAAgB;IAChB,SAAS,EAAE,SAAS,CAAC;IAErB,gBAAgB;IAChB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEF,SAAS,EAAE,qBAAqB;IAK5C,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;IAED,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,IAAI,IAAI,SAAS,GAAG,SAAS,CAEhC;IAED,IAAI,MAAM,IAAI,WAAW,GAAG,SAAS,CAEpC;IAED,IAAI,WAAW,IAAI,OAAO,GAAG,SAAS,CAErC;IAED,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAE9B;IAED,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAE/B;IAED,IAAI,QAAQ,IAAI,MAAM,GAAG,SAAS,CAEjC;IAED,IAAI,KAAK,IAAI,OAAO,GAAG,SAAS,CAE/B;IAED,IAAI,cAAc,IAAI,cAAc,GAAG,SAAS,CAE/C;CACF;AAED,qBAAa,qBAAsB,SAAQ,gBAAgB;IACzD,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,yBAAyB,CAA6B;gBAElD,SAAS,EAAE,qBAAqB;IAOtC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C,gBAAgB;IAChB,wBAAwB,IAAI,IAAI;CAMjC;AAED,qBAAa,sBAAuB,SAAQ,gBAAgB;IAC1D,UAAU,EAAE,OAAO,CAAS;gBAEhB,SAAS,EAAE,qBAAqB;IAI5C,aAAa,CAAC,UAAU,EAAE,OAAO;CAUlC"}
|