livekit-client 0.18.2 → 0.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ export default class RTCEngine extends RTCEngine_base {
17
17
  private reliableDCSub?;
18
18
  private subscriberPrimary;
19
19
  private primaryPC?;
20
- private pcConnected;
20
+ private pcState;
21
21
  private isClosed;
22
22
  private pendingTrackResolvers;
23
23
  private hasPublished;
@@ -376,5 +376,15 @@ export declare enum TrackEvent {
376
376
  /** @internal */
377
377
  ElementAttached = "elementAttached",
378
378
  /** @internal */
379
- ElementDetached = "elementDetached"
379
+ ElementDetached = "elementDetached",
380
+ /**
381
+ * @internal
382
+ * Only fires on LocalTracks
383
+ */
384
+ UpstreamPaused = "upstreamPaused",
385
+ /**
386
+ * @internal
387
+ * Only fires on LocalTracks
388
+ */
389
+ UpstreamResumed = "upstreamResumed"
380
390
  }
@@ -111,6 +111,8 @@ export default class LocalParticipant extends Participant {
111
111
  private onTrackUnmuted;
112
112
  /** @internal */
113
113
  private onTrackMuted;
114
+ private onTrackUpstreamPaused;
115
+ private onTrackUpstreamResumed;
114
116
  private handleSubscribedQualityUpdate;
115
117
  private handleLocalTrackUnpublished;
116
118
  private onTrackUnpublish;
@@ -8,15 +8,20 @@ export default class LocalTrack extends Track {
8
8
  protected constructor(mediaTrack: MediaStreamTrack, kind: Track.Kind, constraints?: MediaTrackConstraints);
9
9
  get id(): string;
10
10
  get dimensions(): Track.Dimensions | undefined;
11
+ private _isUpstreamPaused;
12
+ get isUpstreamPaused(): boolean;
11
13
  /**
12
14
  * @returns DeviceID of the device that is currently being used for this track
13
15
  */
14
16
  getDeviceId(): Promise<string | undefined>;
15
17
  mute(): Promise<LocalTrack>;
16
18
  unmute(): Promise<LocalTrack>;
19
+ replaceTrack(track: MediaStreamTrack): Promise<LocalTrack>;
17
20
  protected restart(constraints?: MediaTrackConstraints): Promise<LocalTrack>;
18
21
  protected setTrackMuted(muted: boolean): void;
19
22
  protected get needsReAcquisition(): boolean;
20
23
  protected handleAppVisibilityChanged(): Promise<void>;
21
24
  private handleEnded;
25
+ pauseUpstream(): Promise<void>;
26
+ resumeUpstream(): Promise<void>;
22
27
  }
@@ -8,6 +8,7 @@ import { TrackPublication } from './TrackPublication';
8
8
  export default class LocalTrackPublication extends TrackPublication {
9
9
  track?: LocalTrack;
10
10
  options?: TrackPublishOptions;
11
+ get isUpstreamPaused(): boolean | undefined;
11
12
  constructor(kind: Track.Kind, ti: TrackInfo, track?: LocalTrack);
12
13
  setTrack(track?: Track): void;
13
14
  get isMuted(): boolean;
@@ -21,5 +22,16 @@ export default class LocalTrackPublication extends TrackPublication {
21
22
  * Unmute track associated with this publication
22
23
  */
23
24
  unmute(): Promise<LocalTrack | undefined>;
24
- handleTrackEnded: (track: LocalTrack) => void;
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;
25
37
  }
@@ -94,5 +94,7 @@ export declare type TrackEventCallbacks = {
94
94
  videoDimensionsChanged: (dimensions: Track.Dimensions, track?: any) => void;
95
95
  elementAttached: (element: HTMLMediaElement) => void;
96
96
  elementDetached: (element: HTMLMediaElement) => void;
97
+ upstreamPaused: (track: any) => void;
98
+ upstreamResumed: (track: any) => void;
97
99
  };
98
100
  export {};
@@ -12,3 +12,4 @@ export interface ObservableMediaElement extends HTMLMediaElement {
12
12
  handleVisibilityChanged: (entry: IntersectionObserverEntry) => void;
13
13
  }
14
14
  export declare function getClientInfo(): ClientInfo;
15
+ export declare function getEmptyMediaStreamTrack(): MediaStreamTrack;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "livekit-client",
3
- "version": "0.18.2",
3
+ "version": "0.18.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",
7
7
  "module": "./dist/livekit-client.esm.js",
8
+ "type": "module",
8
9
  "exports": {
9
10
  ".": {
10
11
  "import": "./dist/livekit-client.esm.js",