Add jitsi_widget.force_always_on_screen

This commit is contained in:
Michael Weimann 2022-07-06 16:37:26 +02:00
parent 2032668e3a
commit f706b0174e
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
2 changed files with 17 additions and 7 deletions

View file

@ -261,15 +261,20 @@ The VoIP and Jitsi options are:
} }
} }
``` ```
2. `jitsi_widget`: Optional configuration for the built-in Jitsi widget. Currently can only contain a single `skip_built_in_welcome_screen` 2. `jitsi_widget`: Optional configuration for the built-in Jitsi widget. It supports the following `skip_built_in_welcome_screen`
value, denoting whether the "Join Conference" button should be shown. When `true` (default `false`), Jitsi calls will skip to customisations: `skip_built_in_welcome_screen` denoting whether the "Join Conference" button should be shown.
the call instead of having a screen with a single button on it. This is most useful if the Jitsi instance being used already When `true` (default `false`), Jitsi calls will skip to the call instead of having a screen with a single button on it.
has a landing page for users to test audio and video before joining the call, otherwise users will automatically join the call. This is most useful if the Jitsi instance being used already has a landing page for users to test audio and video before
joining the call, otherwise users will automatically join the call.
`force_always_on_screen` whether the Jitsi widget should be displayed in picture-in-picture mode even if no conference
has been joined yet. This can be useful for environments that require authentication where users often click away before
entering their credentials.
For example: For example:
```json ```json
{ {
"jitsi_widget": { "jitsi_widget": {
"skip_built_in_welcome_screen": true "skip_built_in_welcome_screen": true,
"force_always_on_screen": true
} }
} }
``` ```

View file

@ -56,6 +56,7 @@ let isVideoChannel: boolean;
let widgetApi: WidgetApi; let widgetApi: WidgetApi;
let meetApi: any; // JitsiMeetExternalAPI let meetApi: any; // JitsiMeetExternalAPI
let skipOurWelcomeScreen = false; let skipOurWelcomeScreen = false;
let forceAlwaysOnScreen = false;
const ack = (ev: CustomEvent<IWidgetApiRequest>) => widgetApi.transport.reply(ev.detail, {}); const ack = (ev: CustomEvent<IWidgetApiRequest>) => widgetApi.transport.reply(ev.detail, {});
@ -126,8 +127,9 @@ const ack = (ev: CustomEvent<IWidgetApiRequest>) => widgetApi.transport.reply(ev
// We've reached the point where we have to wait for the config, so do that then parse it. // We've reached the point where we have to wait for the config, so do that then parse it.
const instanceConfig = new SnakedObject<IConfigOptions>((await configPromise) ?? <IConfigOptions>{}); const instanceConfig = new SnakedObject<IConfigOptions>((await configPromise) ?? <IConfigOptions>{});
const jitsiConfig = instanceConfig.get("jitsi_widget") ?? {}; const jitsiConfig = instanceConfig.get("jitsi_widget") ?? {};
skipOurWelcomeScreen = (new SnakedObject<IConfigOptions["jitsi_widget"]>(jitsiConfig)) const jitsiWidgetConfig = (new SnakedObject<IConfigOptions["jitsi_widget"]>(jitsiConfig));
.get("skip_built_in_welcome_screen") ?? false; skipOurWelcomeScreen = jitsiWidgetConfig.get("skip_built_in_welcome_screen") ?? false;
forceAlwaysOnScreen = jitsiWidgetConfig.get("force_always_on_screen") ?? false;
// Either reveal the prejoin screen, or skip straight to Jitsi depending on the config. // Either reveal the prejoin screen, or skip straight to Jitsi depending on the config.
// We don't set up the call yet though as this might lead to failure without the widget API. // We don't set up the call yet though as this might lead to failure without the widget API.
@ -432,6 +434,9 @@ function joinConference(audioDevice?: string | null, videoDevice?: string | null
// Patch logs into rageshakes // Patch logs into rageshakes
meetApi.on("log", onLog); meetApi.on("log", onLog);
if (forceAlwaysOnScreen) {
widgetApi.setAlwaysOnScreen(true);
}
} }
const onVideoConferenceJoined = () => { const onVideoConferenceJoined = () => {