livekit-client 1.1.5 → 1.1.6

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.
@@ -10070,7 +10070,7 @@ function computeBitrate(currentStats, prevStats) {
10070
10070
  return (bytesNow - bytesPrev) * 8 * 1000 / (currentStats.timestamp - prevStats.timestamp);
10071
10071
  }
10072
10072
 
10073
- var version$1 = "1.1.5";
10073
+ var version$1 = "1.1.6";
10074
10074
 
10075
10075
  const version = version$1;
10076
10076
  const protocolVersion = 8;
@@ -13224,6 +13224,7 @@ class RemoteTrackPublication extends TrackPublication {
13224
13224
 
13225
13225
  this.handleEnded = track => {
13226
13226
  this.emit(TrackEvent.Ended, track);
13227
+ this.setTrack(undefined);
13227
13228
  };
13228
13229
 
13229
13230
  this.handleVisibilityChange = visible => {
@@ -13351,6 +13352,8 @@ class RemoteTrackPublication extends TrackPublication {
13351
13352
  get videoQuality() {
13352
13353
  return this.currentVideoQuality;
13353
13354
  }
13355
+ /** @internal */
13356
+
13354
13357
 
13355
13358
  setTrack(track) {
13356
13359
  if (this.track) {
@@ -13556,7 +13559,9 @@ class RemoteParticipant extends Participant {
13556
13559
  track.isMuted = publication.isMuted;
13557
13560
  track.setMediaStream(mediaStream);
13558
13561
  track.start();
13559
- publication.setTrack(track); // set participant volume on new microphone tracks
13562
+ publication.setTrack(track); // subscription means participant has permissions to subscribe
13563
+
13564
+ publication._allowed = true; // set participant volume on new microphone tracks
13560
13565
 
13561
13566
  if (this.volume !== undefined && track instanceof RemoteAudioTrack && track.source === Track.Source.Microphone) {
13562
13567
  track.setVolume(this.volume);
@@ -14604,57 +14609,6 @@ class LocalParticipant extends Participant {
14604
14609
 
14605
14610
  }
14606
14611
 
14607
- class Queue {
14608
- constructor() {
14609
- this.queue = [];
14610
- this.running = false;
14611
- }
14612
-
14613
- enqueue(cb) {
14614
- livekitLogger.trace('enqueuing request to fire later');
14615
- this.queue.push(cb);
14616
- }
14617
-
14618
- dequeue() {
14619
- const evt = this.queue.shift();
14620
- if (evt) evt();
14621
- livekitLogger.trace('firing request from queue');
14622
- }
14623
-
14624
- async run() {
14625
- if (this.running) return;
14626
- livekitLogger.trace('start queue');
14627
- this.running = true;
14628
-
14629
- while (this.running && this.queue.length > 0) {
14630
- this.dequeue();
14631
- }
14632
-
14633
- this.running = false;
14634
- livekitLogger.trace('queue finished');
14635
- }
14636
-
14637
- pause() {
14638
- livekitLogger.trace('pausing queue');
14639
- this.running = false;
14640
- }
14641
-
14642
- reset() {
14643
- livekitLogger.trace('resetting queue');
14644
- this.running = false;
14645
- this.queue = [];
14646
- }
14647
-
14648
- isRunning() {
14649
- return this.running;
14650
- }
14651
-
14652
- isEmpty() {
14653
- return this.queue.length === 0;
14654
- }
14655
-
14656
- }
14657
-
14658
14612
  /*
14659
14613
  * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
14660
14614
  *
@@ -18140,6 +18094,57 @@ adapterFactory({
18140
18094
  window: typeof window === 'undefined' ? undefined : window
18141
18095
  });
18142
18096
 
18097
+ class Queue {
18098
+ constructor() {
18099
+ this.queue = [];
18100
+ this.running = false;
18101
+ }
18102
+
18103
+ enqueue(cb) {
18104
+ livekitLogger.trace('enqueuing request to fire later');
18105
+ this.queue.push(cb);
18106
+ }
18107
+
18108
+ dequeue() {
18109
+ const evt = this.queue.shift();
18110
+ if (evt) evt();
18111
+ livekitLogger.trace('firing request from queue');
18112
+ }
18113
+
18114
+ async run() {
18115
+ if (this.running) return;
18116
+ livekitLogger.trace('start queue');
18117
+ this.running = true;
18118
+
18119
+ while (this.running && this.queue.length > 0) {
18120
+ this.dequeue();
18121
+ }
18122
+
18123
+ this.running = false;
18124
+ livekitLogger.trace('queue finished');
18125
+ }
18126
+
18127
+ pause() {
18128
+ livekitLogger.trace('pausing queue');
18129
+ this.running = false;
18130
+ }
18131
+
18132
+ reset() {
18133
+ livekitLogger.trace('resetting queue');
18134
+ this.running = false;
18135
+ this.queue = [];
18136
+ }
18137
+
18138
+ isRunning() {
18139
+ return this.running;
18140
+ }
18141
+
18142
+ isEmpty() {
18143
+ return this.queue.length === 0;
18144
+ }
18145
+
18146
+ }
18147
+
18143
18148
  const passThroughQueueSignals = ['syncState', 'trickle', 'offer', 'answer', 'simulate', 'leave'];
18144
18149
 
18145
18150
  function canPassThroughQueue(req) {
@@ -19763,7 +19768,7 @@ class Room extends events.exports.EventEmitter {
19763
19768
 
19764
19769
  pub.track.streamState = Track.streamStateFromProto(streamState.state);
19765
19770
  participant.emit(ParticipantEvent.TrackStreamStateChanged, pub, pub.track.streamState);
19766
- this.emitWhenConnected(ParticipantEvent.TrackStreamStateChanged, pub, pub.track.streamState, participant);
19771
+ this.emitWhenConnected(RoomEvent.TrackStreamStateChanged, pub, pub.track.streamState, participant);
19767
19772
  });
19768
19773
  };
19769
19774
 
@@ -19782,7 +19787,7 @@ class Room extends events.exports.EventEmitter {
19782
19787
 
19783
19788
  pub._allowed = update.allowed;
19784
19789
  participant.emit(ParticipantEvent.TrackSubscriptionPermissionChanged, pub, pub.subscriptionStatus);
19785
- this.emitWhenConnected(ParticipantEvent.TrackSubscriptionPermissionChanged, pub, pub.subscriptionStatus, participant);
19790
+ this.emitWhenConnected(RoomEvent.TrackSubscriptionPermissionChanged, pub, pub.subscriptionStatus, participant);
19786
19791
  };
19787
19792
 
19788
19793
  this.handleDataPacket = (userPacket, kind) => {