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.
This commit is contained in:
parent
fec2641730
commit
2cd43ba2e4
|
@ -20,8 +20,6 @@ const { room: roomName } = parseURIString(window.location.toString());
|
||||||
|
|
||||||
let connection = null;
|
let connection = null;
|
||||||
|
|
||||||
let isJoined = false;
|
|
||||||
|
|
||||||
let room = null;
|
let room = null;
|
||||||
|
|
||||||
let numParticipants = 1;
|
let numParticipants = 1;
|
||||||
|
@ -107,13 +105,15 @@ function onLocalTracks(tracks = []) {
|
||||||
$('body').append(`<video ${autoPlayVideo ? 'autoplay="1" ' : ''}id='localVideo${i}' />`);
|
$('body').append(`<video ${autoPlayVideo ? 'autoplay="1" ' : ''}id='localVideo${i}' />`);
|
||||||
localTracks[i].attach($(`#localVideo${i}`)[0]);
|
localTracks[i].attach($(`#localVideo${i}`)[0]);
|
||||||
} else {
|
} else {
|
||||||
|
if (!localAudio) {
|
||||||
|
localTracks[i].mute();
|
||||||
|
}
|
||||||
|
|
||||||
$('body').append(
|
$('body').append(
|
||||||
`<audio autoplay='1' muted='true' id='localAudio${i}' />`);
|
`<audio autoplay='1' muted='true' id='localAudio${i}' />`);
|
||||||
localTracks[i].attach($(`#localAudio${i}`)[0]);
|
localTracks[i].attach($(`#localAudio${i}`)[0]);
|
||||||
}
|
}
|
||||||
if (isJoined) {
|
room.addTrack(localTracks[i]);
|
||||||
room.addTrack(localTracks[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ function onRemoteTrack(track) {
|
||||||
* That function is executed when the conference is joined
|
* That function is executed when the conference is joined
|
||||||
*/
|
*/
|
||||||
function onConferenceJoined() {
|
function onConferenceJoined() {
|
||||||
isJoined = true;
|
console.log('Conference joined');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -190,9 +190,8 @@ function onConnectionSuccess() {
|
||||||
if (localVideo) {
|
if (localVideo) {
|
||||||
devices.push('video');
|
devices.push('video');
|
||||||
}
|
}
|
||||||
if (localAudio) {
|
devices.push('audio');
|
||||||
devices.push('audio');
|
|
||||||
}
|
|
||||||
if (devices.length > 0) {
|
if (devices.length > 0) {
|
||||||
JitsiMeetJS.createLocalTracks({ devices })
|
JitsiMeetJS.createLocalTracks({ devices })
|
||||||
.then(onLocalTracks)
|
.then(onLocalTracks)
|
||||||
|
|
Loading…
Reference in New Issue