Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(presence) Send a presence update on every track replace operation. #2001

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -1293,11 +1293,9 @@ JitsiConference.prototype.replaceTrack = function(oldTrack, newTrack) {
this._sendBridgeVideoTypeMessage(newTrack);
}

// updates presence when we replace the video tracks desktop with screen and screen with desktop
if (oldTrackBelongsToConference && oldTrack?.isVideoTrack()

// we do not want to send presence update during setEffect switching, which does remove and then add
&& !(oldTrack?._setEffectInProgress || newTrack?._setEffectInProgress)) {
// We do not want to send presence update during setEffect switching, which removes and then adds the same
// track back to the conference.
if (!(oldTrack?._setEffectInProgress || newTrack?._setEffectInProgress)) {
this._updateRoomPresence(this.getActiveMediaSession());
}

Expand Down Expand Up @@ -3649,9 +3647,9 @@ JitsiConference.prototype._updateRoomPresence = function(jingleSession, ctx) {

let presenceChanged = false;
let muteStatusChanged, videoTypeChanged;
const localTracks = this.getLocalTracks();
const localAudioTracks = jingleSession.peerconnection.getLocalTracks(MediaType.AUDIO);
const localVideoTracks = jingleSession.peerconnection.getLocalTracks(MediaType.VIDEO);
const localTracks = jingleSession.peerconnection.getLocalTracks();
const localAudioTracks = localTracks.filter(track => track.getType() === MediaType.AUDIO);
const localVideoTracks = localTracks.filter(track => track.getType() === MediaType.VIDEO);

// Set presence for all the available local tracks.
for (const track of localTracks) {
Expand Down