livekit-client 1.11.0 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,8 +50,8 @@ export default abstract class LocalTrack extends Track {
50
50
  * the server.
51
51
  * this API is unsupported on Safari < 12 due to a bug
52
52
  **/
53
- pauseUpstream(): Promise<void>;
54
- resumeUpstream(): Promise<void>;
53
+ pauseUpstream: () => Promise<void>;
54
+ resumeUpstream: () => Promise<void>;
55
55
  /**
56
56
  * Sets a processor on this track.
57
57
  * 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,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,YAAY,CAAC;IAEtB,gBAAgB;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,SAAS,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAE7C,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC;IAElC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC;IAElC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC;IAE1B,SAAS,CAAC,iBAAiB,EAAE,KAAK,CAAC;IAEnC,SAAS,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAE9C,SAAS,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;IAEvD,SAAS,CAAC,oBAAoB,EAAE,OAAO,CAAS;IAEhD;;;;;;OAMG;IACH,SAAS,aACP,UAA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AAC;IAgBtF;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAW1C,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAK3B,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC;IAK7B,YAAY,CAAC,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,UAAO,GAAG,OAAO,CAAC,UAAU,CAAC;cAiB1E,OAAO,CAAC,WAAW,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC;IAgDjF,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO;IAYtC,SAAS,KAAK,kBAAkB,IAAI,OAAO,CAO1C;cAEe,0BAA0B;IAY1C,OAAO,CAAC,WAAW,CAOjB;IAEF,IAAI;IAUJ;;;;;QAKI;IACJ,aAAa,sBAsBX;IAEF,cAAc,sBAkBZ;IAEF;;;;;;;;;OASG;IACG,YAAY,CAChB,SAAS,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,EAC3C,0BAA0B,UAAO;IAwCnC,YAAY;IAIZ;;;;;;OAMG;IACG,aAAa;IAanB,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,IAAI;CACzC"}
@@ -50,8 +50,8 @@ export default abstract class LocalTrack extends Track {
50
50
  * the server.
51
51
  * this API is unsupported on Safari < 12 due to a bug
52
52
  **/
53
- pauseUpstream(): Promise<void>;
54
- resumeUpstream(): Promise<void>;
53
+ pauseUpstream: () => Promise<void>;
54
+ resumeUpstream: () => Promise<void>;
55
55
  /**
56
56
  * Sets a processor on this track.
57
57
  * See https://github.com/livekit/track-processors-js for example usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "livekit-client",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
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",
@@ -117,10 +117,7 @@ export default abstract class LocalTrack extends Track {
117
117
  // the track is "muted"
118
118
  // note this is different from LocalTrack.mute because we do not want to
119
119
  // touch MediaStreamTrack.enabled
120
- newTrack.addEventListener('mute', () => {
121
- log.info('pausing upstream due to device mute');
122
- this.pauseUpstream();
123
- });
120
+ newTrack.addEventListener('mute', this.pauseUpstream);
124
121
  newTrack.addEventListener('unmute', this.resumeUpstream);
125
122
  this.constraints = newTrack.getConstraints();
126
123
  }
@@ -281,11 +278,17 @@ export default abstract class LocalTrack extends Track {
281
278
  if (this.isInBackground) {
282
279
  this.reacquireTrack = true;
283
280
  }
281
+ this._mediaStreamTrack.removeEventListener('mute', this.pauseUpstream);
282
+ this._mediaStreamTrack.removeEventListener('unmute', this.resumeUpstream);
284
283
  this.emit(TrackEvent.Ended, this);
285
284
  };
286
285
 
287
286
  stop() {
288
287
  super.stop();
288
+
289
+ this._mediaStreamTrack.removeEventListener('ended', this.handleEnded);
290
+ this._mediaStreamTrack.removeEventListener('mute', this.pauseUpstream);
291
+ this._mediaStreamTrack.removeEventListener('unmute', this.resumeUpstream);
289
292
  this.processor?.destroy();
290
293
  this.processor = undefined;
291
294
  }
@@ -296,7 +299,7 @@ export default abstract class LocalTrack extends Track {
296
299
  * the server.
297
300
  * this API is unsupported on Safari < 12 due to a bug
298
301
  **/
299
- async pauseUpstream() {
302
+ pauseUpstream = async () => {
300
303
  const unlock = await this.pauseUpstreamLock.lock();
301
304
  try {
302
305
  if (this._isUpstreamPaused === true) {
@@ -318,9 +321,9 @@ export default abstract class LocalTrack extends Track {
318
321
  } finally {
319
322
  unlock();
320
323
  }
321
- }
324
+ };
322
325
 
323
- async resumeUpstream() {
326
+ resumeUpstream = async () => {
324
327
  const unlock = await this.pauseUpstreamLock.lock();
325
328
  try {
326
329
  if (this._isUpstreamPaused === false) {
@@ -338,7 +341,7 @@ export default abstract class LocalTrack extends Track {
338
341
  } finally {
339
342
  unlock();
340
343
  }
341
- }
344
+ };
342
345
 
343
346
  /**
344
347
  * Sets a processor on this track.