Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Fix disabling video when joining a call in a room with > 5 participants
Until now, when entering a room with more than five participants the
video was disabled. However, if the local video is available it is
enabled when WebRTC starts. Due to this, if WebRTC was also started when
joining the call (that is, no previous calls were made in other rooms
since the last page reload) the video was enabled instead of disabled.
Besides that, if leaving the call with the video enabled and joining it
again the video was still enabled, as the room had not been entered
again to disable the video. To fix both issues now the video is disabled
when joining the call instead of when entering the room.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
  • Loading branch information
danxuliu authored and Backportbot committed Feb 25, 2019
commit c49fa976d79c11d8047dedebf5751ee47dcbefe3
19 changes: 9 additions & 10 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@
self.stopListening(self.activeRoom, 'change:displayName');
self.stopListening(self.activeRoom, 'change:participantFlags');

var participants;
if (OC.getCurrentUser().uid) {
roomChannel.trigger('active', token);

Expand All @@ -337,15 +336,6 @@
self.activeRoom = room;
}
});
participants = self.activeRoom.get('participants');
} else {
// The public page supports only a single room, so the
// active room is already the room for the given token.
participants = self.activeRoom.get('participants');
}
// Disable video when entering a room with more than 5 participants.
if (participants && Object.keys(participants).length > 5) {
self.disableVideo();
}

self._emptyContentView.setActiveRoom(self.activeRoom);
Expand Down Expand Up @@ -605,6 +595,15 @@
}
}.bind(this));

this.signaling.on('joinCall', function() {
// Disable video when joining a call in a room with more than 5
// participants.
var participants = this.activeRoom.get('participants');
if (participants && Object.keys(participants).length > 5) {
this.disableVideo();
}
}.bind(this));

$(window).unload(function () {
this.connection.leaveCurrentRoom();
this.signaling.disconnect();
Expand Down
15 changes: 9 additions & 6 deletions js/embedded.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
.then(function() {
self.stopListening(self.activeRoom, 'change:participantFlags');

var participants;
if (OC.getCurrentUser().uid) {
roomChannel.trigger('active', token);

Expand All @@ -92,11 +91,6 @@
self.activeRoom = room;
}
});
participants = self.activeRoom.get('participants');
}
// Disable video when entering a room with more than 5 participants.
if (participants && Object.keys(participants).length > 5) {
self.disableVideo();
}
});
},
Expand Down Expand Up @@ -127,6 +121,15 @@
this.signaling = OCA.Talk.Signaling.createConnection();
this.connection = new OCA.Talk.Connection(this);

this.signaling.on('joinCall', function() {
// Disable video when joining a call in a room with more than 5
// participants.
var participants = this.activeRoom.get('participants');
if (participants && Object.keys(participants).length > 5) {
this.disableVideo();
}
}.bind(this));

$(window).unload(function () {
this.connection.leaveCurrentRoom();
this.signaling.disconnect();
Expand Down