livekit-client 2.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/README.md +8 -0
  2. package/dist/livekit-client.e2ee.worker.js +1 -1
  3. package/dist/livekit-client.e2ee.worker.js.map +1 -1
  4. package/dist/livekit-client.e2ee.worker.mjs +4 -4
  5. package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
  6. package/dist/livekit-client.esm.mjs +122 -39
  7. package/dist/livekit-client.esm.mjs.map +1 -1
  8. package/dist/livekit-client.umd.js +1 -1
  9. package/dist/livekit-client.umd.js.map +1 -1
  10. package/dist/src/proto/livekit_models_pb.d.ts +9 -1
  11. package/dist/src/proto/livekit_models_pb.d.ts.map +1 -1
  12. package/dist/src/proto/livekit_rtc_pb.d.ts +38 -0
  13. package/dist/src/proto/livekit_rtc_pb.d.ts.map +1 -1
  14. package/dist/src/room/PCTransport.d.ts +1 -2
  15. package/dist/src/room/PCTransport.d.ts.map +1 -1
  16. package/dist/src/room/PCTransportManager.d.ts.map +1 -1
  17. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  18. package/dist/src/room/Room.d.ts.map +1 -1
  19. package/dist/src/room/events.d.ts +8 -1
  20. package/dist/src/room/events.d.ts.map +1 -1
  21. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  22. package/dist/src/room/track/LocalAudioTrack.d.ts +8 -7
  23. package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
  24. package/dist/src/room/track/LocalTrack.d.ts +10 -9
  25. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  26. package/dist/src/room/track/LocalTrackPublication.d.ts +2 -2
  27. package/dist/src/room/track/LocalVideoTrack.d.ts +3 -3
  28. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  29. package/dist/src/room/track/RemoteAudioTrack.d.ts +2 -1
  30. package/dist/src/room/track/RemoteAudioTrack.d.ts.map +1 -1
  31. package/dist/src/room/track/RemoteTrack.d.ts +2 -2
  32. package/dist/src/room/track/RemoteTrack.d.ts.map +1 -1
  33. package/dist/src/room/track/RemoteVideoTrack.d.ts +2 -1
  34. package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
  35. package/dist/src/room/track/Track.d.ts +3 -3
  36. package/dist/src/room/track/Track.d.ts.map +1 -1
  37. package/dist/src/room/track/processor/types.d.ts +4 -0
  38. package/dist/src/room/track/processor/types.d.ts.map +1 -1
  39. package/dist/ts4.2/src/proto/livekit_models_pb.d.ts +9 -1
  40. package/dist/ts4.2/src/proto/livekit_rtc_pb.d.ts +38 -0
  41. package/dist/ts4.2/src/room/PCTransport.d.ts +1 -2
  42. package/dist/ts4.2/src/room/events.d.ts +8 -1
  43. package/dist/ts4.2/src/room/track/LocalAudioTrack.d.ts +8 -7
  44. package/dist/ts4.2/src/room/track/LocalTrack.d.ts +10 -9
  45. package/dist/ts4.2/src/room/track/LocalTrackPublication.d.ts +2 -2
  46. package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +3 -3
  47. package/dist/ts4.2/src/room/track/RemoteAudioTrack.d.ts +2 -1
  48. package/dist/ts4.2/src/room/track/RemoteTrack.d.ts +2 -2
  49. package/dist/ts4.2/src/room/track/RemoteVideoTrack.d.ts +2 -1
  50. package/dist/ts4.2/src/room/track/Track.d.ts +3 -3
  51. package/dist/ts4.2/src/room/track/processor/types.d.ts +4 -0
  52. package/package.json +2 -2
  53. package/src/api/SignalClient.ts +1 -1
  54. package/src/e2ee/worker/e2ee.worker.ts +8 -4
  55. package/src/proto/livekit_models_pb.ts +12 -0
  56. package/src/proto/livekit_rtc_pb.ts +53 -0
  57. package/src/room/PCTransport.ts +3 -13
  58. package/src/room/PCTransportManager.ts +1 -2
  59. package/src/room/RTCEngine.ts +5 -0
  60. package/src/room/Room.ts +3 -0
  61. package/src/room/events.ts +8 -1
  62. package/src/room/participant/LocalParticipant.ts +0 -1
  63. package/src/room/track/LocalAudioTrack.ts +8 -11
  64. package/src/room/track/LocalTrack.ts +36 -23
  65. package/src/room/track/LocalVideoTrack.ts +3 -3
  66. package/src/room/track/RemoteAudioTrack.ts +1 -1
  67. package/src/room/track/RemoteTrack.ts +4 -2
  68. package/src/room/track/RemoteVideoTrack.ts +1 -1
  69. package/src/room/track/Track.ts +5 -3
  70. package/src/room/track/processor/types.ts +4 -0
@@ -3,7 +3,7 @@ import { Mutex } from '../utils';
3
3
  import { Track } from './Track';
4
4
  import type { VideoCodec } from './options';
5
5
  import type { TrackProcessor } from './processor/types';
6
- export default abstract class LocalTrack extends Track {
6
+ export default abstract class LocalTrack<TrackKind extends Track.Kind = Track.Kind> extends Track<TrackKind> {
7
7
  /** @internal */
8
8
  sender?: RTCRtpSender;
9
9
  /** @internal */
@@ -15,8 +15,9 @@ export default abstract class LocalTrack extends Track {
15
15
  protected muteLock: Mutex;
16
16
  protected pauseUpstreamLock: Mutex;
17
17
  protected processorElement?: HTMLMediaElement;
18
- protected processor?: TrackProcessor<this['kind']>;
18
+ protected processor?: TrackProcessor<TrackKind, any>;
19
19
  protected processorLock: Mutex;
20
+ protected audioContext?: AudioContext;
20
21
  /**
21
22
  *
22
23
  * @param mediaTrack
@@ -24,7 +25,7 @@ export default abstract class LocalTrack extends Track {
24
25
  * @param constraints MediaTrackConstraints that are being used when restarting or reacquiring tracks
25
26
  * @param userProvidedTrack Signals to the SDK whether or not the mediaTrack should be managed (i.e. released and reacquired) internally by the SDK
26
27
  */
27
- protected constructor(mediaTrack: MediaStreamTrack, kind: Track.Kind, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, loggerOptions?: LoggerOptions);
28
+ protected constructor(mediaTrack: MediaStreamTrack, kind: TrackKind, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, loggerOptions?: LoggerOptions);
28
29
  get id(): string;
29
30
  get dimensions(): Track.Dimensions | undefined;
30
31
  private _isUpstreamPaused;
@@ -37,10 +38,10 @@ export default abstract class LocalTrack extends Track {
37
38
  * @returns DeviceID of the device that is currently being used for this track
38
39
  */
39
40
  getDeviceId(): Promise<string | undefined>;
40
- mute(): Promise<LocalTrack>;
41
- unmute(): Promise<LocalTrack>;
42
- replaceTrack(track: MediaStreamTrack, userProvidedTrack?: boolean): Promise<LocalTrack>;
43
- protected restart(constraints?: MediaTrackConstraints): Promise<LocalTrack>;
41
+ mute(): Promise<this>;
42
+ unmute(): Promise<this>;
43
+ replaceTrack(track: MediaStreamTrack, userProvidedTrack?: boolean): Promise<this>;
44
+ protected restart(constraints?: MediaTrackConstraints): Promise<this>;
44
45
  protected setTrackMuted(muted: boolean): void;
45
46
  protected get needsReAcquisition(): boolean;
46
47
  protected handleAppVisibilityChanged(): Promise<void>;
@@ -74,8 +75,8 @@ export default abstract class LocalTrack extends Track {
74
75
  * @param showProcessedStreamLocally
75
76
  * @returns
76
77
  */
77
- setProcessor(processor: TrackProcessor<this['kind']>, showProcessedStreamLocally?: boolean): Promise<void>;
78
- getProcessor(): TrackProcessor<this["kind"], import("./processor/types").ProcessorOptions<this["kind"]>> | undefined;
78
+ setProcessor(processor: TrackProcessor<TrackKind>, showProcessedStreamLocally?: boolean): Promise<void>;
79
+ getProcessor(): TrackProcessor<TrackKind, any> | undefined;
79
80
  /**
80
81
  * Stops the track processor
81
82
  * See https://github.com/livekit/track-processors-js for example usage
@@ -1 +1 @@
1
- {"version":3,"file":"LocalTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/LocalTrack.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAoC,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,KAAK,EAAgC,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,UAAW,SAAQ,KAAK;IACpD,gBAAgB;IAChB,MAAM,CAAC,EAAE,YAA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kB,IAAI,OAAO,CAO1C;cAEe,0BAA0B;IAY1C,OAAO,CAAC,oBAAoB,CAGxB;IAEJ,OAAO,CAAC,yBAAyB,CAExB;IAET,OAAO,CAAC,sBAAsB,CAG5B;IAEF,OAAO,CAAC,WAAW,CAOjB;IAEF,IAAI;IAUJ;;;;;QAKI;IACE,aAAa;IAwBb,cAAc;IAoBpB;;;;;OAKG;IACG,iBAAiB,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAQ9D;;;;;;;;;OASG;IACG,YAAY,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC,EAAE,0BAA0B,UAAO;IA6C1F,YAAY;IAIZ;;;;;;OAMG;IACG,aAAa;IAanB,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,IAAI;CACzC"}
@@ -18,11 +18,11 @@ export default class LocalTrackPublication extends TrackPublication {
18
18
  /**
19
19
  * Mute the track associated with this publication
20
20
  */
21
- mute(): Promise<LocalTrack | undefined>;
21
+ mute(): Promise<LocalTrack<Track.Kind> | undefined>;
22
22
  /**
23
23
  * Unmute track associated with this publication
24
24
  */
25
- unmute(): Promise<LocalTrack | undefined>;
25
+ unmute(): Promise<LocalTrack<Track.Kind> | undefined>;
26
26
  /**
27
27
  * Pauses the media stream track associated with this publication from being sent to the server
28
28
  * and signals "muted" event to other participants
@@ -14,7 +14,7 @@ export declare class SimulcastTrackInfo {
14
14
  encodings?: RTCRtpEncodingParameters[];
15
15
  constructor(codec: VideoCodec, mediaStreamTrack: MediaStreamTrack);
16
16
  }
17
- export default class LocalVideoTrack extends LocalTrack {
17
+ export default class LocalVideoTrack extends LocalTrack<Track.Kind.Video> {
18
18
  signalClient?: SignalClient;
19
19
  private prevStats?;
20
20
  private encodings?;
@@ -33,8 +33,8 @@ export default class LocalVideoTrack extends LocalTrack {
33
33
  stop(): void;
34
34
  pauseUpstream(): Promise<void>;
35
35
  resumeUpstream(): Promise<void>;
36
- mute(): Promise<LocalVideoTrack>;
37
- unmute(): Promise<LocalVideoTrack>;
36
+ mute(): Promise<typeof this>;
37
+ unmute(): Promise<typeof this>;
38
38
  protected setTrackMuted(muted: boolean): void;
39
39
  getSenderStats(): Promise<VideoSenderStats[]>;
40
40
  setPublishingQuality(maxQuality: VideoQuality): void;
@@ -1 +1 @@
1
- {"version":3,"file":"LocalVideoTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/LocalVideoTrack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAqC,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,qBAAa,kBAAkB;IAC7B,KAAK,EAAE,UAAU,CAAC;IAElB,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,SAAS,CAAC,EAAE,wBAAwB,EAAE,CAAC;gBAE3B,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB;CAIlE;AAID,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IAErD,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,OAAO,CAAC,SAAS,CAAC,CAAgC;IAElD,OAAO,CAAC,SAAS,CAAC,CAA6B;IAG/C,eAAe,EAAE,GAAG,CAAC,UAAU,EAAE,kBAA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CAW5D;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,wBAAwB,EAAE,EACtC,GAAG,CAAC,EAAE,OAAO,GACZ,UAAU,EAAE,CA6Cd"}
@@ -1,8 +1,9 @@
1
1
  import type { AudioReceiverStats } from '../stats';
2
2
  import type { LoggerOptions } from '../types';
3
3
  import RemoteTrack from './RemoteTrack';
4
+ import { Track } from './Track';
4
5
  import type { AudioOutputOptions } from './options';
5
- export default class RemoteAudioTrack extends RemoteTrack {
6
+ export default class RemoteAudioTrack extends RemoteTrack<Track.Kind.Audio> {
6
7
  private prevStats?;
7
8
  private elementVolume;
8
9
  private audioContext?;
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteAudioTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/RemoteAudioTrack.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,OAAO,CAAC,SAAS,CAAC,CAAqB;IAEvC,OAAO,CAAC,aAAa,CAAqB;IAE1C,OAAO,CAAC,YAAY,CAAC,CAAe;IAEpC,OAAO,CAAC,QAAQ,CAAC,CAAW;IAE5B,OAAO,CAAC,UAAU,CAAC,CAA6B;IAEhD,OAAO,CAAC,mBAAmB,CAAc;IAEzC,OAAO,CAAC,MAAM,CAAC,CAAS;gBAGtB,UAAU,EAAE,gBAAgB,EAC5B,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,cAAc,EACzB,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,kBAAkB,EAChC,aAAa,C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CAAC,UAAU,CAAC,CAA6B;IAEhD,OAAO,CAAC,mBAAmB,CAAc;IAEzC,OAAO,CAAC,MAAM,CAAC,CAAS;gBAGtB,UAAU,EAAE,gBAAgB,EAC5B,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,cAAc,EACzB,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,kBAAkB,EAChC,aAAa,CAAC,EAAE,aAAa;IAU/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM;IAexB;;OAEG;IACH,SAAS,IAAI,MAAM;IAiBnB;;;OAGG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM;IAahC,MAAM,IAAI,gBAAgB;IAC1B,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB;IA4BnD;;OAEG;IACH,MAAM,IAAI,gBAAgB,EAAE;IAE5B;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB;IAqBnD;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS;IAStD;;;;OAIG;IACH,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE;IAOrC,OAAO,CAAC,eAAe;IAmCvB,OAAO,CAAC,kBAAkB;IAO1B,SAAS,CAAC,eAAe,sBAYvB;cAEc,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;CAyB5E"}
@@ -1,9 +1,9 @@
1
1
  import type { LoggerOptions } from '../types';
2
2
  import { Track } from './Track';
3
- export default abstract class RemoteTrack extends Track {
3
+ export default abstract class RemoteTrack<TrackKind extends Track.Kind = Track.Kind> extends Track<TrackKind> {
4
4
  /** @internal */
5
5
  receiver?: RTCRtpReceiver;
6
- constructor(mediaTrack: MediaStreamTrack, sid: string, kind: Track.Kind, receiver?: RTCRtpReceiver, loggerOptions?: LoggerOptions);
6
+ constructor(mediaTrack: MediaStreamTrack, sid: string, kind: TrackKind, receiver?: RTCRtpReceiver, loggerOptions?: LoggerOptions);
7
7
  /** @internal */
8
8
  setMuted(muted: boolean): void;
9
9
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/RemoteTrack.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,WAAY,SAAQ,KAAK;IACrD,gBAAgB;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;gBAGxB,UAAU,EAAE,gBAAgB,EAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,QAAQ,CAAC,EAAE,cAAc,EACzB,aAAa,CAAC,EAAE,aAAa;IAQ/B,gBAAgB;IAChB,QAAQ,CAAC,KAAK,EAAE,OAAO;IAQvB,gBAAgB;IAChB,cAAc,CAAC,MAAM,EAAE,WAAW;IAclC,KAAK;IAML,IAAI;IAMJ;;;;;OAKG;IACG,iBAAiB,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAS9D,YAAY;IAMZ,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,IAAI;CAC3C"}
1
+ {"version":3,"file":"RemoteTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/RemoteTrack.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,WAAW,CACvC,SAAS,SAAS,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CACzC,SAAQ,KAAK,CAAC,SAAS,CAAC;IACxB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;gBAGxB,UAAU,EAAE,gBAAgB,EAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,SAAS,EACf,QAAQ,CAAC,EAAE,cAAc,EACzB,aAAa,CAAC,EAAE,aAAa;IAQ/B,gBAAgB;IAChB,QAAQ,CAAC,KAAK,EAAE,OAAO;IAQvB,gBAAgB;IAChB,cAAc,CAAC,MAAM,EAAE,WAAW;IAclC,KAAK;IAML,IAAI;IAMJ;;;;;OAKG;IACG,iBAAiB,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAS9D,YAAY;IAMZ,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,IAAI;CAC3C"}
@@ -1,7 +1,8 @@
1
1
  import type { LoggerOptions } from '../types';
2
2
  import RemoteTrack from './RemoteTrack';
3
+ import { Track } from './Track';
3
4
  import type { AdaptiveStreamSettings } from './types';
4
- export default class RemoteVideoTrack extends RemoteTrack {
5
+ export default class RemoteVideoTrack extends RemoteTrack<Track.Kind.Video> {
5
6
  private prevStats?;
6
7
  private elementInfos;
7
8
  private adaptiveStreamSettings?;
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteVideoTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/RemoteVideoTrack.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAItD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,OAAO,CAAC,SAAS,CAAC,CAAqB;IAEvC,OAAO,CAAC,YAAY,CAAqB;IAEzC,OAAO,CAAC,sBAAsB,CAAC,CAAyB;IAExD,OAAO,CAAC,WAAW,CAAC,CAAU;IAE9B,OAAO,CAAC,cAAc,CAAC,CAAmB;gBAGxC,UAAU,EAAE,gBAAgB,EAC5B,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,cAAc,E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CAEnB;IAEnB,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,eAAe;CAiBxB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,IAAI,MAAM,CAAC;IAChB,MAAM,IAAI,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IAExC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC;IAChB,aAAa,IAAI,IAAI,CAAC;CACvB"}
@@ -10,8 +10,8 @@ export declare enum VideoQuality {
10
10
  HIGH = 2
11
11
  }
12
12
  declare const Track_base: new () => TypedEventEmitter<TrackEventCallbacks>;
13
- export declare abstract class Track extends Track_base {
14
- kind: Track.Kind;
13
+ export declare abstract class Track<TrackKind extends Track.Kind = Track.Kind> extends Track_base {
14
+ readonly kind: TrackKind;
15
15
  attachedElements: HTMLMediaElement[];
16
16
  isMuted: boolean;
17
17
  source: Track.Source;
@@ -36,7 +36,7 @@ export declare abstract class Track extends Track_base {
36
36
  protected _currentBitrate: number;
37
37
  protected monitorInterval?: ReturnType<typeof setInterval>;
38
38
  protected log: StructuredLogger;
39
- protected constructor(mediaTrack: MediaStreamTrack, kind: Track.Kind, loggerOptions?: LoggerOptions);
39
+ protected constructor(mediaTrack: MediaStreamTrack, kind: TrackKind, loggerOptions?: LoggerOptions);
40
40
  protected get logContext(): {
41
41
  [x: string]: unknown;
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Track.d.ts","sourceRoot":"","sources":["../../../../src/room/track/Track.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAA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AC;IACjC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,mBAAmB,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7C,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC3D,sBAAsB,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5E,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,mBAAmB,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,eAAe,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,cAAc,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,eAAe,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACvC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type Room from '../../Room';
1
2
  import type { Track } from '../Track';
2
3
  /**
3
4
  * @experimental
@@ -6,6 +7,7 @@ export type ProcessorOptions<T extends Track.Kind> = {
6
7
  kind: T;
7
8
  track: MediaStreamTrack;
8
9
  element?: HTMLMediaElement;
10
+ audioContext?: AudioContext;
9
11
  };
10
12
  /**
11
13
  * @experimental
@@ -27,5 +29,7 @@ export interface TrackProcessor<T extends Track.Kind, U extends ProcessorOptions
27
29
  restart: (opts: U) => Promise<void>;
28
30
  destroy: () => Promise<void>;
29
31
  processedTrack?: MediaStreamTrack;
32
+ onPublish?: (room: Room) => Promise<void>;
33
+ onUnpublish?: () => Promise<void>;
30
34
  }
31
35
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/room/track/processor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,KAAK,CAAC,IAAI,IAAI;IACnD,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/E,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;CAAG;AAEpF;;GAEG;AACH,MAAM,WAAW,cAAc,CAC7B,CAAC,SAAS,KAAK,CAAC,IAAI,EACpB,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC;IAEnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,cAAc,CAAC,EAAE,gBAAgB,CAAC;CACnC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/room/track/processor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,YAA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OIN_FAILURE = 7,
195
+ /**
196
+ * @generated from enum value: MIGRATION = 8;
197
+ */
198
+ MIGRATION = 8,
199
+ /**
200
+ * @generated from enum value: SIGNAL_CLOSE = 9;
201
+ */
202
+ SIGNAL_CLOSE = 9
195
203
  }
196
204
  /**
197
205
  * @generated from enum livekit.ReconnectReason
@@ -778,6 +778,7 @@ export declare class LeaveRequest extends Message<LeaveRequest> {
778
778
  /**
779
779
  * sent when server initiates the disconnect due to server-restart
780
780
  * indicates clients should attempt full-reconnect sequence
781
+ * NOTE: `can_reconnect` obsoleted by `action` starting in protocol version 13
781
782
  *
782
783
  * @generated from field: bool can_reconnect = 1;
783
784
  */
@@ -786,6 +787,14 @@ export declare class LeaveRequest extends Message<LeaveRequest> {
786
787
  * @generated from field: livekit.DisconnectReason reason = 2;
787
788
  */
788
789
  reason: DisconnectReason;
790
+ /**
791
+ * @generated from field: livekit.LeaveRequest.Action action = 3;
792
+ */
793
+ action: LeaveRequest_Action;
794
+ /**
795
+ * @generated from field: livekit.RegionSettings regions = 4;
796
+ */
797
+ regions?: RegionSettings;
789
798
  constructor(data?: PartialMessage<LeaveRequest>);
790
799
  static readonly runtime: typeof proto3;
791
800
  static readonly typeName = "livekit.LeaveRequest";
@@ -795,6 +804,31 @@ export declare class LeaveRequest extends Message<LeaveRequest> {
795
804
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): LeaveRequest;
796
805
  static equals(a: LeaveRequest | PlainMessage<LeaveRequest> | undefined, b: LeaveRequest | PlainMessage<LeaveRequest> | undefined): boolean;
797
806
  }
807
+ /**
808
+ * indicates action clients should take on receiving this message
809
+ *
810
+ * @generated from enum livekit.LeaveRequest.Action
811
+ */
812
+ export declare enum LeaveRequest_Action {
813
+ /**
814
+ * should disconnect
815
+ *
816
+ * @generated from enum value: DISCONNECT = 0;
817
+ */
818
+ DISCONNECT = 0,
819
+ /**
820
+ * should attempt a resume with `reconnect=1` in join URL
821
+ *
822
+ * @generated from enum value: RESUME = 1;
823
+ */
824
+ RESUME = 1,
825
+ /**
826
+ * should attempt a reconnect, i. e. no `reconnect=1`
827
+ *
828
+ * @generated from enum value: RECONNECT = 2;
829
+ */
830
+ RECONNECT = 2
831
+ }
798
832
  /**
799
833
  * message to indicate published video track dimensions are changing
800
834
  *
@@ -1154,6 +1188,10 @@ export declare class SyncState extends Message<SyncState> {
1154
1188
  * @generated from field: livekit.SessionDescription offer = 5;
1155
1189
  */
1156
1190
  offer?: SessionDescription;
1191
+ /**
1192
+ * @generated from field: repeated string track_sids_disabled = 6;
1193
+ */
1194
+ trackSidsDisabled: string[];
1157
1195
  constructor(data?: PartialMessage<SyncState>);
1158
1196
  static readonly runtime: typeof proto3;
1159
1197
  static readonly typeName = "livekit.SyncState";
@@ -18,7 +18,6 @@ export default class PCTransport extends EventEmitter {
18
18
  private _pc;
19
19
  private get pc();
20
20
  private config?;
21
- private mediaConstraints;
22
21
  private log;
23
22
  private loggerOptions;
24
23
  pendingCandidates: RTCIceCandidateInit[];
@@ -35,7 +34,7 @@ export default class PCTransport extends EventEmitter {
35
34
  onSignalingStatechange?: (state: RTCSignalingState) => void;
36
35
  onDataChannel?: (ev: RTCDataChannelEvent) => void;
37
36
  onTrack?: (ev: RTCTrackEvent) => void;
38
- constructor(config?: RTCConfiguration, mediaConstraints?: Record<string, unknown>, loggerOptions?: LoggerOptions);
37
+ constructor(config?: RTCConfiguration, loggerOptions?: LoggerOptions);
39
38
  private createPC;
40
39
  private get logContext();
41
40
  get isICEConnected(): boolean;
@@ -23,7 +23,14 @@ export declare enum RoomEvent {
23
23
  Reconnected = "reconnected",
24
24
  /**
25
25
  * When disconnected from room. This fires when room.disconnect() is called or
26
- * when an unrecoverable connection issue had occured
26
+ * when an unrecoverable connection issue had occured.
27
+ *
28
+ * DisconnectReason can be used to determine why the participant was disconnected. Notable reasons are
29
+ * - DUPLICATE_IDENTITY: another client with the same identity has joined the room
30
+ * - PARTICIPANT_REMOVED: participant was removed by RemoveParticipant API
31
+ * - ROOM_DELETED: the room has ended via DeleteRoom API
32
+ *
33
+ * args: ([[DisconnectReason]])
27
34
  */
28
35
  Disconnected = "disconnected",
29
36
  /**
@@ -1,13 +1,14 @@
1
1
  import type { AudioSenderStats } from '../stats';
2
2
  import type { LoggerOptions } from '../types';
3
3
  import LocalTrack from './LocalTrack';
4
+ import { Track } from './Track';
4
5
  import type { AudioCaptureOptions } from './options';
5
- import type { TrackProcessor } from './processor/types';
6
- export default class LocalAudioTrack extends LocalTrack {
6
+ import type { AudioProcessorOptions, TrackProcessor } from './processor/types';
7
+ export default class LocalAudioTrack extends LocalTrack<Track.Kind.Audio> {
7
8
  /** @internal */
8
9
  stopOnMute: boolean;
9
- private audioContext?;
10
10
  private prevStats?;
11
+ protected processor?: TrackProcessor<Track.Kind.Audio, AudioProcessorOptions> | undefined;
11
12
  /**
12
13
  *
13
14
  * @param mediaTrack
@@ -16,13 +17,13 @@ export default class LocalAudioTrack extends LocalTrack {
16
17
  */
17
18
  constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, audioContext?: AudioContext, loggerOptions?: LoggerOptions);
18
19
  setDeviceId(deviceId: ConstrainDOMString): Promise<boolean>;
19
- mute(): Promise<LocalAudioTrack>;
20
- unmute(): Promise<LocalAudioTrack>;
20
+ mute(): Promise<typeof this>;
21
+ unmute(): Promise<typeof this>;
21
22
  restartTrack(options?: AudioCaptureOptions): Promise<void>;
22
- protected restart(constraints?: MediaTrackConstraints): Promise<LocalTrack>;
23
+ protected restart(constraints?: MediaTrackConstraints): Promise<typeof this>;
23
24
  startMonitor(): void;
24
25
  protected monitorSender: () => Promise<void>;
25
- setProcessor(processor: TrackProcessor<this['kind']>): Promise<void>;
26
+ setProcessor(processor: TrackProcessor<Track.Kind.Audio, AudioProcessorOptions>): Promise<void>;
26
27
  /**
27
28
  * @internal
28
29
  * @experimental
@@ -3,7 +3,7 @@ import { Mutex } from '../utils';
3
3
  import { Track } from './Track';
4
4
  import type { VideoCodec } from './options';
5
5
  import type { TrackProcessor } from './processor/types';
6
- export default abstract class LocalTrack extends Track {
6
+ export default abstract class LocalTrack<TrackKind extends Track.Kind = Track.Kind> extends Track<TrackKind> {
7
7
  /** @internal */
8
8
  sender?: RTCRtpSender;
9
9
  /** @internal */
@@ -15,8 +15,9 @@ export default abstract class LocalTrack extends Track {
15
15
  protected muteLock: Mutex;
16
16
  protected pauseUpstreamLock: Mutex;
17
17
  protected processorElement?: HTMLMediaElement;
18
- protected processor?: TrackProcessor<this['kind']>;
18
+ protected processor?: TrackProcessor<TrackKind, any>;
19
19
  protected processorLock: Mutex;
20
+ protected audioContext?: AudioContext;
20
21
  /**
21
22
  *
22
23
  * @param mediaTrack
@@ -24,7 +25,7 @@ export default abstract class LocalTrack extends Track {
24
25
  * @param constraints MediaTrackConstraints that are being used when restarting or reacquiring tracks
25
26
  * @param userProvidedTrack Signals to the SDK whether or not the mediaTrack should be managed (i.e. released and reacquired) internally by the SDK
26
27
  */
27
- protected constructor(mediaTrack: MediaStreamTrack, kind: Track.Kind, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, loggerOptions?: LoggerOptions);
28
+ protected constructor(mediaTrack: MediaStreamTrack, kind: TrackKind, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, loggerOptions?: LoggerOptions);
28
29
  get id(): string;
29
30
  get dimensions(): Track.Dimensions | undefined;
30
31
  private _isUpstreamPaused;
@@ -37,10 +38,10 @@ export default abstract class LocalTrack extends Track {
37
38
  * @returns DeviceID of the device that is currently being used for this track
38
39
  */
39
40
  getDeviceId(): Promise<string | undefined>;
40
- mute(): Promise<LocalTrack>;
41
- unmute(): Promise<LocalTrack>;
42
- replaceTrack(track: MediaStreamTrack, userProvidedTrack?: boolean): Promise<LocalTrack>;
43
- protected restart(constraints?: MediaTrackConstraints): Promise<LocalTrack>;
41
+ mute(): Promise<this>;
42
+ unmute(): Promise<this>;
43
+ replaceTrack(track: MediaStreamTrack, userProvidedTrack?: boolean): Promise<this>;
44
+ protected restart(constraints?: MediaTrackConstraints): Promise<this>;
44
45
  protected setTrackMuted(muted: boolean): void;
45
46
  protected get needsReAcquisition(): boolean;
46
47
  protected handleAppVisibilityChanged(): Promise<void>;
@@ -74,8 +75,8 @@ export default abstract class LocalTrack extends Track {
74
75
  * @param showProcessedStreamLocally
75
76
  * @returns
76
77
  */
77
- setProcessor(processor: TrackProcessor<this['kind']>, showProcessedStreamLocally?: boolean): Promise<void>;
78
- getProcessor(): TrackProcessor<this["kind"], import("./processor/types").ProcessorOptions<this["kind"]>> | undefined;
78
+ setProcessor(processor: TrackProcessor<TrackKind>, showProcessedStreamLocally?: boolean): Promise<void>;
79
+ getProcessor(): TrackProcessor<TrackKind, any> | undefined;
79
80
  /**
80
81
  * Stops the track processor
81
82
  * See https://github.com/livekit/track-processors-js for example usage
@@ -18,11 +18,11 @@ export default class LocalTrackPublication extends TrackPublication {
18
18
  /**
19
19
  * Mute the track associated with this publication
20
20
  */
21
- mute(): Promise<LocalTrack | undefined>;
21
+ mute(): Promise<LocalTrack<Track.Kind> | undefined>;
22
22
  /**
23
23
  * Unmute track associated with this publication
24
24
  */
25
- unmute(): Promise<LocalTrack | undefined>;
25
+ unmute(): Promise<LocalTrack<Track.Kind> | undefined>;
26
26
  /**
27
27
  * Pauses the media stream track associated with this publication from being sent to the server
28
28
  * and signals "muted" event to other participants
@@ -14,7 +14,7 @@ export declare class SimulcastTrackInfo {
14
14
  encodings?: RTCRtpEncodingParameters[];
15
15
  constructor(codec: VideoCodec, mediaStreamTrack: MediaStreamTrack);
16
16
  }
17
- export default class LocalVideoTrack extends LocalTrack {
17
+ export default class LocalVideoTrack extends LocalTrack<Track.Kind.Video> {
18
18
  signalClient?: SignalClient;
19
19
  private prevStats?;
20
20
  private encodings?;
@@ -33,8 +33,8 @@ export default class LocalVideoTrack extends LocalTrack {
33
33
  stop(): void;
34
34
  pauseUpstream(): Promise<void>;
35
35
  resumeUpstream(): Promise<void>;
36
- mute(): Promise<LocalVideoTrack>;
37
- unmute(): Promise<LocalVideoTrack>;
36
+ mute(): Promise<typeof this>;
37
+ unmute(): Promise<typeof this>;
38
38
  protected setTrackMuted(muted: boolean): void;
39
39
  getSenderStats(): Promise<VideoSenderStats[]>;
40
40
  setPublishingQuality(maxQuality: VideoQuality): void;
@@ -1,8 +1,9 @@
1
1
  import type { AudioReceiverStats } from '../stats';
2
2
  import type { LoggerOptions } from '../types';
3
3
  import RemoteTrack from './RemoteTrack';
4
+ import { Track } from './Track';
4
5
  import type { AudioOutputOptions } from './options';
5
- export default class RemoteAudioTrack extends RemoteTrack {
6
+ export default class RemoteAudioTrack extends RemoteTrack<Track.Kind.Audio> {
6
7
  private prevStats?;
7
8
  private elementVolume;
8
9
  private audioContext?;
@@ -1,9 +1,9 @@
1
1
  import type { LoggerOptions } from '../types';
2
2
  import { Track } from './Track';
3
- export default abstract class RemoteTrack extends Track {
3
+ export default abstract class RemoteTrack<TrackKind extends Track.Kind = Track.Kind> extends Track<TrackKind> {
4
4
  /** @internal */
5
5
  receiver?: RTCRtpReceiver;
6
- constructor(mediaTrack: MediaStreamTrack, sid: string, kind: Track.Kind, receiver?: RTCRtpReceiver, loggerOptions?: LoggerOptions);
6
+ constructor(mediaTrack: MediaStreamTrack, sid: string, kind: TrackKind, receiver?: RTCRtpReceiver, loggerOptions?: LoggerOptions);
7
7
  /** @internal */
8
8
  setMuted(muted: boolean): void;
9
9
  /** @internal */
@@ -1,7 +1,8 @@
1
1
  import type { LoggerOptions } from '../types';
2
2
  import RemoteTrack from './RemoteTrack';
3
+ import { Track } from './Track';
3
4
  import type { AdaptiveStreamSettings } from './types';
4
- export default class RemoteVideoTrack extends RemoteTrack {
5
+ export default class RemoteVideoTrack extends RemoteTrack<Track.Kind.Video> {
5
6
  private prevStats?;
6
7
  private elementInfos;
7
8
  private adaptiveStreamSettings?;
@@ -10,8 +10,8 @@ export declare enum VideoQuality {
10
10
  HIGH = 2
11
11
  }
12
12
  declare const Track_base: new () => TypedEventEmitter<TrackEventCallbacks>;
13
- export declare abstract class Track extends Track_base {
14
- kind: Track.Kind;
13
+ export declare abstract class Track<TrackKind extends Track.Kind = Track.Kind> extends Track_base {
14
+ readonly kind: TrackKind;
15
15
  attachedElements: HTMLMediaElement[];
16
16
  isMuted: boolean;
17
17
  source: Track.Source;
@@ -36,7 +36,7 @@ export declare abstract class Track extends Track_base {
36
36
  protected _currentBitrate: number;
37
37
  protected monitorInterval?: ReturnType<typeof setInterval>;
38
38
  protected log: StructuredLogger;
39
- protected constructor(mediaTrack: MediaStreamTrack, kind: Track.Kind, loggerOptions?: LoggerOptions);
39
+ protected constructor(mediaTrack: MediaStreamTrack, kind: TrackKind, loggerOptions?: LoggerOptions);
40
40
  protected get logContext(): {
41
41
  [x: string]: unknown;
42
42
  };
@@ -1,3 +1,4 @@
1
+ import type Room from '../../Room';
1
2
  import type { Track } from '../Track';
2
3
  /**
3
4
  * @experimental
@@ -6,6 +7,7 @@ export type ProcessorOptions<T extends Track.Kind> = {
6
7
  kind: T;
7
8
  track: MediaStreamTrack;
8
9
  element?: HTMLMediaElement;
10
+ audioContext?: AudioContext;
9
11
  };
10
12
  /**
11
13
  * @experimental
@@ -27,5 +29,7 @@ export interface TrackProcessor<T extends Track.Kind, U extends ProcessorOptions
27
29
  restart: (opts: U) => Promise<void>;
28
30
  destroy: () => Promise<void>;
29
31
  processedTrack?: MediaStreamTrack;
32
+ onPublish?: (room: Room) => Promise<void>;
33
+ onUnpublish?: () => Promise<void>;
30
34
  }
31
35
  //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "livekit-client",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
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",
@@ -71,7 +71,7 @@
71
71
  "eslint-plugin-ecmascript-compat": "^3.0.0",
72
72
  "eslint-plugin-import": "2.29.1",
73
73
  "gh-pages": "6.1.1",
74
- "jsdom": "^23.0.0",
74
+ "jsdom": "^24.0.0",
75
75
  "prettier": "^3.0.0",
76
76
  "rollup": "4.9.6",
77
77
  "rollup-plugin-delete": "^2.0.0",
@@ -317,7 +317,7 @@ export class SignalClient {
317
317
  let resp: SignalResponse;
318
318
  if (typeof ev.data === 'string') {
319
319
  const json = JSON.parse(ev.data);
320
- resp = SignalResponse.fromJson(json);
320
+ resp = SignalResponse.fromJson(json, { ignoreUnknownFields: true });
321
321
  } else if (ev.data instanceof ArrayBuffer) {
322
322
  resp = SignalResponse.fromBinary(new Uint8Array(ev.data));
323
323
  } else {