bigbluebutton-Github/bigbluebutton-tests/playwright/core/settings.js
Gustavo Trott cf0b32efff
Merge pull request #20682 from germanocaumo/skip-ecoTest-if-previous
Microphone: add option to skip echo test if session has valid input/output devices stored
2024-07-19 13:16:11 -03:00

59 lines
2.4 KiB
JavaScript

let settings;
async function generateSettingsData(page) {
if (settings || !page) return settings;
try {
const settingsData = await page.evaluate(() => {
return window.meetingClientSettings.public;
});
settings = {
reactionsButton: settingsData.app.reactionsButton.enabled,
sharedNotesEnabled: settingsData.notes.enabled,
directLeaveButton: settingsData.app.defaultSettings.application.directLeaveButton,
// Audio
autoJoinAudioModal: settingsData.app.autoJoin,
listenOnlyMode: settingsData.app.listenOnlyMode,
forceListenOnly: settingsData.app.forceListenOnly,
skipEchoTest: settingsData.app.skipCheck,
skipEchoTestOnJoin: settingsData.app.skipCheckOnJoin,
skipEchoTestIfPreviousDevice: settingsData.app.skipEchoTestIfPreviousDevice,
speechRecognitionEnabled: settingsData.app.audioCaptions.enabled,
// Chat
chatEnabled: settingsData.chat.enabled,
publicChatOptionsEnabled: settingsData.chat.enableSaveAndCopyPublicChat,
maxMessageLength: settingsData.chat.max_message_length,
emojiPickerEnabled: settingsData.chat.emojiPicker.enable,
autoConvertEmojiEnabled: settingsData.chat.autoConvertEmoji,
// Polling
pollEnabled: settingsData.poll.enabled,
pollChatMessage: settingsData.poll.chatMessage,
// Presentation
originalPresentationDownloadable: settingsData.presentation.allowDownloadOriginal,
presentationWithAnnotationsDownloadable: settingsData.presentation.allowDownloadWithAnnotations,
externalVideoPlayer: settingsData.externalVideoPlayer.enabled,
presentationHidden: settingsData.layout.hidePresentation,
// Screensharing
screensharingEnabled: settingsData.kurento.enableScreensharing,
// Timeouts
listenOnlyCallTimeout: parseInt(settingsData.media.listenOnlyCallTimeout),
videoPreviewTimeout: parseInt(settingsData.kurento.gUMTimeout),
// Webcam
webcamSharingEnabled: settingsData.kurento.enableVideo,
skipVideoPreview: settingsData.kurento.skipVideoPreview,
skipVideoPreviewOnFirstJoin: settingsData.kurento.skipVideoPreviewOnFirstJoin,
skipVideoPreviewIfPreviousDevice: settingsData.kurento.skipVideoPreviewIfPreviousDevice,
}
return settings;
} catch (err) {
console.log(`Unable to get public settings data: ${err}`);
}
}
module.exports = exports = {
getSettings: () => settings,
generateSettingsData,
}