livekit-client 1.9.7 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/livekit-client.esm.mjs +2972 -2583
- 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 +2 -1
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/connectionHelper/ConnectionCheck.d.ts +2 -3
- package/dist/src/connectionHelper/ConnectionCheck.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/Checker.d.ts +2 -3
- package/dist/src/connectionHelper/checks/Checker.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/proto/livekit_models.d.ts +108 -10
- package/dist/src/proto/livekit_models.d.ts.map +1 -1
- package/dist/src/proto/livekit_rtc.d.ts +513 -194
- package/dist/src/proto/livekit_rtc.d.ts.map +1 -1
- package/dist/src/room/PCTransport.d.ts +1 -1
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +2 -4
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +6 -6
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +5 -1
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +4 -6
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts +2 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/publishUtils.d.ts +8 -0
- package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +33 -0
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteTrackPublication.d.ts +4 -1
- package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/RemoteVideoTrack.d.ts +1 -0
- package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/Track.d.ts +2 -4
- package/dist/src/room/track/Track.d.ts.map +1 -1
- package/dist/src/room/track/TrackPublication.d.ts +4 -5
- package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/options.d.ts +14 -5
- package/dist/src/room/track/options.d.ts.map +1 -1
- package/dist/src/room/track/processor/types.d.ts +19 -0
- package/dist/src/room/track/processor/types.d.ts.map +1 -0
- package/dist/src/room/track/types.d.ts +2 -1
- package/dist/src/room/track/types.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/ts4.2/src/api/SignalClient.d.ts +2 -1
- package/dist/ts4.2/src/connectionHelper/ConnectionCheck.d.ts +2 -3
- package/dist/ts4.2/src/connectionHelper/checks/Checker.d.ts +2 -3
- package/dist/ts4.2/src/index.d.ts +1 -0
- package/dist/ts4.2/src/proto/livekit_models.d.ts +126 -12
- package/dist/ts4.2/src/proto/livekit_rtc.d.ts +617 -254
- package/dist/ts4.2/src/room/PCTransport.d.ts +1 -1
- package/dist/ts4.2/src/room/RTCEngine.d.ts +2 -4
- package/dist/ts4.2/src/room/Room.d.ts +6 -6
- package/dist/ts4.2/src/room/events.d.ts +5 -1
- package/dist/ts4.2/src/room/participant/Participant.d.ts +4 -6
- package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +2 -1
- package/dist/ts4.2/src/room/participant/publishUtils.d.ts +8 -0
- package/dist/ts4.2/src/room/track/LocalTrack.d.ts +33 -0
- package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +1 -1
- package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +4 -1
- package/dist/ts4.2/src/room/track/RemoteVideoTrack.d.ts +1 -0
- package/dist/ts4.2/src/room/track/Track.d.ts +2 -4
- package/dist/ts4.2/src/room/track/TrackPublication.d.ts +4 -5
- package/dist/ts4.2/src/room/track/options.d.ts +14 -5
- package/dist/ts4.2/src/room/track/processor/types.d.ts +19 -0
- package/dist/ts4.2/src/room/track/types.d.ts +2 -1
- package/package.json +14 -15
- package/src/api/SignalClient.ts +8 -1
- package/src/connectionHelper/ConnectionCheck.ts +2 -3
- package/src/connectionHelper/checks/Checker.ts +2 -3
- package/src/index.ts +1 -0
- package/src/logger.ts +4 -4
- package/src/proto/google/protobuf/timestamp.ts +3 -3
- package/src/proto/livekit_models.ts +254 -161
- package/src/proto/livekit_rtc.ts +334 -180
- package/src/room/PCTransport.ts +1 -1
- package/src/room/RTCEngine.ts +4 -4
- package/src/room/Room.ts +67 -12
- package/src/room/events.ts +4 -0
- package/src/room/participant/LocalParticipant.ts +33 -5
- package/src/room/participant/Participant.ts +4 -5
- package/src/room/participant/RemoteParticipant.ts +8 -4
- package/src/room/participant/publishUtils.ts +47 -20
- package/src/room/track/LocalTrack.ts +180 -57
- package/src/room/track/LocalVideoTrack.ts +98 -33
- package/src/room/track/RemoteTrackPublication.ts +8 -1
- package/src/room/track/RemoteVideoTrack.ts +23 -6
- package/src/room/track/Track.ts +5 -7
- package/src/room/track/TrackPublication.ts +4 -5
- package/src/room/track/options.ts +14 -5
- package/src/room/track/processor/types.ts +20 -0
- package/src/room/track/types.ts +2 -1
- package/src/room/utils.ts +6 -3
@@ -0,0 +1,20 @@
|
|
1
|
+
import type { Track } from '../Track';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @experimental
|
5
|
+
*/
|
6
|
+
export type ProcessorOptions<T extends Track.Kind> = {
|
7
|
+
kind: T;
|
8
|
+
track: MediaStreamTrack;
|
9
|
+
element?: HTMLMediaElement;
|
10
|
+
};
|
11
|
+
|
12
|
+
/**
|
13
|
+
* @experimental
|
14
|
+
*/
|
15
|
+
export interface TrackProcessor<T extends Track.Kind> {
|
16
|
+
name: string;
|
17
|
+
init: (opts: ProcessorOptions<T>) => void;
|
18
|
+
destroy: () => Promise<void>;
|
19
|
+
processedTrack?: MediaStreamTrack;
|
20
|
+
}
|
package/src/room/track/types.ts
CHANGED
@@ -8,7 +8,8 @@ export type VideoTrack = RemoteVideoTrack | LocalVideoTrack;
|
|
8
8
|
|
9
9
|
export type AdaptiveStreamSettings = {
|
10
10
|
/**
|
11
|
-
* Set a custom pixel density
|
11
|
+
* Set a custom pixel density. Defaults to 2 for high density screens (3+) or
|
12
|
+
* 1 otherwise.
|
12
13
|
* When streaming videos on a ultra high definition screen this setting
|
13
14
|
* let's you account for the devicePixelRatio of those screens.
|
14
15
|
* Set it to `screen` to use the actual pixel density of the screen
|
package/src/room/utils.ts
CHANGED
@@ -261,7 +261,7 @@ export function getEmptyVideoStreamTrack() {
|
|
261
261
|
if (!emptyVideoStreamTrack) {
|
262
262
|
emptyVideoStreamTrack = createDummyVideoStreamTrack();
|
263
263
|
}
|
264
|
-
return emptyVideoStreamTrack;
|
264
|
+
return emptyVideoStreamTrack.clone();
|
265
265
|
}
|
266
266
|
|
267
267
|
export function createDummyVideoStreamTrack(
|
@@ -301,8 +301,11 @@ export function getEmptyAudioStreamTrack() {
|
|
301
301
|
// implementation adapted from https://blog.mozilla.org/webrtc/warm-up-with-replacetrack/
|
302
302
|
const ctx = new AudioContext();
|
303
303
|
const oscillator = ctx.createOscillator();
|
304
|
+
const gain = ctx.createGain();
|
305
|
+
gain.gain.setValueAtTime(0, 0);
|
304
306
|
const dst = ctx.createMediaStreamDestination();
|
305
|
-
oscillator.connect(
|
307
|
+
oscillator.connect(gain);
|
308
|
+
gain.connect(dst);
|
306
309
|
oscillator.start();
|
307
310
|
[emptyAudioStreamTrack] = dst.stream.getAudioTracks();
|
308
311
|
if (!emptyAudioStreamTrack) {
|
@@ -310,7 +313,7 @@ export function getEmptyAudioStreamTrack() {
|
|
310
313
|
}
|
311
314
|
emptyAudioStreamTrack.enabled = false;
|
312
315
|
}
|
313
|
-
return emptyAudioStreamTrack;
|
316
|
+
return emptyAudioStreamTrack.clone();
|
314
317
|
}
|
315
318
|
|
316
319
|
export class Future<T> {
|