livekit-client 1.9.1 → 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 +3338 -3037
- 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 -97
- 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 -120
- 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 -229
- package/dist/src/room/Room.d.ts.map +1 -1
- 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/api/SignalClient.d.ts +1 -0
- 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 +7 -1
- package/dist/ts4.2/src/room/Room.d.ts +3 -0
- 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 +19 -16
- 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 +44 -4
- package/src/room/Room.ts +87 -42
- 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
@@ -1,52 +1,53 @@
|
|
1
|
-
import type { SignalClient } from '../../api/SignalClient';
|
2
|
-
import type { ParticipantInfo } from '../../proto/livekit_models';
|
3
|
-
import RemoteTrackPublication from '../track/RemoteTrackPublication';
|
4
|
-
import { Track } from '../track/Track';
|
5
|
-
import type { AudioOutputOptions } from '../track/options';
|
6
|
-
import type { AdaptiveStreamSettings } from '../track/types';
|
7
|
-
import Participant
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
private
|
15
|
-
private
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
*
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
import type { SignalClient } from '../../api/SignalClient';
|
2
|
+
import type { ParticipantInfo } from '../../proto/livekit_models';
|
3
|
+
import RemoteTrackPublication from '../track/RemoteTrackPublication';
|
4
|
+
import { Track } from '../track/Track';
|
5
|
+
import type { AudioOutputOptions } from '../track/options';
|
6
|
+
import type { AdaptiveStreamSettings } from '../track/types';
|
7
|
+
import Participant from './Participant';
|
8
|
+
import type { ParticipantEventCallbacks } from './Participant';
|
9
|
+
export default class RemoteParticipant extends Participant {
|
10
|
+
audioTracks: Map<string, RemoteTrackPublication>;
|
11
|
+
videoTracks: Map<string, RemoteTrackPublication>;
|
12
|
+
tracks: Map<string, RemoteTrackPublication>;
|
13
|
+
signalClient: SignalClient;
|
14
|
+
private volume?;
|
15
|
+
private audioContext?;
|
16
|
+
private audioOutput?;
|
17
|
+
/** @internal */
|
18
|
+
static fromParticipantInfo(signalClient: SignalClient, pi: ParticipantInfo): RemoteParticipant;
|
19
|
+
/** @internal */
|
20
|
+
constructor(signalClient: SignalClient, sid: string, identity?: string, name?: string, metadata?: string);
|
21
|
+
protected addTrackPublication(publication: RemoteTrackPublication): void;
|
22
|
+
getTrack(source: Track.Source): RemoteTrackPublication | undefined;
|
23
|
+
getTrackByName(name: string): RemoteTrackPublication | undefined;
|
24
|
+
/**
|
25
|
+
* sets the volume on the participant's microphone track
|
26
|
+
* if no track exists the volume will be applied when the microphone track is added
|
27
|
+
*/
|
28
|
+
setVolume(volume: number): void;
|
29
|
+
/**
|
30
|
+
* gets the volume on the participant's microphone track
|
31
|
+
*/
|
32
|
+
getVolume(): number | undefined;
|
33
|
+
/** @internal */
|
34
|
+
addSubscribedMediaTrack(mediaTrack: MediaStreamTrack, sid: Track.SID, mediaStream: MediaStream, receiver?: RTCRtpReceiver, adaptiveStreamSettings?: AdaptiveStreamSettings, triesLeft?: number): RemoteTrackPublication | undefined;
|
35
|
+
/** @internal */
|
36
|
+
get hasMetadata(): boolean;
|
37
|
+
getTrackPublication(sid: Track.SID): RemoteTrackPublication | undefined;
|
38
|
+
/** @internal */
|
39
|
+
updateInfo(info: ParticipantInfo): boolean;
|
40
|
+
/** @internal */
|
41
|
+
unpublishTrack(sid: Track.SID, sendUnpublish?: boolean): void;
|
42
|
+
/**
|
43
|
+
* @internal
|
44
|
+
*/
|
45
|
+
setAudioContext(ctx: AudioContext | undefined): void;
|
46
|
+
/**
|
47
|
+
* @internal
|
48
|
+
*/
|
49
|
+
setAudioOutput(output: AudioOutputOptions): Promise<void>;
|
50
|
+
/** @internal */
|
51
|
+
emit<E extends keyof ParticipantEventCallbacks>(event: E, ...args: Parameters<ParticipantEventCallbacks[E]>): boolean;
|
52
|
+
}
|
52
53
|
//# sourceMappingURL=RemoteParticipant.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RemoteParticipant.d.ts","sourceRoot":"","sources":["../../../../src/room/participant/RemoteParticipant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,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,EAAE,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAChD,OAAO;CAIX"}
|
@@ -1,19 +1,20 @@
|
|
1
|
-
import LocalAudioTrack from '../track/LocalAudioTrack';
|
2
|
-
import LocalVideoTrack from '../track/LocalVideoTrack';
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
export declare
|
7
|
-
export declare const
|
8
|
-
export declare const
|
9
|
-
export declare const
|
10
|
-
export declare const
|
11
|
-
export declare const
|
12
|
-
export declare
|
13
|
-
export declare function
|
14
|
-
export declare function
|
15
|
-
export declare function
|
16
|
-
export declare function
|
17
|
-
|
18
|
-
|
1
|
+
import LocalAudioTrack from '../track/LocalAudioTrack';
|
2
|
+
import LocalVideoTrack from '../track/LocalVideoTrack';
|
3
|
+
import { VideoPreset } from '../track/options';
|
4
|
+
import type { BackupVideoCodec, TrackPublishOptions, VideoCodec, VideoEncoding } from '../track/options';
|
5
|
+
/** @internal */
|
6
|
+
export declare function mediaTrackToLocalTrack(mediaStreamTrack: MediaStreamTrack, constraints?: MediaTrackConstraints): LocalVideoTrack | LocalAudioTrack;
|
7
|
+
export declare const presets169: VideoPreset[];
|
8
|
+
export declare const presets43: VideoPreset[];
|
9
|
+
export declare const presetsScreenShare: VideoPreset[];
|
10
|
+
export declare const defaultSimulcastPresets169: VideoPreset[];
|
11
|
+
export declare const defaultSimulcastPresets43: VideoPreset[];
|
12
|
+
export declare const computeDefaultScreenShareSimulcastPresets: (fromPreset: VideoPreset) => VideoPreset[];
|
13
|
+
export declare function computeVideoEncodings(isScreenShare: boolean, width?: number, height?: number, options?: TrackPublishOptions): RTCRtpEncodingParameters[];
|
14
|
+
export declare function computeTrackBackupEncodings(track: LocalVideoTrack, videoCodec: BackupVideoCodec, opts: TrackPublishOptions): RTCRtpEncodingParameters[] | undefined;
|
15
|
+
export declare function determineAppropriateEncoding(isScreenShare: boolean, width: number, height: number, codec?: VideoCodec): VideoEncoding;
|
16
|
+
export declare function presetsForResolution(isScreenShare: boolean, width: number, height: number): VideoPreset[];
|
17
|
+
export declare function defaultSimulcastLayers(isScreenShare: boolean, original: VideoPreset): VideoPreset[];
|
18
|
+
/** @internal */
|
19
|
+
export declare function sortPresets(presets: Array<VideoPreset> | undefined): VideoPreset[] | undefined;
|
19
20
|
//# sourceMappingURL=publishUtils.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"publishUtils.d.ts","sourceRoot":"","sources":["../../../../src/room/participant/publishUtils.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,0BAA0B,CAAC;AACvD,OAAO,eAAe,MAAM,0BAA0B,CAAC;AAEvD,OAAO,
|
1
|
+
{"version":3,"file":"publishUtils.d.ts","sourceRoot":"","sources":["../../../../src/room/participant/publishUtils.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,0BAA0B,CAAC;AACvD,OAAO,eAAe,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAsB,WAAW,EAAgC,MAAM,kBAAkB,CAAC;AACjG,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACd,MAAM,kBAAkB,CAAC;AAG1B,gBAAgB;AAChB,wBAAgB,sBAAsB,CACpC,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,CAAC,EAAE,qBAAqB,GAClC,eAAe,GAAG,eAAe,CASnC;AAGD,eAAO,MAAM,UAAU,eAA8B,CAAC;AAGtD,eAAO,MAAM,SAAS,eAAgC,CAAC;AAGvD,eAAO,MAAM,kBAAkB,eAAoC,CAAC;AAGpE,eAAO,MAAM,0BAA0B,eAAyC,CAAC;AAGjF,eAAO,MAAM,yBAAyB,eAA6C,CAAC;AAGpF,eAAO,MAAM,yCAAyC,eAAgB,WAAW,kBAkBhF,CAAC;AAwBF,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,OAAO,EACtB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,mBAAmB,GAC5B,wBAAwB,EAAE,CAgG5B;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,mBAAmB,0CA4B1B;AAGD,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,OAAO,EACtB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,UAAU,GACjB,aAAa,CAiCf;AAGD,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,OAAO,EACtB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,WAAW,EAAE,CASf;AAGD,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,OAAO,EACtB,QAAQ,EAAE,WAAW,GACpB,WAAW,EAAE,CAUf;AAgCD,gBAAgB;AAChB,wBAAgB,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,SAAS,6BAelE"}
|
package/dist/src/room/stats.d.ts
CHANGED
@@ -1,67 +1,67 @@
|
|
1
|
-
export declare const monitorFrequency = 2000;
|
2
|
-
interface SenderStats {
|
3
|
-
/** number of packets sent */
|
4
|
-
packetsSent?: number;
|
5
|
-
/** number of bytes sent */
|
6
|
-
bytesSent?: number;
|
7
|
-
/** jitter as perceived by remote */
|
8
|
-
jitter?: number;
|
9
|
-
/** packets reported lost by remote */
|
10
|
-
packetsLost?: number;
|
11
|
-
/** RTT reported by remote */
|
12
|
-
roundTripTime?: number;
|
13
|
-
/** ID of the outbound stream */
|
14
|
-
streamId?: string;
|
15
|
-
timestamp: number;
|
16
|
-
}
|
17
|
-
export interface AudioSenderStats extends SenderStats {
|
18
|
-
type: 'audio';
|
19
|
-
}
|
20
|
-
export interface VideoSenderStats extends SenderStats {
|
21
|
-
type: 'video';
|
22
|
-
firCount: number;
|
23
|
-
pliCount: number;
|
24
|
-
nackCount: number;
|
25
|
-
rid: string;
|
26
|
-
frameWidth: number;
|
27
|
-
frameHeight: number;
|
28
|
-
framesSent: number;
|
29
|
-
qualityLimitationReason: string;
|
30
|
-
qualityLimitationResolutionChanges: number;
|
31
|
-
retransmittedPacketsSent: number;
|
32
|
-
}
|
33
|
-
interface ReceiverStats {
|
34
|
-
jitterBufferDelay?: number;
|
35
|
-
/** packets reported lost by remote */
|
36
|
-
packetsLost?: number;
|
37
|
-
/** number of packets sent */
|
38
|
-
packetsReceived?: number;
|
39
|
-
bytesReceived?: number;
|
40
|
-
streamId?: string;
|
41
|
-
jitter?: number;
|
42
|
-
timestamp: number;
|
43
|
-
}
|
44
|
-
export interface AudioReceiverStats extends ReceiverStats {
|
45
|
-
type: 'audio';
|
46
|
-
concealedSamples?: number;
|
47
|
-
concealmentEvents?: number;
|
48
|
-
silentConcealedSamples?: number;
|
49
|
-
silentConcealmentEvents?: number;
|
50
|
-
totalAudioEnergy?: number;
|
51
|
-
totalSamplesDuration?: number;
|
52
|
-
}
|
53
|
-
export interface VideoReceiverStats extends ReceiverStats {
|
54
|
-
type: 'video';
|
55
|
-
framesDecoded: number;
|
56
|
-
framesDropped: number;
|
57
|
-
framesReceived: number;
|
58
|
-
frameWidth?: number;
|
59
|
-
frameHeight?: number;
|
60
|
-
firCount?: number;
|
61
|
-
pliCount?: number;
|
62
|
-
nackCount?: number;
|
63
|
-
decoderImplementation?: string;
|
64
|
-
}
|
65
|
-
export declare function computeBitrate<T extends ReceiverStats | SenderStats>(currentStats: T, prevStats?: T): number;
|
66
|
-
export {};
|
1
|
+
export declare const monitorFrequency = 2000;
|
2
|
+
interface SenderStats {
|
3
|
+
/** number of packets sent */
|
4
|
+
packetsSent?: number;
|
5
|
+
/** number of bytes sent */
|
6
|
+
bytesSent?: number;
|
7
|
+
/** jitter as perceived by remote */
|
8
|
+
jitter?: number;
|
9
|
+
/** packets reported lost by remote */
|
10
|
+
packetsLost?: number;
|
11
|
+
/** RTT reported by remote */
|
12
|
+
roundTripTime?: number;
|
13
|
+
/** ID of the outbound stream */
|
14
|
+
streamId?: string;
|
15
|
+
timestamp: number;
|
16
|
+
}
|
17
|
+
export interface AudioSenderStats extends SenderStats {
|
18
|
+
type: 'audio';
|
19
|
+
}
|
20
|
+
export interface VideoSenderStats extends SenderStats {
|
21
|
+
type: 'video';
|
22
|
+
firCount: number;
|
23
|
+
pliCount: number;
|
24
|
+
nackCount: number;
|
25
|
+
rid: string;
|
26
|
+
frameWidth: number;
|
27
|
+
frameHeight: number;
|
28
|
+
framesSent: number;
|
29
|
+
qualityLimitationReason: string;
|
30
|
+
qualityLimitationResolutionChanges: number;
|
31
|
+
retransmittedPacketsSent: number;
|
32
|
+
}
|
33
|
+
interface ReceiverStats {
|
34
|
+
jitterBufferDelay?: number;
|
35
|
+
/** packets reported lost by remote */
|
36
|
+
packetsLost?: number;
|
37
|
+
/** number of packets sent */
|
38
|
+
packetsReceived?: number;
|
39
|
+
bytesReceived?: number;
|
40
|
+
streamId?: string;
|
41
|
+
jitter?: number;
|
42
|
+
timestamp: number;
|
43
|
+
}
|
44
|
+
export interface AudioReceiverStats extends ReceiverStats {
|
45
|
+
type: 'audio';
|
46
|
+
concealedSamples?: number;
|
47
|
+
concealmentEvents?: number;
|
48
|
+
silentConcealedSamples?: number;
|
49
|
+
silentConcealmentEvents?: number;
|
50
|
+
totalAudioEnergy?: number;
|
51
|
+
totalSamplesDuration?: number;
|
52
|
+
}
|
53
|
+
export interface VideoReceiverStats extends ReceiverStats {
|
54
|
+
type: 'video';
|
55
|
+
framesDecoded: number;
|
56
|
+
framesDropped: number;
|
57
|
+
framesReceived: number;
|
58
|
+
frameWidth?: number;
|
59
|
+
frameHeight?: number;
|
60
|
+
firCount?: number;
|
61
|
+
pliCount?: number;
|
62
|
+
nackCount?: number;
|
63
|
+
decoderImplementation?: string;
|
64
|
+
}
|
65
|
+
export declare function computeBitrate<T extends ReceiverStats | SenderStats>(currentStats: T, prevStats?: T): number;
|
66
|
+
export {};
|
67
67
|
//# sourceMappingURL=stats.d.ts.map
|
@@ -1,13 +1,13 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/**
|
3
|
-
* Timers that can be overridden with platform specific implementations
|
4
|
-
* that ensure that they are fired. These should be used when it is critical
|
5
|
-
* that the timer fires on time.
|
6
|
-
*/
|
7
|
-
export default class CriticalTimers {
|
8
|
-
static setTimeout: (callback: (args: void) => void, ms?: number | undefined) => NodeJS.Timeout;
|
9
|
-
static setInterval: (callback: (args: void) => void, ms?: number | undefined) => NodeJS.Timer;
|
10
|
-
static clearTimeout: (timeoutId: NodeJS.Timeout) => void;
|
11
|
-
static clearInterval: (intervalId: NodeJS.Timeout) => void;
|
12
|
-
}
|
1
|
+
/// <reference types="node" />
|
2
|
+
/**
|
3
|
+
* Timers that can be overridden with platform specific implementations
|
4
|
+
* that ensure that they are fired. These should be used when it is critical
|
5
|
+
* that the timer fires on time.
|
6
|
+
*/
|
7
|
+
export default class CriticalTimers {
|
8
|
+
static setTimeout: (callback: (args: void) => void, ms?: number | undefined) => NodeJS.Timeout;
|
9
|
+
static setInterval: (callback: (args: void) => void, ms?: number | undefined) => NodeJS.Timer;
|
10
|
+
static clearTimeout: (timeoutId: NodeJS.Timeout) => void;
|
11
|
+
static clearInterval: (intervalId: NodeJS.Timeout) => void;
|
12
|
+
}
|
13
13
|
//# sourceMappingURL=timers.d.ts.map
|
@@ -1,25 +1,25 @@
|
|
1
|
-
import { AudioSenderStats } from '../stats';
|
2
|
-
import LocalTrack from './LocalTrack';
|
3
|
-
import type { AudioCaptureOptions } from './options';
|
4
|
-
export default class LocalAudioTrack extends LocalTrack {
|
5
|
-
/** @internal */
|
6
|
-
stopOnMute: boolean;
|
7
|
-
private prevStats?;
|
8
|
-
/**
|
9
|
-
*
|
10
|
-
* @param mediaTrack
|
11
|
-
* @param constraints MediaTrackConstraints that are being used when restarting or reacquiring tracks
|
12
|
-
* @param userProvidedTrack Signals to the SDK whether or not the mediaTrack should be managed (i.e. released and reacquired) internally by the SDK
|
13
|
-
*/
|
14
|
-
constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean);
|
15
|
-
setDeviceId(deviceId: ConstrainDOMString): Promise<void>;
|
16
|
-
mute(): Promise<LocalAudioTrack>;
|
17
|
-
unmute(): Promise<LocalAudioTrack>;
|
18
|
-
restartTrack(options?: AudioCaptureOptions): Promise<void>;
|
19
|
-
protected restart(constraints?: MediaTrackConstraints): Promise<LocalTrack>;
|
20
|
-
startMonitor(): void;
|
21
|
-
protected monitorSender: () => Promise<void>;
|
22
|
-
getSenderStats(): Promise<AudioSenderStats | undefined>;
|
23
|
-
checkForSilence(): Promise<boolean>;
|
24
|
-
}
|
1
|
+
import type { AudioSenderStats } from '../stats';
|
2
|
+
import LocalTrack from './LocalTrack';
|
3
|
+
import type { AudioCaptureOptions } from './options';
|
4
|
+
export default class LocalAudioTrack extends LocalTrack {
|
5
|
+
/** @internal */
|
6
|
+
stopOnMute: boolean;
|
7
|
+
private prevStats?;
|
8
|
+
/**
|
9
|
+
*
|
10
|
+
* @param mediaTrack
|
11
|
+
* @param constraints MediaTrackConstraints that are being used when restarting or reacquiring tracks
|
12
|
+
* @param userProvidedTrack Signals to the SDK whether or not the mediaTrack should be managed (i.e. released and reacquired) internally by the SDK
|
13
|
+
*/
|
14
|
+
constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean);
|
15
|
+
setDeviceId(deviceId: ConstrainDOMString): Promise<void>;
|
16
|
+
mute(): Promise<LocalAudioTrack>;
|
17
|
+
unmute(): Promise<LocalAudioTrack>;
|
18
|
+
restartTrack(options?: AudioCaptureOptions): Promise<void>;
|
19
|
+
protected restart(constraints?: MediaTrackConstraints): Promise<LocalTrack>;
|
20
|
+
startMonitor(): void;
|
21
|
+
protected monitorSender: () => Promise<void>;
|
22
|
+
getSenderStats(): Promise<AudioSenderStats | undefined>;
|
23
|
+
checkForSilence(): Promise<boolean>;
|
24
|
+
}
|
25
25
|
//# sourceMappingURL=LocalAudioTrack.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LocalAudioTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/LocalAudioTrack.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"LocalAudioTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/LocalAudioTrack.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,gBAAgB;IAChB,UAAU,EAAE,OAAO,CAAS;IAE5B,OAAO,CAAC,SAAS,CAAC,CAAmB;IAErC;;;;;OAKG;gBAED,UAAU,EAAE,gBAAgB,EAC5B,WAAW,CAAC,EAAE,qBAAqB,EACnC,iBAAiB,UAAO;IAMpB,WAAW,CAAC,QAAQ,EAAE,kBAAkB;IAUxC,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;IAgBhC,MAAM,IAAI,OAAO,CAAC,eAAe,CAAC;IAmBlC,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB;cAWhC,OAAO,CAAC,WAAW,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC;IAOjF,YAAY;IAYZ,SAAS,CAAC,aAAa,sBAmBrB;IAEI,cAAc,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAyBvD,eAAe;CAUtB"}
|
@@ -1,44 +1,44 @@
|
|
1
|
-
import { Mutex } from '../utils';
|
2
|
-
import { Track } from './Track';
|
3
|
-
import type { VideoCodec } from './options';
|
4
|
-
export default abstract class LocalTrack extends Track {
|
5
|
-
/** @internal */
|
6
|
-
sender?: RTCRtpSender;
|
7
|
-
/** @internal */
|
8
|
-
codec?: VideoCodec;
|
9
|
-
protected constraints: MediaTrackConstraints;
|
10
|
-
protected reacquireTrack: boolean;
|
11
|
-
protected providedByUser: boolean;
|
12
|
-
protected muteLock: Mutex;
|
13
|
-
protected pauseUpstreamLock: Mutex;
|
14
|
-
/**
|
15
|
-
*
|
16
|
-
* @param mediaTrack
|
17
|
-
* @param kind
|
18
|
-
* @param constraints MediaTrackConstraints that are being used when restarting or reacquiring tracks
|
19
|
-
* @param userProvidedTrack Signals to the SDK whether or not the mediaTrack should be managed (i.e. released and reacquired) internally by the SDK
|
20
|
-
*/
|
21
|
-
protected constructor(mediaTrack: MediaStreamTrack, kind: Track.Kind, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean);
|
22
|
-
get id(): string;
|
23
|
-
get dimensions(): Track.Dimensions | undefined;
|
24
|
-
private _isUpstreamPaused;
|
25
|
-
get isUpstreamPaused(): boolean;
|
26
|
-
get isUserProvided(): boolean;
|
27
|
-
waitForDimensions(timeout?: number): Promise<Track.Dimensions>;
|
28
|
-
/**
|
29
|
-
* @returns DeviceID of the device that is currently being used for this track
|
30
|
-
*/
|
31
|
-
getDeviceId(): Promise<string | undefined>;
|
32
|
-
mute(): Promise<LocalTrack>;
|
33
|
-
unmute(): Promise<LocalTrack>;
|
34
|
-
replaceTrack(track: MediaStreamTrack, userProvidedTrack?: boolean): Promise<LocalTrack>;
|
35
|
-
protected restart(constraints?: MediaTrackConstraints): Promise<LocalTrack>;
|
36
|
-
protected setTrackMuted(muted: boolean): void;
|
37
|
-
protected get needsReAcquisition(): boolean;
|
38
|
-
protected handleAppVisibilityChanged(): Promise<void>;
|
39
|
-
private handleEnded;
|
40
|
-
pauseUpstream(): Promise<void>;
|
41
|
-
resumeUpstream(): Promise<void>;
|
42
|
-
protected abstract monitorSender(): void;
|
43
|
-
}
|
1
|
+
import { Mutex } from '../utils';
|
2
|
+
import { Track } from './Track';
|
3
|
+
import type { VideoCodec } from './options';
|
4
|
+
export default abstract class LocalTrack extends Track {
|
5
|
+
/** @internal */
|
6
|
+
sender?: RTCRtpSender;
|
7
|
+
/** @internal */
|
8
|
+
codec?: VideoCodec;
|
9
|
+
protected constraints: MediaTrackConstraints;
|
10
|
+
protected reacquireTrack: boolean;
|
11
|
+
protected providedByUser: boolean;
|
12
|
+
protected muteLock: Mutex;
|
13
|
+
protected pauseUpstreamLock: Mutex;
|
14
|
+
/**
|
15
|
+
*
|
16
|
+
* @param mediaTrack
|
17
|
+
* @param kind
|
18
|
+
* @param constraints MediaTrackConstraints that are being used when restarting or reacquiring tracks
|
19
|
+
* @param userProvidedTrack Signals to the SDK whether or not the mediaTrack should be managed (i.e. released and reacquired) internally by the SDK
|
20
|
+
*/
|
21
|
+
protected constructor(mediaTrack: MediaStreamTrack, kind: Track.Kind, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean);
|
22
|
+
get id(): string;
|
23
|
+
get dimensions(): Track.Dimensions | undefined;
|
24
|
+
private _isUpstreamPaused;
|
25
|
+
get isUpstreamPaused(): boolean;
|
26
|
+
get isUserProvided(): boolean;
|
27
|
+
waitForDimensions(timeout?: number): Promise<Track.Dimensions>;
|
28
|
+
/**
|
29
|
+
* @returns DeviceID of the device that is currently being used for this track
|
30
|
+
*/
|
31
|
+
getDeviceId(): Promise<string | undefined>;
|
32
|
+
mute(): Promise<LocalTrack>;
|
33
|
+
unmute(): Promise<LocalTrack>;
|
34
|
+
replaceTrack(track: MediaStreamTrack, userProvidedTrack?: boolean): Promise<LocalTrack>;
|
35
|
+
protected restart(constraints?: MediaTrackConstraints): Promise<LocalTrack>;
|
36
|
+
protected setTrackMuted(muted: boolean): void;
|
37
|
+
protected get needsReAcquisition(): boolean;
|
38
|
+
protected handleAppVisibilityChanged(): Promise<void>;
|
39
|
+
private handleEnded;
|
40
|
+
pauseUpstream(): Promise<void>;
|
41
|
+
resumeUpstream(): Promise<void>;
|
42
|
+
protected abstract monitorSender(): void;
|
43
|
+
}
|
44
44
|
//# sourceMappingURL=LocalTrack.d.ts.map
|
@@ -1,38 +1,38 @@
|
|
1
|
-
import type { TrackInfo } from '../../proto/livekit_models';
|
2
|
-
import type LocalAudioTrack from './LocalAudioTrack';
|
3
|
-
import type LocalTrack from './LocalTrack';
|
4
|
-
import type LocalVideoTrack from './LocalVideoTrack';
|
5
|
-
import type { Track } from './Track';
|
6
|
-
import { TrackPublication } from './TrackPublication';
|
7
|
-
import type { TrackPublishOptions } from './options';
|
8
|
-
export default class LocalTrackPublication extends TrackPublication {
|
9
|
-
track?: LocalTrack;
|
10
|
-
options?: TrackPublishOptions;
|
11
|
-
get isUpstreamPaused(): boolean | undefined;
|
12
|
-
constructor(kind: Track.Kind, ti: TrackInfo, track?: LocalTrack);
|
13
|
-
setTrack(track?: Track): void;
|
14
|
-
get isMuted(): boolean;
|
15
|
-
get audioTrack(): LocalAudioTrack | undefined;
|
16
|
-
get videoTrack(): LocalVideoTrack | undefined;
|
17
|
-
/**
|
18
|
-
* Mute the track associated with this publication
|
19
|
-
*/
|
20
|
-
mute(): Promise<LocalTrack | undefined>;
|
21
|
-
/**
|
22
|
-
* Unmute track associated with this publication
|
23
|
-
*/
|
24
|
-
unmute(): Promise<LocalTrack | undefined>;
|
25
|
-
/**
|
26
|
-
* Pauses the media stream track associated with this publication from being sent to the server
|
27
|
-
* and signals "muted" event to other participants
|
28
|
-
* Useful if you want to pause the stream without pausing the local media stream track
|
29
|
-
*/
|
30
|
-
pauseUpstream(): Promise<void>;
|
31
|
-
/**
|
32
|
-
* Resumes sending the media stream track associated with this publication to the server after a call to [[pauseUpstream()]]
|
33
|
-
* and signals "unmuted" event to other participants (unless the track is explicitly muted)
|
34
|
-
*/
|
35
|
-
resumeUpstream(): Promise<void>;
|
36
|
-
handleTrackEnded: () => void;
|
37
|
-
}
|
1
|
+
import type { TrackInfo } from '../../proto/livekit_models';
|
2
|
+
import type LocalAudioTrack from './LocalAudioTrack';
|
3
|
+
import type LocalTrack from './LocalTrack';
|
4
|
+
import type LocalVideoTrack from './LocalVideoTrack';
|
5
|
+
import type { Track } from './Track';
|
6
|
+
import { TrackPublication } from './TrackPublication';
|
7
|
+
import type { TrackPublishOptions } from './options';
|
8
|
+
export default class LocalTrackPublication extends TrackPublication {
|
9
|
+
track?: LocalTrack;
|
10
|
+
options?: TrackPublishOptions;
|
11
|
+
get isUpstreamPaused(): boolean | undefined;
|
12
|
+
constructor(kind: Track.Kind, ti: TrackInfo, track?: LocalTrack);
|
13
|
+
setTrack(track?: Track): void;
|
14
|
+
get isMuted(): boolean;
|
15
|
+
get audioTrack(): LocalAudioTrack | undefined;
|
16
|
+
get videoTrack(): LocalVideoTrack | undefined;
|
17
|
+
/**
|
18
|
+
* Mute the track associated with this publication
|
19
|
+
*/
|
20
|
+
mute(): Promise<LocalTrack | undefined>;
|
21
|
+
/**
|
22
|
+
* Unmute track associated with this publication
|
23
|
+
*/
|
24
|
+
unmute(): Promise<LocalTrack | undefined>;
|
25
|
+
/**
|
26
|
+
* Pauses the media stream track associated with this publication from being sent to the server
|
27
|
+
* and signals "muted" event to other participants
|
28
|
+
* Useful if you want to pause the stream without pausing the local media stream track
|
29
|
+
*/
|
30
|
+
pauseUpstream(): Promise<void>;
|
31
|
+
/**
|
32
|
+
* Resumes sending the media stream track associated with this publication to the server after a call to [[pauseUpstream()]]
|
33
|
+
* and signals "unmuted" event to other participants (unless the track is explicitly muted)
|
34
|
+
*/
|
35
|
+
resumeUpstream(): Promise<void>;
|
36
|
+
handleTrackEnded: () => void;
|
37
|
+
}
|
38
38
|
//# sourceMappingURL=LocalTrackPublication.d.ts.map
|