Przeglądaj źródła

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

j8
Jonathan Lennox 4 lat temu
rodzic
commit
4beca0d5dd
No account linked to committer's email address
1 zmienionych plików z 24 dodań i 0 usunięć
  1. 24
    0
      resources/load-test/load-test-participant.js

+ 24
- 0
resources/load-test/load-test-participant.js Wyświetl plik

@@ -29,6 +29,8 @@ let numParticipants = 1;
29 29
 let localTracks = [];
30 30
 const remoteTracks = {};
31 31
 
32
+let maxFrameHeight = 0;
33
+
32 34
 window.APP = {
33 35
     conference: {
34 36
         getStats() {
@@ -66,11 +68,32 @@ window.APP = {
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 94
 function setNumberOfParticipants() {
73 95
     $('#participants').text(numParticipants);
96
+    updateMaxFrameHeight();
74 97
 }
75 98
 
76 99
 /**
@@ -165,6 +188,7 @@ function onConnectionSuccess() {
165 188
     });
166 189
     room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);
167 190
     room.join();
191
+    updateMaxFrameHeight();
168 192
 }
169 193
 
170 194
 /**

Ładowanie…
Anuluj
Zapisz