Selaa lähdekoodia

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

master
Jonathan Lennox 4 vuotta sitten
vanhempi
commit
4beca0d5dd
No account linked to committer's email address
1 muutettua tiedostoa jossa 24 lisäystä ja 0 poistoa
  1. 24
    0
      resources/load-test/load-test-participant.js

+ 24
- 0
resources/load-test/load-test-participant.js Näytä tiedosto

29
 let localTracks = [];
29
 let localTracks = [];
30
 const remoteTracks = {};
30
 const remoteTracks = {};
31
 
31
 
32
+let maxFrameHeight = 0;
33
+
32
 window.APP = {
34
 window.APP = {
33
     conference: {
35
     conference: {
34
         getStats() {
36
         getStats() {
66
     }
68
     }
67
 };
69
 };
68
 
70
 
71
+/**
72
+ * Simple emulation of jitsi-meet's screen layout behavior
73
+ */
74
+function updateMaxFrameHeight() {
75
+    let newMaxFrameHeight;
76
+
77
+    if (numParticipants <= 2) {
78
+        newMaxFrameHeight = 720;
79
+    } else if (numParticipants <= 4) {
80
+        newMaxFrameHeight = 360;
81
+    } else {
82
+        newMaxFrameHeight = 180;
83
+    }
84
+
85
+    if (room && maxFrameHeight !== newMaxFrameHeight) {
86
+        maxFrameHeight = newMaxFrameHeight;
87
+        room.setReceiverVideoConstraint(maxFrameHeight);
88
+    }
89
+}
90
+
69
 /**
91
 /**
70
  *
92
  *
71
  */
93
  */
72
 function setNumberOfParticipants() {
94
 function setNumberOfParticipants() {
73
     $('#participants').text(numParticipants);
95
     $('#participants').text(numParticipants);
96
+    updateMaxFrameHeight();
74
 }
97
 }
75
 
98
 
76
 /**
99
 /**
165
     });
188
     });
166
     room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);
189
     room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);
167
     room.join();
190
     room.join();
191
+    updateMaxFrameHeight();
168
 }
192
 }
169
 
193
 
170
 /**
194
 /**

Loading…
Peruuta
Tallenna