livekit-client 1.15.7 → 1.15.8

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.
@@ -21566,7 +21566,7 @@ class LocalParticipant extends Participant {
21566
21566
  yield Promise.all(localPubs.map(pub => __awaiter(this, void 0, void 0, function* () {
21567
21567
  const track = pub.track;
21568
21568
  yield this.unpublishTrack(track, false);
21569
- if (restartTracks && !track.isMuted && (track instanceof LocalAudioTrack || track instanceof LocalVideoTrack) && !track.isUserProvided) {
21569
+ if (restartTracks && !track.isMuted && track.source !== Track.Source.ScreenShare && track.source !== Track.Source.ScreenShareAudio && (track instanceof LocalAudioTrack || track instanceof LocalVideoTrack) && !track.isUserProvided) {
21570
21570
  // generally we need to restart the track before publishing, often a full reconnect
21571
21571
  // is necessary because computer had gone to sleep.
21572
21572
  this.log.debug('restarting existing track', Object.assign(Object.assign({}, this.logContext), {
@@ -22066,30 +22066,7 @@ class Room extends eventsExports.EventEmitter {
22066
22066
  this.applyJoinResponse(joinResponse);
22067
22067
  try {
22068
22068
  // unpublish & republish tracks
22069
- const localPubs = [];
22070
- this.localParticipant.tracks.forEach(pub => {
22071
- if (pub.track) {
22072
- localPubs.push(pub);
22073
- }
22074
- });
22075
- yield Promise.all(localPubs.map(pub => __awaiter(this, void 0, void 0, function* () {
22076
- const track = pub.track;
22077
- this.localParticipant.unpublishTrack(track, false);
22078
- if (!track.isMuted) {
22079
- if ((track instanceof LocalAudioTrack || track instanceof LocalVideoTrack) && track.source !== Track.Source.ScreenShare && track.source !== Track.Source.ScreenShareAudio && !track.isUserProvided) {
22080
- // we need to restart the track before publishing, often a full reconnect
22081
- // is necessary because computer had gone to sleep.
22082
- this.log.debug('restarting existing track', Object.assign(Object.assign({}, this.logContext), {
22083
- track: pub.trackSid
22084
- }));
22085
- yield track.restartTrack();
22086
- }
22087
- this.log.debug('publishing new track', Object.assign(Object.assign({}, this.logContext), {
22088
- track: pub.trackSid
22089
- }));
22090
- yield this.localParticipant.publishTrack(track, pub.options);
22091
- }
22092
- })));
22069
+ yield this.localParticipant.republishAllTracks(undefined, true);
22093
22070
  } catch (error) {
22094
22071
  this.log.error('error trying to re-publish tracks after reconnection', Object.assign(Object.assign({}, this.logContext), {
22095
22072
  error