Skip to content
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
17 changes: 11 additions & 6 deletions src/components/CallView/Grid/VideosGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -452,14 +452,19 @@ export default {
}
},

// The local video always takes one slot if the grid view is not shown as a stripe.
// In recording mode the local video is not shown, so all slots are available.
noLocalVideoReserve() {
return this.isStripe || this.isRecording
},

// Number of grid slots (videos per page) at any given moment, clamped to
// `videosCap` (`0` means no cap). The local video always takes one slot if
// the grid view is not shown as a stripe.
// `videosCap` (`0` means no cap).
// The cap is primarily enforced by shrinking the grid layout (see
// `makeGrid`/`shrinkGrid`); this clamp keeps the "videos per page" math
// consistent even before the layout has been recomputed.
slots() {
const slots = this.isStripe ? this.rows * this.columns : this.rows * this.columns - 1
const slots = this.noLocalVideoReserve ? this.rows * this.columns : this.rows * this.columns - 1
return this.videosCap ? Math.min(this.videosCap, slots) : slots
},

Expand Down Expand Up @@ -771,7 +776,7 @@ export default {

let currentColumns = this.columns
let currentRows = this.rows
let currentSlots = this.isStripe ? currentColumns * currentRows : currentColumns * currentRows - 1
let currentSlots = this.noLocalVideoReserve ? currentColumns * currentRows : currentColumns * currentRows - 1

// Run this code only if we don't have an 'overflow' of videos. If the
// videos are populating the grid, there's no point in shrinking it.
Expand Down Expand Up @@ -804,7 +809,7 @@ export default {
currentColumns--
}

currentSlots = this.isStripe ? currentColumns * currentRows : currentColumns * currentRows - 1
currentSlots = this.noLocalVideoReserve ? currentColumns * currentRows : currentColumns * currentRows - 1

// Check that there are still enough slots available
if (numberOfVideos > currentSlots) {
Expand All @@ -817,7 +822,7 @@ export default {
currentRows--
}

currentSlots = this.isStripe ? currentColumns * currentRows : currentColumns * currentRows - 1
currentSlots = this.noLocalVideoReserve ? currentColumns * currentRows : currentColumns * currentRows - 1

// Check that there are still enough slots available
if (numberOfVideos > currentSlots) {
Expand Down
Loading