Set receiver video constraint in load-test script, as-if tile view. (#8567)

This commit is contained in:
Jonathan Lennox 2021-02-08 13:35:03 -05:00 committed by GitHub
parent bfc4b2ac6f
commit 4beca0d5dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

View File

@ -29,6 +29,8 @@ let numParticipants = 1;
let localTracks = []; let localTracks = [];
const remoteTracks = {}; const remoteTracks = {};
let maxFrameHeight = 0;
window.APP = { window.APP = {
conference: { conference: {
getStats() { getStats() {
@ -66,11 +68,32 @@ window.APP = {
} }
}; };
/**
* Simple emulation of jitsi-meet's screen layout behavior
*/
function updateMaxFrameHeight() {
let newMaxFrameHeight;
if (numParticipants <= 2) {
newMaxFrameHeight = 720;
} else if (numParticipants <= 4) {
newMaxFrameHeight = 360;
} else {
newMaxFrameHeight = 180;
}
if (room && maxFrameHeight !== newMaxFrameHeight) {
maxFrameHeight = newMaxFrameHeight;
room.setReceiverVideoConstraint(maxFrameHeight);
}
}
/** /**
* *
*/ */
function setNumberOfParticipants() { function setNumberOfParticipants() {
$('#participants').text(numParticipants); $('#participants').text(numParticipants);
updateMaxFrameHeight();
} }
/** /**
@ -165,6 +188,7 @@ function onConnectionSuccess() {
}); });
room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft); room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);
room.join(); room.join();
updateMaxFrameHeight();
} }
/** /**