livekit-client 1.9.2 → 1.9.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/livekit-client.esm.mjs +3251 -3013
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +98 -98
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/connectionHelper/ConnectionCheck.d.ts +25 -24
- package/dist/src/connectionHelper/ConnectionCheck.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/Checker.d.ts +58 -58
- package/dist/src/connectionHelper/checks/publishAudio.d.ts +5 -5
- package/dist/src/connectionHelper/checks/publishVideo.d.ts +5 -5
- package/dist/src/connectionHelper/checks/reconnect.d.ts +5 -5
- package/dist/src/connectionHelper/checks/turn.d.ts +5 -5
- package/dist/src/connectionHelper/checks/webrtc.d.ts +5 -5
- package/dist/src/connectionHelper/checks/websocket.d.ts +5 -5
- package/dist/src/index.d.ts +34 -31
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/logger.d.ts +25 -25
- package/dist/src/options.d.ts +98 -98
- package/dist/src/proto/google/protobuf/timestamp.d.ts +145 -145
- package/dist/src/proto/livekit_models.d.ts +2300 -2300
- package/dist/src/proto/livekit_rtc.d.ts +14032 -14032
- package/dist/src/room/DefaultReconnectPolicy.d.ts +7 -7
- package/dist/src/room/DeviceManager.d.ts +8 -8
- package/dist/src/room/PCTransport.d.ts +37 -37
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +126 -121
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/ReconnectPolicy.d.ts +23 -23
- package/dist/src/room/RegionUrlProvider.d.ts +13 -13
- package/dist/src/room/Room.d.ts +232 -232
- package/dist/src/room/defaults.d.ts +7 -7
- package/dist/src/room/defaults.d.ts.map +1 -1
- package/dist/src/room/errors.d.ts +42 -42
- package/dist/src/room/events.d.ts +455 -455
- package/dist/src/room/participant/LocalParticipant.d.ts +170 -170
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +93 -93
- package/dist/src/room/participant/ParticipantTrackPermission.d.ts +25 -25
- package/dist/src/room/participant/RemoteParticipant.d.ts +52 -51
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/publishUtils.d.ts +19 -18
- package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
- package/dist/src/room/stats.d.ts +66 -66
- package/dist/src/room/timers.d.ts +12 -12
- package/dist/src/room/track/LocalAudioTrack.d.ts +24 -24
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +43 -43
- package/dist/src/room/track/LocalTrackPublication.d.ts +37 -37
- package/dist/src/room/track/LocalVideoTrack.d.ts +53 -53
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteAudioTrack.d.ts +52 -52
- package/dist/src/room/track/RemoteAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteTrack.d.ts +14 -14
- package/dist/src/room/track/RemoteTrackPublication.d.ts +60 -60
- package/dist/src/room/track/RemoteVideoTrack.d.ts +52 -52
- package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/Track.d.ts +124 -124
- package/dist/src/room/track/TrackPublication.d.ts +67 -67
- package/dist/src/room/track/create.d.ts +23 -23
- package/dist/src/room/track/create.d.ts.map +1 -1
- package/dist/src/room/track/options.d.ts +255 -247
- package/dist/src/room/track/options.d.ts.map +1 -1
- package/dist/src/room/track/types.d.ts +22 -22
- package/dist/src/room/track/utils.d.ts +13 -13
- package/dist/src/room/types.d.ts +25 -25
- package/dist/src/room/utils.d.ts +86 -85
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/test/MockMediaStreamTrack.d.ts +25 -25
- package/dist/src/test/mocks.d.ts +10 -10
- package/dist/src/version.d.ts +2 -2
- package/dist/ts4.2/src/connectionHelper/ConnectionCheck.d.ts +2 -1
- package/dist/ts4.2/src/index.d.ts +8 -6
- package/dist/ts4.2/src/room/PCTransport.d.ts +1 -1
- package/dist/ts4.2/src/room/RTCEngine.d.ts +6 -1
- package/dist/ts4.2/src/room/defaults.d.ts +1 -1
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +4 -4
- package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +2 -1
- package/dist/ts4.2/src/room/participant/publishUtils.d.ts +2 -1
- package/dist/ts4.2/src/room/track/LocalAudioTrack.d.ts +1 -1
- package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +1 -1
- package/dist/ts4.2/src/room/track/RemoteAudioTrack.d.ts +1 -1
- package/dist/ts4.2/src/room/track/create.d.ts +1 -1
- package/dist/ts4.2/src/room/track/options.d.ts +10 -2
- package/dist/ts4.2/src/room/utils.d.ts +1 -0
- package/package.json +12 -12
- package/src/api/SignalClient.ts +10 -11
- package/src/connectionHelper/ConnectionCheck.ts +2 -1
- package/src/index.ts +13 -8
- package/src/room/PCTransport.ts +9 -5
- package/src/room/RTCEngine.ts +10 -3
- package/src/room/defaults.ts +6 -4
- package/src/room/participant/LocalParticipant.ts +10 -9
- package/src/room/participant/RemoteParticipant.ts +2 -1
- package/src/room/participant/publishUtils.ts +7 -5
- package/src/room/track/LocalAudioTrack.ts +2 -1
- package/src/room/track/LocalVideoTrack.ts +3 -2
- package/src/room/track/RemoteAudioTrack.ts +2 -1
- package/src/room/track/RemoteVideoTrack.ts +4 -8
- package/src/room/track/create.ts +2 -2
- package/src/room/track/options.ts +23 -7
- package/src/room/utils.ts +15 -2
package/dist/src/room/types.d.ts
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
import type RemoteParticipant from './participant/RemoteParticipant';
|
2
|
-
export type SimulationOptions = {
|
3
|
-
publish?: {
|
4
|
-
audio?: boolean;
|
5
|
-
video?: boolean;
|
6
|
-
useRealTracks?: boolean;
|
7
|
-
};
|
8
|
-
participants?: {
|
9
|
-
count?: number;
|
10
|
-
aspectRatios?: Array<number>;
|
11
|
-
audio?: boolean;
|
12
|
-
video?: boolean;
|
13
|
-
};
|
14
|
-
};
|
15
|
-
export type DataPublishOptions = {
|
16
|
-
/** the participants who will receive the message, will be sent to every one if empty */
|
17
|
-
destination?: RemoteParticipant[] | string[];
|
18
|
-
/** the topic under which the message gets published */
|
19
|
-
topic?: string;
|
20
|
-
};
|
21
|
-
export type LiveKitReactNativeInfo = {
|
22
|
-
platform: 'ios' | 'android' | 'windows' | 'macos' | 'web' | 'native';
|
23
|
-
devicePixelRatio: number;
|
24
|
-
};
|
25
|
-
export type SimulationScenario = 'signal-reconnect' | 'speaker' | 'node-failure' | 'server-leave' | 'migration' | 'resume-reconnect' | 'force-tcp' | 'force-tls' | 'full-reconnect';
|
1
|
+
import type RemoteParticipant from './participant/RemoteParticipant';
|
2
|
+
export type SimulationOptions = {
|
3
|
+
publish?: {
|
4
|
+
audio?: boolean;
|
5
|
+
video?: boolean;
|
6
|
+
useRealTracks?: boolean;
|
7
|
+
};
|
8
|
+
participants?: {
|
9
|
+
count?: number;
|
10
|
+
aspectRatios?: Array<number>;
|
11
|
+
audio?: boolean;
|
12
|
+
video?: boolean;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
export type DataPublishOptions = {
|
16
|
+
/** the participants who will receive the message, will be sent to every one if empty */
|
17
|
+
destination?: RemoteParticipant[] | string[];
|
18
|
+
/** the topic under which the message gets published */
|
19
|
+
topic?: string;
|
20
|
+
};
|
21
|
+
export type LiveKitReactNativeInfo = {
|
22
|
+
platform: 'ios' | 'android' | 'windows' | 'macos' | 'web' | 'native';
|
23
|
+
devicePixelRatio: number;
|
24
|
+
};
|
25
|
+
export type SimulationScenario = 'signal-reconnect' | 'speaker' | 'node-failure' | 'server-leave' | 'migration' | 'resume-reconnect' | 'force-tcp' | 'force-tls' | 'full-reconnect';
|
26
26
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/room/utils.d.ts
CHANGED
@@ -1,86 +1,87 @@
|
|
1
|
-
import { ClientInfo } from '../proto/livekit_models';
|
2
|
-
import type LocalAudioTrack from './track/LocalAudioTrack';
|
3
|
-
import type RemoteAudioTrack from './track/RemoteAudioTrack';
|
4
|
-
export declare const ddExtensionURI = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";
|
5
|
-
export declare function unpackStreamId(packed: string): string[];
|
6
|
-
export declare function sleep(duration: number): Promise<void>;
|
7
|
-
/** @internal */
|
8
|
-
export declare function supportsTransceiver(): boolean;
|
9
|
-
/** @internal */
|
10
|
-
export declare function supportsAddTrack(): boolean;
|
11
|
-
export declare function supportsAdaptiveStream(): boolean;
|
12
|
-
export declare function supportsDynacast(): boolean;
|
13
|
-
export declare function supportsAV1(): boolean;
|
14
|
-
export declare function supportsVP9(): boolean;
|
15
|
-
export declare function isSVCCodec(codec?: string): boolean;
|
16
|
-
export declare function supportsSetSinkId(elm?: HTMLMediaElement): boolean;
|
17
|
-
export declare function supportsSetCodecPreferences(transceiver: RTCRtpTransceiver): boolean;
|
18
|
-
export declare function isBrowserSupported(): boolean;
|
19
|
-
export declare function isFireFox(): boolean;
|
20
|
-
export declare function
|
21
|
-
export declare function
|
22
|
-
export declare function
|
23
|
-
export declare function
|
24
|
-
export declare function
|
25
|
-
export declare function
|
26
|
-
export declare function
|
27
|
-
export declare function
|
28
|
-
export declare
|
29
|
-
export declare const
|
30
|
-
export
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
export declare function
|
36
|
-
export declare function
|
37
|
-
export declare function
|
38
|
-
export declare
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
*
|
49
|
-
*
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
*
|
72
|
-
*
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
private
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
1
|
+
import { ClientInfo } from '../proto/livekit_models';
|
2
|
+
import type LocalAudioTrack from './track/LocalAudioTrack';
|
3
|
+
import type RemoteAudioTrack from './track/RemoteAudioTrack';
|
4
|
+
export declare const ddExtensionURI = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";
|
5
|
+
export declare function unpackStreamId(packed: string): string[];
|
6
|
+
export declare function sleep(duration: number): Promise<void>;
|
7
|
+
/** @internal */
|
8
|
+
export declare function supportsTransceiver(): boolean;
|
9
|
+
/** @internal */
|
10
|
+
export declare function supportsAddTrack(): boolean;
|
11
|
+
export declare function supportsAdaptiveStream(): boolean;
|
12
|
+
export declare function supportsDynacast(): boolean;
|
13
|
+
export declare function supportsAV1(): boolean;
|
14
|
+
export declare function supportsVP9(): boolean;
|
15
|
+
export declare function isSVCCodec(codec?: string): boolean;
|
16
|
+
export declare function supportsSetSinkId(elm?: HTMLMediaElement): boolean;
|
17
|
+
export declare function supportsSetCodecPreferences(transceiver: RTCRtpTransceiver): boolean;
|
18
|
+
export declare function isBrowserSupported(): boolean;
|
19
|
+
export declare function isFireFox(): boolean;
|
20
|
+
export declare function isChromiumBased(): boolean;
|
21
|
+
export declare function isSafari(): boolean;
|
22
|
+
export declare function isMobile(): boolean;
|
23
|
+
export declare function isWeb(): boolean;
|
24
|
+
export declare function isReactNative(): boolean;
|
25
|
+
export declare function isCloud(serverUrl: URL): boolean;
|
26
|
+
export declare function getReactNativeOs(): string | undefined;
|
27
|
+
export declare function getDevicePixelRatio(): number;
|
28
|
+
export declare function compareVersions(v1: string, v2: string): number;
|
29
|
+
export declare const getResizeObserver: () => ResizeObserver;
|
30
|
+
export declare const getIntersectionObserver: () => IntersectionObserver;
|
31
|
+
export interface ObservableMediaElement extends HTMLMediaElement {
|
32
|
+
handleResize: (entry: ResizeObserverEntry) => void;
|
33
|
+
handleVisibilityChanged: (entry: IntersectionObserverEntry) => void;
|
34
|
+
}
|
35
|
+
export declare function getClientInfo(): ClientInfo;
|
36
|
+
export declare function getEmptyVideoStreamTrack(): MediaStreamTrack;
|
37
|
+
export declare function createDummyVideoStreamTrack(width?: number, height?: number, enabled?: boolean, paintContent?: boolean): MediaStreamTrack;
|
38
|
+
export declare function getEmptyAudioStreamTrack(): MediaStreamTrack;
|
39
|
+
export declare class Future<T> {
|
40
|
+
promise: Promise<T>;
|
41
|
+
resolve?: (arg: T) => void;
|
42
|
+
reject?: (e: any) => void;
|
43
|
+
onFinally?: () => void;
|
44
|
+
constructor(futureBase?: (resolve: (arg: T) => void, reject: (e: any) => void) => void, onFinally?: () => void);
|
45
|
+
}
|
46
|
+
export type AudioAnalyserOptions = {
|
47
|
+
/**
|
48
|
+
* If set to true, the analyser will use a cloned version of the underlying mediastreamtrack, which won't be impacted by muting the track.
|
49
|
+
* Useful for local tracks when implementing things like "seems like you're muted, but trying to speak".
|
50
|
+
* Defaults to false
|
51
|
+
*/
|
52
|
+
cloneTrack?: boolean;
|
53
|
+
/**
|
54
|
+
* see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize
|
55
|
+
*/
|
56
|
+
fftSize?: number;
|
57
|
+
/**
|
58
|
+
* see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/smoothingTimeConstant
|
59
|
+
*/
|
60
|
+
smoothingTimeConstant?: number;
|
61
|
+
/**
|
62
|
+
* see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/minDecibels
|
63
|
+
*/
|
64
|
+
minDecibels?: number;
|
65
|
+
/**
|
66
|
+
* see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/maxDecibels
|
67
|
+
*/
|
68
|
+
maxDecibels?: number;
|
69
|
+
};
|
70
|
+
/**
|
71
|
+
* Creates and returns an analyser web audio node that is attached to the provided track.
|
72
|
+
* Additionally returns a convenience method `calculateVolume` to perform instant volume readings on that track.
|
73
|
+
* Call the returned `cleanup` function to close the audioContext that has been created for the instance of this helper
|
74
|
+
*/
|
75
|
+
export declare function createAudioAnalyser(track: LocalAudioTrack | RemoteAudioTrack, options?: AudioAnalyserOptions): {
|
76
|
+
calculateVolume: () => number;
|
77
|
+
analyser: AnalyserNode;
|
78
|
+
cleanup: () => void;
|
79
|
+
};
|
80
|
+
export declare class Mutex {
|
81
|
+
private _locking;
|
82
|
+
private _locks;
|
83
|
+
constructor();
|
84
|
+
isLocked(): boolean;
|
85
|
+
lock(): Promise<() => void>;
|
86
|
+
}
|
86
87
|
//# sourceMappingURL=utils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/room/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAkB,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,eAAe,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAK7D,eAAO,MAAM,cAAc,4FACgE,CAAC;AAE5F,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAMvD;AAED,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,YAElC;AAED,gBAAgB;AAChB,wBAAgB,gBAAgB,YAE/B;AAED,wBAAgB,sBAAsB,YAErC;AAED,wBAAgB,gBAAgB,YAE/B;AAED,wBAAgB,WAAW,IAAI,OAAO,
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/room/utils.ts"],"names":[],"mapp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CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,GAAG,gBAAgB,EACzC,OAAO,CAAC,EAAE,oBAAoB;;;;EA+C/B;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,QAAQ,CAAgB;IAEhC,OAAO,CAAC,MAAM,CAAS;;IAOvB,QAAQ;IAIR,IAAI,kBAGoB,IAAI;CAgB7B"}
|
@@ -1,26 +1,26 @@
|
|
1
|
-
export default class MockMediaStreamTrack implements MediaStreamTrack {
|
2
|
-
contentHint: string;
|
3
|
-
enabled: boolean;
|
4
|
-
id: string;
|
5
|
-
kind: string;
|
6
|
-
label: string;
|
7
|
-
muted: boolean;
|
8
|
-
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
9
|
-
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
10
|
-
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
11
|
-
readyState: MediaStreamTrackState;
|
12
|
-
isolated: boolean;
|
13
|
-
onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
14
|
-
applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
|
15
|
-
clone(): MediaStreamTrack;
|
16
|
-
getCapabilities(): MediaTrackCapabilities;
|
17
|
-
getConstraints(): MediaTrackConstraints;
|
18
|
-
getSettings(): MediaTrackSettings;
|
19
|
-
stop(): void;
|
20
|
-
addEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
21
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
22
|
-
removeEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
23
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
24
|
-
dispatchEvent(event: Event): boolean;
|
25
|
-
}
|
1
|
+
export default class MockMediaStreamTrack implements MediaStreamTrack {
|
2
|
+
contentHint: string;
|
3
|
+
enabled: boolean;
|
4
|
+
id: string;
|
5
|
+
kind: string;
|
6
|
+
label: string;
|
7
|
+
muted: boolean;
|
8
|
+
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
9
|
+
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
10
|
+
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
11
|
+
readyState: MediaStreamTrackState;
|
12
|
+
isolated: boolean;
|
13
|
+
onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
14
|
+
applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
|
15
|
+
clone(): MediaStreamTrack;
|
16
|
+
getCapabilities(): MediaTrackCapabilities;
|
17
|
+
getConstraints(): MediaTrackConstraints;
|
18
|
+
getSettings(): MediaTrackSettings;
|
19
|
+
stop(): void;
|
20
|
+
addEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
21
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
22
|
+
removeEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
23
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
24
|
+
dispatchEvent(event: Event): boolean;
|
25
|
+
}
|
26
26
|
//# sourceMappingURL=MockMediaStreamTrack.d.ts.map
|
package/dist/src/test/mocks.d.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import { SignalClient } from '../api/SignalClient';
|
2
|
-
import RTCEngine from '../room/RTCEngine';
|
3
|
-
declare const mocks: {
|
4
|
-
SignalClient: jest.MockedClass<typeof SignalClient>;
|
5
|
-
RTCEngine: jest.MockedClass<typeof RTCEngine>;
|
6
|
-
MockLocalVideoTrack: {
|
7
|
-
stop: jest.Mock<any, any, any>;
|
8
|
-
};
|
9
|
-
};
|
10
|
-
export default mocks;
|
1
|
+
import { SignalClient } from '../api/SignalClient';
|
2
|
+
import RTCEngine from '../room/RTCEngine';
|
3
|
+
declare const mocks: {
|
4
|
+
SignalClient: jest.MockedClass<typeof SignalClient>;
|
5
|
+
RTCEngine: jest.MockedClass<typeof RTCEngine>;
|
6
|
+
MockLocalVideoTrack: {
|
7
|
+
stop: jest.Mock<any, any, any>;
|
8
|
+
};
|
9
|
+
};
|
10
|
+
export default mocks;
|
11
11
|
//# sourceMappingURL=mocks.d.ts.map
|
package/dist/src/version.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export declare const version: string;
|
2
|
-
export declare const protocolVersion = 9;
|
1
|
+
export declare const version: string;
|
2
|
+
export declare const protocolVersion = 9;
|
3
3
|
//# sourceMappingURL=version.d.ts.map
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type TypedEmitter from 'typed-emitter';
|
2
|
-
import {
|
2
|
+
import { CheckStatus, Checker } from './checks/Checker';
|
3
|
+
import type { CheckInfo, InstantiableCheck } from './checks/Checker';
|
3
4
|
export type { CheckInfo, CheckStatus };
|
4
5
|
declare const ConnectionCheck_base: new () => TypedEmitter<ConnectionCheckCallbacks>;
|
5
6
|
export declare class ConnectionCheck extends ConnectionCheck_base {
|
@@ -14,20 +14,22 @@ import LocalVideoTrack from './room/track/LocalVideoTrack';
|
|
14
14
|
import RemoteAudioTrack from './room/track/RemoteAudioTrack';
|
15
15
|
import RemoteTrack from './room/track/RemoteTrack';
|
16
16
|
import RemoteTrackPublication from './room/track/RemoteTrackPublication';
|
17
|
-
import type
|
17
|
+
import type { ElementInfo } from './room/track/RemoteVideoTrack';
|
18
|
+
import RemoteVideoTrack from './room/track/RemoteVideoTrack';
|
18
19
|
import { TrackPublication } from './room/track/TrackPublication';
|
19
20
|
import type { LiveKitReactNativeInfo } from './room/types';
|
20
21
|
import type { AudioAnalyserOptions } from './room/utils';
|
21
|
-
import { createAudioAnalyser, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, isBrowserSupported, supportsAV1, supportsAdaptiveStream, supportsDynacast } from './room/utils';
|
22
|
+
import { createAudioAnalyser, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, isBrowserSupported, supportsAV1, supportsAdaptiveStream, supportsDynacast, supportsVP9 } from './room/utils';
|
23
|
+
export * from './connectionHelper/ConnectionCheck';
|
22
24
|
export * from './options';
|
23
25
|
export * from './room/errors';
|
24
26
|
export * from './room/events';
|
25
|
-
export
|
27
|
+
export * from './room/track/Track';
|
26
28
|
export * from './room/track/create';
|
27
29
|
export * from './room/track/options';
|
28
|
-
export * from './room/track/Track';
|
29
30
|
export * from './room/track/types';
|
31
|
+
export type { DataPublishOptions, SimulationScenario } from './room/types';
|
30
32
|
export * from './version';
|
31
|
-
export
|
32
|
-
export {
|
33
|
+
export { setLogLevel, setLogExtension, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, isBrowserSupported, supportsAdaptiveStream, supportsDynacast, supportsAV1, supportsVP9, createAudioAnalyser, LogLevel, Room, ConnectionState, RoomState, DataPacket_Kind, DisconnectReason, Participant, RemoteParticipant, LocalParticipant, LocalAudioTrack, LocalVideoTrack, LocalTrack, LocalTrackPublication, RemoteTrack, RemoteAudioTrack, RemoteVideoTrack, RemoteTrackPublication, TrackPublication, VideoQuality, ConnectionQuality, DefaultReconnectPolicy, CriticalTimers, };
|
34
|
+
export type { ElementInfo, ParticipantTrackPermission, AudioAnalyserOptions, LiveKitReactNativeInfo, };
|
33
35
|
//# sourceMappingURL=index.d.ts.map
|
@@ -20,7 +20,7 @@ export default class PCTransport extends EventEmitter {
|
|
20
20
|
remoteStereoMids: string[];
|
21
21
|
remoteNackMids: string[];
|
22
22
|
onOffer?: (offer: RTCSessionDescriptionInit) => void;
|
23
|
-
constructor(config?: RTCConfiguration);
|
23
|
+
constructor(config?: RTCConfiguration, mediaConstraints?: Record<string, unknown>);
|
24
24
|
get isICEConnected(): boolean;
|
25
25
|
addIceCandidate(candidate: RTCIceCandidateInit): Promise<void>;
|
26
26
|
setRemoteDescription(sd: RTCSessionDescriptionInit): Promise<void>;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type TypedEventEmitter from 'typed-emitter';
|
2
|
-
import { SignalClient
|
2
|
+
import { SignalClient } from '../api/SignalClient';
|
3
|
+
import type { SignalOptions } from '../api/SignalClient';
|
3
4
|
import type { InternalRoomOptions } from '../options';
|
4
5
|
import { DataPacket, DataPacket_Kind, DisconnectReason, SpeakerInfo, TrackInfo, UserPacket } from '../proto/livekit_models';
|
5
6
|
import { AddTrackRequest, JoinResponse } from '../proto/livekit_rtc';
|
@@ -18,6 +19,10 @@ export default class RTCEngine extends RTCEngine_base {
|
|
18
19
|
rtcConfig: RTCConfiguration;
|
19
20
|
peerConnectionTimeout: number;
|
20
21
|
fullReconnectOnNext: boolean;
|
22
|
+
/**
|
23
|
+
* @internal
|
24
|
+
*/
|
25
|
+
latestJoinResponse?: JoinResponse;
|
21
26
|
get isClosed(): boolean;
|
22
27
|
private lossyDC?;
|
23
28
|
private lossyDCSub?;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { InternalRoomConnectOptions, InternalRoomOptions } from '../options';
|
2
|
-
import { AudioCaptureOptions, TrackPublishDefaults, VideoCaptureOptions } from './track/options';
|
2
|
+
import type { AudioCaptureOptions, TrackPublishDefaults, VideoCaptureOptions } from './track/options';
|
3
3
|
export declare const publishDefaults: TrackPublishDefaults;
|
4
4
|
export declare const audioDefaults: AudioCaptureOptions;
|
5
5
|
export declare const videoDefaults: VideoCaptureOptions;
|
@@ -6,10 +6,10 @@ import type RTCEngine from '../RTCEngine';
|
|
6
6
|
import LocalTrack from '../track/LocalTrack';
|
7
7
|
import LocalTrackPublication from '../track/LocalTrackPublication';
|
8
8
|
import { Track } from '../track/Track';
|
9
|
-
import { AudioCaptureOptions, BackupVideoCodec, CreateLocalTracksOptions, ScreenShareCaptureOptions, TrackPublishOptions, VideoCaptureOptions } from '../track/options';
|
9
|
+
import type { AudioCaptureOptions, BackupVideoCodec, CreateLocalTracksOptions, ScreenShareCaptureOptions, TrackPublishOptions, VideoCaptureOptions } from '../track/options';
|
10
10
|
import type { DataPublishOptions } from '../types';
|
11
11
|
import Participant from './Participant';
|
12
|
-
import { ParticipantTrackPermission } from './ParticipantTrackPermission';
|
12
|
+
import type { ParticipantTrackPermission } from './ParticipantTrackPermission';
|
13
13
|
import RemoteParticipant from './RemoteParticipant';
|
14
14
|
export default class LocalParticipant extends Participant {
|
15
15
|
audioTracks: Map<string, LocalTrackPublication>;
|
@@ -41,13 +41,13 @@ export default class LocalParticipant extends Participant {
|
|
41
41
|
private handleDisconnected;
|
42
42
|
/**
|
43
43
|
* Sets and updates the metadata of the local participant.
|
44
|
-
* Note: this requires `
|
44
|
+
* Note: this requires `canUpdateOwnMetadata` permission encoded in the token.
|
45
45
|
* @param metadata
|
46
46
|
*/
|
47
47
|
setMetadata(metadata: string): void;
|
48
48
|
/**
|
49
49
|
* Sets and updates the name of the local participant.
|
50
|
-
* Note: this requires `
|
50
|
+
* Note: this requires `canUpdateOwnMetadata` permission encoded in the token.
|
51
51
|
* @param metadata
|
52
52
|
*/
|
53
53
|
setName(name: string): void;
|
@@ -4,7 +4,8 @@ import RemoteTrackPublication from '../track/RemoteTrackPublication';
|
|
4
4
|
import { Track } from '../track/Track';
|
5
5
|
import type { AudioOutputOptions } from '../track/options';
|
6
6
|
import type { AdaptiveStreamSettings } from '../track/types';
|
7
|
-
import Participant
|
7
|
+
import Participant from './Participant';
|
8
|
+
import type { ParticipantEventCallbacks } from './Participant';
|
8
9
|
export default class RemoteParticipant extends Participant {
|
9
10
|
audioTracks: Map<string, RemoteTrackPublication>;
|
10
11
|
videoTracks: Map<string, RemoteTrackPublication>;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import LocalAudioTrack from '../track/LocalAudioTrack';
|
2
2
|
import LocalVideoTrack from '../track/LocalVideoTrack';
|
3
|
-
import {
|
3
|
+
import { VideoPreset } from '../track/options';
|
4
|
+
import type { BackupVideoCodec, TrackPublishOptions, VideoCodec, VideoEncoding } from '../track/options';
|
4
5
|
/** @internal */
|
5
6
|
export declare function mediaTrackToLocalTrack(mediaStreamTrack: MediaStreamTrack, constraints?: MediaTrackConstraints): LocalVideoTrack | LocalAudioTrack;
|
6
7
|
export declare const presets169: VideoPreset[];
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { SignalClient } from '../../api/SignalClient';
|
2
2
|
import { VideoLayer, VideoQuality } from '../../proto/livekit_models';
|
3
3
|
import type { SubscribedCodec, SubscribedQuality } from '../../proto/livekit_rtc';
|
4
|
-
import { VideoSenderStats } from '../stats';
|
4
|
+
import type { VideoSenderStats } from '../stats';
|
5
5
|
import LocalTrack from './LocalTrack';
|
6
6
|
import type { VideoCaptureOptions, VideoCodec } from './options';
|
7
7
|
export declare class SimulcastTrackInfo {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import LocalAudioTrack from './LocalAudioTrack';
|
2
2
|
import type LocalTrack from './LocalTrack';
|
3
3
|
import LocalVideoTrack from './LocalVideoTrack';
|
4
|
-
import { AudioCaptureOptions, CreateLocalTracksOptions, ScreenShareCaptureOptions, VideoCaptureOptions } from './options';
|
4
|
+
import type { AudioCaptureOptions, CreateLocalTracksOptions, ScreenShareCaptureOptions, VideoCaptureOptions } from './options';
|
5
5
|
/**
|
6
6
|
* Creates a local video and audio track at the same time. When acquiring both
|
7
7
|
* audio and video tracks together, it'll display a single permission prompt to
|
@@ -21,9 +21,15 @@ export interface TrackPublishDefaults {
|
|
21
21
|
*/
|
22
22
|
videoCodec?: VideoCodec;
|
23
23
|
/**
|
24
|
-
* max audio bitrate, defaults to [[AudioPresets.
|
24
|
+
* max audio bitrate, defaults to [[AudioPresets.music]]
|
25
|
+
* @deprecated use `audioPreset` instead
|
25
26
|
*/
|
26
27
|
audioBitrate?: number;
|
28
|
+
/**
|
29
|
+
* which audio preset should be used for publishing (audio) tracks
|
30
|
+
* defaults to [[AudioPresets.music]]
|
31
|
+
*/
|
32
|
+
audioPreset?: AudioPreset;
|
27
33
|
/**
|
28
34
|
* dtx (Discontinuous Transmission of audio), enabled by default for mono tracks.
|
29
35
|
*/
|
@@ -180,16 +186,18 @@ export interface VideoResolution {
|
|
180
186
|
export interface VideoEncoding {
|
181
187
|
maxBitrate: number;
|
182
188
|
maxFramerate?: number;
|
189
|
+
priority?: RTCPriorityType;
|
183
190
|
}
|
184
191
|
export declare class VideoPreset {
|
185
192
|
encoding: VideoEncoding;
|
186
193
|
width: number;
|
187
194
|
height: number;
|
188
|
-
constructor(width: number, height: number, maxBitrate: number, maxFramerate?: number);
|
195
|
+
constructor(width: number, height: number, maxBitrate: number, maxFramerate?: number, priority?: RTCPriorityType);
|
189
196
|
get resolution(): VideoResolution;
|
190
197
|
}
|
191
198
|
export interface AudioPreset {
|
192
199
|
maxBitrate: number;
|
200
|
+
priority?: RTCPriorityType;
|
193
201
|
}
|
194
202
|
declare const codecs: readonly [
|
195
203
|
"vp8",
|
@@ -17,6 +17,7 @@ export declare function supportsSetSinkId(elm?: HTMLMediaElement): boolean;
|
|
17
17
|
export declare function supportsSetCodecPreferences(transceiver: RTCRtpTransceiver): boolean;
|
18
18
|
export declare function isBrowserSupported(): boolean;
|
19
19
|
export declare function isFireFox(): boolean;
|
20
|
+
export declare function isChromiumBased(): boolean;
|
20
21
|
export declare function isSafari(): boolean;
|
21
22
|
export declare function isMobile(): boolean;
|
22
23
|
export declare function isWeb(): boolean;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "livekit-client",
|
3
|
-
"version": "1.9.
|
3
|
+
"version": "1.9.3",
|
4
4
|
"description": "JavaScript/TypeScript client SDK for LiveKit",
|
5
5
|
"main": "./dist/livekit-client.umd.js",
|
6
6
|
"unpkg": "./dist/livekit-client.umd.js",
|
@@ -51,8 +51,8 @@
|
|
51
51
|
"webrtc-adapter": "^8.1.1"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
|
-
"@babel/core": "7.21.
|
55
|
-
"@babel/preset-env": "7.21.
|
54
|
+
"@babel/core": "7.21.8",
|
55
|
+
"@babel/preset-env": "7.21.5",
|
56
56
|
"@changesets/cli": "2.26.1",
|
57
57
|
"@livekit/changesets-changelog-github": "^0.0.4",
|
58
58
|
"@rollup/plugin-babel": "6.0.3",
|
@@ -61,31 +61,31 @@
|
|
61
61
|
"@rollup/plugin-node-resolve": "15.0.2",
|
62
62
|
"@rollup/plugin-terser": "^0.4.0",
|
63
63
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
64
|
-
"@types/jest": "29.5.
|
64
|
+
"@types/jest": "29.5.1",
|
65
65
|
"@types/sdp-transform": "2.4.6",
|
66
66
|
"@types/ua-parser-js": "0.7.36",
|
67
67
|
"@types/ws": "8.5.4",
|
68
|
-
"@typescript-eslint/eslint-plugin": "5.
|
69
|
-
"@typescript-eslint/parser": "5.
|
68
|
+
"@typescript-eslint/eslint-plugin": "5.59.2",
|
69
|
+
"@typescript-eslint/parser": "5.59.2",
|
70
70
|
"downlevel-dts": "^0.11.0",
|
71
|
-
"eslint": "8.
|
71
|
+
"eslint": "8.39.0",
|
72
72
|
"eslint-config-airbnb-typescript": "17.0.0",
|
73
73
|
"eslint-config-prettier": "8.8.0",
|
74
74
|
"eslint-plugin-import": "2.27.5",
|
75
75
|
"gh-pages": "5.0.0",
|
76
76
|
"jest": "29.5.0",
|
77
77
|
"prettier": "^2.8.8",
|
78
|
-
"rollup": "3.
|
78
|
+
"rollup": "3.21.3",
|
79
79
|
"rollup-plugin-delete": "^2.0.0",
|
80
80
|
"rollup-plugin-filesize": "10.0.0",
|
81
81
|
"rollup-plugin-re": "1.0.7",
|
82
82
|
"rollup-plugin-typescript2": "0.34.1",
|
83
83
|
"ts-jest": "29.1.0",
|
84
|
-
"ts-proto": "1.
|
85
|
-
"typedoc": "0.24.
|
84
|
+
"ts-proto": "1.147.1",
|
85
|
+
"typedoc": "0.24.6",
|
86
86
|
"typedoc-plugin-no-inherit": "1.4.0",
|
87
|
-
"typescript": "
|
88
|
-
"vite": "4.
|
87
|
+
"typescript": "5.0.4",
|
88
|
+
"vite": "4.3.4"
|
89
89
|
},
|
90
90
|
"browserslist": [
|
91
91
|
"safari >= 11",
|