mirror of
https://github.com/vector-im/element-call.git
synced 2026-01-18 02:32:27 +00:00
1.8 KiB
1.8 KiB
Global JS controls
A few aspects of Element Call's interface can be controlled through a global API on the window.
Picture-in-picture
controls.canEnterPip(): booleanDetermines whether it's possible to enter picture-in-picture mode.controls.enablePip(): voidPuts the call interface into picture-in-picture mode. Throws if not in a call.controls.disablePip(): voidTakes the call interface out of picture-in-picture mode, restoring it to its natural display mode. Throws if not in a call.
Audio output devices
These functions must be used in conjunction with the controlledOutput URL parameter in order to have any effect.
controls.setAvailableOutputDevices(devices: { id: string, name: string, forEarpiece?: boolean, isEarpiece?: boolean isSpeaker?: boolean, isBluetooth?, boolean;}[]): voidSets the list of available audio outputs.forEarpieceis used on ios only. It flags the device that should be used if the user selects earpiece mode. This should be the main stereo loudspeaker of the device.controls.onOutputDeviceSelect: ((id: string) => void) | undefinedCallback called whenever the user or application selects a new audio output.controls.setOutputDevice(id: string): voidSets the selected audio device in EC menu. This should be used if the os decides to automatically switch to bluetooth.controls.setOutputEnabled(enabled: boolean)Enables/disables all audio output from the application. This can be useful for temporarily pausing audio while the controlling application is switching output devices. Output is enabled by default.showNativeOutputDevicePicker: () => void. This callback will be code by the webview if the user presses the output button in the settings menu. This button is only shown on ios. (userAgent.includes("IPhone"))