You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few aspects of Element Call's interface can be controlled through a global API on the `window`:
3
+
A few aspects of Element Call's interface can be controlled through a global API on the `window`.
4
+
5
+
## Picture-in-picture
4
6
5
7
-`controls.canEnterPip(): boolean` Determines whether it's possible to enter picture-in-picture mode.
6
8
-`controls.enablePip(): void` Puts the call interface into picture-in-picture mode. Throws if not in a call.
7
9
-`controls.disablePip(): void` Takes the call interface out of picture-in-picture mode, restoring it to its natural display mode. Throws if not in a call.
10
+
11
+
## Audio devices
12
+
13
+
On mobile platforms (iOS, Android), web views do not reliably support selecting audio output devices such as the main speaker, earpiece, or headset. To address this limitation, the following functions allow the hosting application (e.g., Element Web, Element X) to manage audio devices via exposed JavaScript interfaces. These functions must be enabled using the URL parameter `controlledAudioDevices` to take effect.
14
+
15
+
-`controls.setAvailableAudioDevices(devices: { id: string, name: string, forEarpiece?: boolean, isEarpiece?: boolean isSpeaker?: boolean, isExternalHeadset?, boolean; }[]): void` Sets the list of available audio outputs. `forEarpiece` is used on iOS only.
16
+
It flags the device that should be used if the user selects earpiece mode. This should be the main stereo loudspeaker of the device.
17
+
-`controls.onAudioDeviceSelect: ((id: string) => void) | undefined` Callback called whenever the user or application selects a new audio output.
18
+
-`controls.setAudioDevice(id: string): void` Sets the selected audio device in Element Call's menu. This should be used if the OS decides to automatically switch to Bluetooth, for example.
19
+
-`controls.setAudioEnabled(enabled: boolean)` Enables/disables all audio output from the application. Output is enabled by default.
20
+
-`showNativeAudioDevicePicker: (() => void) | undefined`. Callback called whenever the user presses the output button in the settings menu.
21
+
This button is only shown on iOS. (`userAgent.includes("iPhone")`)
Copy file name to clipboardExpand all lines: docs/url-params.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,7 @@ These parameters are relevant to both [widget](./embedded-standalone.md) and [st
63
63
|`lang`|[BCP 47](https://www.rfc-editor.org/info/bcp47) code | No | No | The language the app should use. |
64
64
|`password`|| No | No | E2EE password when using a shared secret. (For individual sender keys in embedded mode this is not required.) |
65
65
|`perParticipantE2EE`|`true` or `false`| No, defaults to `false`| No, defaults to `false`| Enables per participant encryption with Keys exchanged over encrypted matrix room messages. |
66
+
|`controlledAudioDevices`|`true` or `false`| No, defaults to `false`| No, defaults to `false`| Whether the [global JS controls for audio output devices](./controls.md#audio-devices) should be enabled, allowing the list of audio devices to be controlled by the app hosting Element Call. |
66
67
|`roomId`|[Matrix Room ID](https://spec.matrix.org/v1.12/appendices/#room-ids)| Yes | No | Anything about what room we're pointed to should be from useRoomIdentifier which parses the path and resolves alias with respect to the default server name, however roomId is an exception as we need the room ID in embedded widget mode, and not the room alias (or even the via params because we are not trying to join it). This is also not validated, where it is in `useRoomIdentifier()`. |
67
68
|`showControls`|`true` or `false`| No, defaults to `true`| No, defaults to `true`| Displays controls like mute, screen-share, invite, and hangup buttons during a call. |
68
69
|`skipLobby` (deprecated: use `intent` instead) |`true` or `false`| No. If `intent` is explicitly `start_call` then defaults to `true`. Otherwise defaults to `false`| No, defaults to `false`| Skips the lobby to join a call directly, can be combined with preload in widget. When `true` the audio and video inputs will be muted by default. (This means there currently is no way to start without muted video if one wants to skip the lobby. Also not in widget mode.) |
0 commit comments