Improve load-test script. (#8563)

* In load-test, merge URL params into config.

* Honor config.testing.noAutoPlayVideo in load-test.
This commit is contained in:
Jonathan Lennox 2021-02-05 16:00:28 -05:00 committed by GitHub
parent 67a01364d3
commit 73c3feb8fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -1,15 +1,19 @@
/* global $, config, JitsiMeetJS */
import 'jquery';
import { setConfigFromURLParams } from '../../react/features/base/config/functions';
import { parseURLParams } from '../../react/features/base/util/parseURLParams';
import { parseURIString } from '../../react/features/base/util/uri';
setConfigFromURLParams(config, {}, {}, window.location);
const params = parseURLParams(window.location, false, 'hash');
const { isHuman = false } = params;
const {
localAudio = params['config.startWithAudioMuted'] !== true,
localVideo = params['config.startWithVideoMuted'] !== true,
localAudio = config.startWithAudioMuted !== true,
localVideo = config.startWithVideoMuted !== true,
remoteVideo = isHuman,
remoteAudio = isHuman
remoteAudio = isHuman,
autoPlayVideo = config.testing.noAutoPlayVideo !== true
} = params;
const { room: roomName } = parseURIString(window.location.toString());
@ -56,7 +60,8 @@ window.APP = {
localAudio,
localVideo,
remoteVideo,
remoteAudio
remoteAudio,
autoPlayVideo
};
}
};
@ -76,7 +81,7 @@ function onLocalTracks(tracks = []) {
localTracks = tracks;
for (let i = 0; i < localTracks.length; i++) {
if (localTracks[i].getType() === 'video') {
$('body').append(`<video autoplay='1' id='localVideo${i}' />`);
$('body').append(`<video ${autoPlayVideo ? 'autoplay="1" ' : ''}id='localVideo${i}' />`);
localTracks[i].attach($(`#localVideo${i}`)[0]);
} else {
$('body').append(