livekit-client 1.14.0 → 1.14.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -11863,10 +11863,10 @@ function getMatch(exp, ua) {
11863
11863
  return match && match.length >= id && match[id] || '';
11864
11864
  }
11865
11865
 
11866
- var version$1 = "1.14.0";
11866
+ var version$1 = "1.14.1";
11867
11867
 
11868
11868
  const version = version$1;
11869
- const protocolVersion = 9;
11869
+ const protocolVersion = 10;
11870
11870
 
11871
11871
  class VideoPreset {
11872
11872
  constructor(width, height, maxBitrate, maxFramerate, priority) {
@@ -12962,6 +12962,9 @@ function supportsAV1() {
12962
12962
  }
12963
12963
  function supportsVP9() {
12964
12964
  if (!('getCapabilities' in RTCRtpSender)) {
12965
+ return false;
12966
+ }
12967
+ if (isFireFox()) {
12965
12968
  // technically speaking FireFox supports VP9, but SVC publishing is broken
12966
12969
  // https://bugzilla.mozilla.org/show_bug.cgi?id=1633876
12967
12970
  return false;
@@ -18433,14 +18436,16 @@ class RemoteTrack extends Track {
18433
18436
  /** @internal */
18434
18437
  setMediaStream(stream) {
18435
18438
  // this is needed to determine when the track is finished
18436
- // we send each track down in its own MediaStream, so we can assume the
18437
- // current track is the only one that can be removed.
18438
18439
  this.mediaStream = stream;
18439
- stream.onremovetrack = () => {
18440
- this.receiver = undefined;
18441
- this._currentBitrate = 0;
18442
- this.emit(TrackEvent.Ended, this);
18440
+ const onRemoveTrack = event => {
18441
+ if (event.track === this._mediaStreamTrack) {
18442
+ stream.removeEventListener('removetrack', onRemoveTrack);
18443
+ this.receiver = undefined;
18444
+ this._currentBitrate = 0;
18445
+ this.emit(TrackEvent.Ended, this);
18446
+ }
18443
18447
  };
18448
+ stream.addEventListener('removetrack', onRemoveTrack);
18444
18449
  }
18445
18450
  start() {
18446
18451
  this.startMonitor();
@@ -20472,7 +20477,8 @@ class LocalParticipant extends Participant {
20472
20477
  disableDtx: !((_a = opts.dtx) !== null && _a !== void 0 ? _a : true),
20473
20478
  encryption: this.encryptionType,
20474
20479
  stereo: isStereo,
20475
- disableRed: this.isE2EEEnabled || !((_b = opts.red) !== null && _b !== void 0 ? _b : true)
20480
+ disableRed: this.isE2EEEnabled || !((_b = opts.red) !== null && _b !== void 0 ? _b : true),
20481
+ stream: opts === null || opts === void 0 ? void 0 : opts.stream
20476
20482
  });
20477
20483
  // compute encodings and layers for video
20478
20484
  let encodings;
@@ -21962,8 +21968,11 @@ class Room extends eventsExports.EventEmitter {
21962
21968
  }
21963
21969
  const parts = unpackStreamId(stream.id);
21964
21970
  const participantId = parts[0];
21965
- let trackId = parts[1];
21966
- if (!trackId || trackId === '') trackId = mediaTrack.id;
21971
+ let streamId = parts[1];
21972
+ let trackId = mediaTrack.id;
21973
+ // firefox will get streamId (pID|trackId) instead of (pID|streamId) as it doesn't support sync tracks by stream
21974
+ // and generates its own track id instead of infer from sdp track id.
21975
+ if (streamId && streamId.startsWith('TR')) trackId = streamId;
21967
21976
  if (participantId === this.localParticipant.sid) {
21968
21977
  livekitLogger.warn('tried to create RemoteParticipant for local participant');
21969
21978
  return;