Skip to content
Merged
Show file tree
Hide file tree
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
25 changes: 12 additions & 13 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 Expand Up @@ -792,9 +791,9 @@
localVideo.hide();
},
disableVideo: function() {
this._mediaControlsView.disableVideo();
// Always hide the video, even if "disableVideo" returned "false".
this.hideVideo();
if (this._mediaControlsView.disableVideo()) {
this.hideVideo();
}
},
// Called from webrtc.js
disableScreensharingButton: function() {
Expand Down
21 changes: 12 additions & 9 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 Expand Up @@ -234,9 +237,9 @@
localVideo.hide();
},
disableVideo: function() {
this._mediaControlsView.disableVideo();
// Always hide the video, even if "disableVideo" returned "false".
this.hideVideo();
if (this._mediaControlsView.disableVideo()) {
this.hideVideo();
}
},
// Called from webrtc.js
disableScreensharingButton: function() {
Expand Down