|
@@ -147,9 +147,6 @@ function onRemoteTrack(track) {
|
147
|
147
|
*/
|
148
|
148
|
function onConferenceJoined() {
|
149
|
149
|
isJoined = true;
|
150
|
|
- for (let i = 0; i < localTracks.length; i++) {
|
151
|
|
- room.addTrack(localTracks[i]);
|
152
|
|
- }
|
153
|
150
|
}
|
154
|
151
|
|
155
|
152
|
/**
|
|
@@ -187,7 +184,28 @@ function onConnectionSuccess() {
|
187
|
184
|
remoteTracks[id] = [];
|
188
|
185
|
});
|
189
|
186
|
room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);
|
190
|
|
- room.join();
|
|
187
|
+
|
|
188
|
+ const devices = [];
|
|
189
|
+
|
|
190
|
+ if (localVideo) {
|
|
191
|
+ devices.push('video');
|
|
192
|
+ }
|
|
193
|
+ if (localAudio) {
|
|
194
|
+ devices.push('audio');
|
|
195
|
+ }
|
|
196
|
+ if (devices.length > 0) {
|
|
197
|
+ JitsiMeetJS.createLocalTracks({ devices })
|
|
198
|
+ .then(onLocalTracks)
|
|
199
|
+ .then(() => {
|
|
200
|
+ room.join();
|
|
201
|
+ })
|
|
202
|
+ .catch(error => {
|
|
203
|
+ throw error;
|
|
204
|
+ });
|
|
205
|
+ } else {
|
|
206
|
+ room.join();
|
|
207
|
+ }
|
|
208
|
+
|
191
|
209
|
updateMaxFrameHeight();
|
192
|
210
|
}
|
193
|
211
|
|
|
@@ -239,21 +257,3 @@ connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED
|
239
|
257
|
connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, onConnectionFailed);
|
240
|
258
|
connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, disconnect);
|
241
|
259
|
connection.connect();
|
242
|
|
-
|
243
|
|
-const devices = [];
|
244
|
|
-
|
245
|
|
-if (localVideo) {
|
246
|
|
- devices.push('video');
|
247
|
|
-}
|
248
|
|
-if (localAudio) {
|
249
|
|
- devices.push('audio');
|
250
|
|
-}
|
251
|
|
-if (devices.length > 0) {
|
252
|
|
- JitsiMeetJS.createLocalTracks({ devices })
|
253
|
|
- .then(onLocalTracks)
|
254
|
|
- .catch(error => {
|
255
|
|
- throw error;
|
256
|
|
- });
|
257
|
|
-}
|
258
|
|
-
|
259
|
|
-
|