2022-03-29 21:53:07 +08:00
|
|
|
let settings;
|
|
|
|
|
|
|
|
async function generateSettingsData(page) {
|
|
|
|
if (settings || !page) return settings;
|
|
|
|
|
|
|
|
try {
|
|
|
|
const settingsData = await page.evaluate(() => {
|
2024-03-07 01:28:18 +08:00
|
|
|
return window.meetingClientSettings.public;
|
2022-03-29 21:53:07 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
settings = {
|
2023-07-31 22:24:25 +08:00
|
|
|
reactionsButton: settingsData.app.reactionsButton.enabled,
|
2022-03-29 21:53:07 +08:00
|
|
|
sharedNotesEnabled: settingsData.notes.enabled,
|
2024-02-23 21:09:31 +08:00
|
|
|
directLeaveButton: settingsData.app.defaultSettings.application.directLeaveButton,
|
2022-03-29 21:53:07 +08:00
|
|
|
// Audio
|
|
|
|
autoJoinAudioModal: settingsData.app.autoJoin,
|
|
|
|
listenOnlyMode: settingsData.app.listenOnlyMode,
|
|
|
|
forceListenOnly: settingsData.app.forceListenOnly,
|
|
|
|
skipEchoTest: settingsData.app.skipCheck,
|
|
|
|
skipEchoTestOnJoin: settingsData.app.skipCheckOnJoin,
|
2023-07-01 04:16:22 +08:00
|
|
|
speechRecognitionEnabled: settingsData.app.audioCaptions.enabled,
|
2022-03-29 21:53:07 +08:00
|
|
|
// Chat
|
|
|
|
chatEnabled: settingsData.chat.enabled,
|
|
|
|
publicChatOptionsEnabled: settingsData.chat.enableSaveAndCopyPublicChat,
|
|
|
|
maxMessageLength: settingsData.chat.max_message_length,
|
2022-09-28 02:47:39 +08:00
|
|
|
emojiPickerEnabled: settingsData.chat.emojiPicker.enable,
|
2022-08-30 20:28:34 +08:00
|
|
|
autoConvertEmojiEnabled: settingsData.chat.autoConvertEmoji,
|
2022-03-29 21:53:07 +08:00
|
|
|
// Polling
|
|
|
|
pollEnabled: settingsData.poll.enabled,
|
|
|
|
pollChatMessage: settingsData.poll.chatMessage,
|
|
|
|
// Presentation
|
2023-08-05 03:47:23 +08:00
|
|
|
originalPresentationDownloadable: settingsData.presentation.allowDownloadOriginal,
|
|
|
|
presentationWithAnnotationsDownloadable: settingsData.presentation.allowDownloadWithAnnotations,
|
2022-03-29 21:53:07 +08:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
|
|
|
|
return settings;
|
|
|
|
} catch (err) {
|
|
|
|
console.log(`Unable to get public settings data: ${err}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = {
|
|
|
|
getSettings: () => settings,
|
|
|
|
generateSettingsData,
|
|
|
|
}
|