Skip to content

Commit

Permalink
fix: screenshare not getting removed
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Aug 1, 2024
1 parent 56023c0 commit c70a70b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ export class TrackManager {
};

handleTrackRemovedPermanently = (notification: TrackStateNotification) => {
HMSLogger.d(this.TAG, `ONTRACKREMOVE`, notification);
HMSLogger.d(this.TAG, `ONTRACKREMOVE permanently`, notification);
const trackIds = Object.keys(notification.tracks);

trackIds.forEach(trackId => {
const trackStateEntry = this.store.getTrackState(trackId);

if (!trackStateEntry) {
return;
}
Expand Down Expand Up @@ -205,7 +204,6 @@ export class TrackManager {
track.type === HMSTrackType.AUDIO
? this.eventBus.audioTrackAdded.publish({ track: track as HMSRemoteAudioTrack, peer: hmsPeer as HMSRemotePeer })
: this.listener?.onTrackUpdate(HMSTrackUpdate.TRACK_ADDED, track, hmsPeer);
this.store.removeTrackState(track.trackId);
this.tracksToProcess.delete(track.trackId);
});
};
Expand Down
1 change: 1 addition & 0 deletions packages/hms-video-store/src/sdk/store/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class Store {
this.tracks.forEach(track => {
if (track instanceof HMSRemoteAudioTrack || track instanceof HMSRemoteVideoTrack) {
this.removeTrack(track);
delete this.peerTrackStates[track.trackId];
}
});
}
Expand Down

0 comments on commit c70a70b

Please sign in to comment.