livekit-client 1.13.4 → 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.13.4";
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) {
@@ -12168,7 +12168,7 @@ var RoomEvent;
12168
12168
  /**
12169
12169
  * LiveKit will attempt to autoplay all audio tracks when you attach them to
12170
12170
  * audio elements. However, if that fails, we'll notify you via AudioPlaybackStatusChanged.
12171
- * `Room.canPlayAudio` will indicate if audio playback is permitted.
12171
+ * `Room.canPlaybackAudio` will indicate if audio playback is permitted.
12172
12172
  */
12173
12173
  RoomEvent["AudioPlaybackStatusChanged"] = "audioPlaybackChanged";
12174
12174
  /**
@@ -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();
@@ -20300,9 +20305,6 @@ class LocalParticipant extends Participant {
20300
20305
  if (options === undefined) {
20301
20306
  options = {};
20302
20307
  }
20303
- if (options.resolution === undefined) {
20304
- options.resolution = ScreenSharePresets.h1080fps15.resolution;
20305
- }
20306
20308
  if (navigator.mediaDevices.getDisplayMedia === undefined) {
20307
20309
  throw new DeviceUnsupportedError('getDisplayMedia not supported');
20308
20310
  }
@@ -20475,7 +20477,8 @@ class LocalParticipant extends Participant {
20475
20477
  disableDtx: !((_a = opts.dtx) !== null && _a !== void 0 ? _a : true),
20476
20478
  encryption: this.encryptionType,
20477
20479
  stereo: isStereo,
20478
- 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
20479
20482
  });
20480
20483
  // compute encodings and layers for video
20481
20484
  let encodings;
@@ -20504,6 +20507,10 @@ class LocalParticipant extends Participant {
20504
20507
  // for svc codecs, disable simulcast and use vp8 for backup codec
20505
20508
  if (track instanceof LocalVideoTrack) {
20506
20509
  if (isSVCCodec(opts.videoCodec)) {
20510
+ // vp9 svc with screenshare has problem to encode, always use L1T3 here
20511
+ if (track.source === Track.Source.ScreenShare && opts.videoCodec === 'vp9') {
20512
+ opts.scalabilityMode = 'L1T3';
20513
+ }
20507
20514
  // set scalabilityMode to 'L3T3_KEY' by default
20508
20515
  opts.scalabilityMode = (_e = opts.scalabilityMode) !== null && _e !== void 0 ? _e : 'L3T3_KEY';
20509
20516
  }
@@ -21961,8 +21968,11 @@ class Room extends eventsExports.EventEmitter {
21961
21968
  }
21962
21969
  const parts = unpackStreamId(stream.id);
21963
21970
  const participantId = parts[0];
21964
- let trackId = parts[1];
21965
- 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;
21966
21976
  if (participantId === this.localParticipant.sid) {
21967
21977
  livekitLogger.warn('tried to create RemoteParticipant for local participant');
21968
21978
  return;