Browse Source

fix(load-test): Always create local audio track. (#8612)

* fix(load-test): Always create local audio track.

When audio mutes will mute the track. Also fixes previous change where we do not add any of the tracks to the room.

* squash: Fix lint errors.
j8
Дамян Минков 4 years ago
parent
commit
2cd43ba2e4
No account linked to committer's email address
1 changed files with 8 additions and 9 deletions
  1. 8
    9
      resources/load-test/load-test-participant.js

+ 8
- 9
resources/load-test/load-test-participant.js View File

20
 
20
 
21
 let connection = null;
21
 let connection = null;
22
 
22
 
23
-let isJoined = false;
24
-
25
 let room = null;
23
 let room = null;
26
 
24
 
27
 let numParticipants = 1;
25
 let numParticipants = 1;
107
             $('body').append(`<video ${autoPlayVideo ? 'autoplay="1" ' : ''}id='localVideo${i}' />`);
105
             $('body').append(`<video ${autoPlayVideo ? 'autoplay="1" ' : ''}id='localVideo${i}' />`);
108
             localTracks[i].attach($(`#localVideo${i}`)[0]);
106
             localTracks[i].attach($(`#localVideo${i}`)[0]);
109
         } else {
107
         } else {
108
+            if (!localAudio) {
109
+                localTracks[i].mute();
110
+            }
111
+
110
             $('body').append(
112
             $('body').append(
111
                 `<audio autoplay='1' muted='true' id='localAudio${i}' />`);
113
                 `<audio autoplay='1' muted='true' id='localAudio${i}' />`);
112
             localTracks[i].attach($(`#localAudio${i}`)[0]);
114
             localTracks[i].attach($(`#localAudio${i}`)[0]);
113
         }
115
         }
114
-        if (isJoined) {
115
-            room.addTrack(localTracks[i]);
116
-        }
116
+        room.addTrack(localTracks[i]);
117
     }
117
     }
118
 }
118
 }
119
 
119
 
146
  * That function is executed when the conference is joined
146
  * That function is executed when the conference is joined
147
  */
147
  */
148
 function onConferenceJoined() {
148
 function onConferenceJoined() {
149
-    isJoined = true;
149
+    console.log('Conference joined');
150
 }
150
 }
151
 
151
 
152
 /**
152
 /**
190
     if (localVideo) {
190
     if (localVideo) {
191
         devices.push('video');
191
         devices.push('video');
192
     }
192
     }
193
-    if (localAudio) {
194
-        devices.push('audio');
195
-    }
193
+    devices.push('audio');
194
+
196
     if (devices.length > 0) {
195
     if (devices.length > 0) {
197
         JitsiMeetJS.createLocalTracks({ devices })
196
         JitsiMeetJS.createLocalTracks({ devices })
198
             .then(onLocalTracks)
197
             .then(onLocalTracks)

Loading…
Cancel
Save