diff --git a/docs/controls.md b/docs/controls.md index 7a456337..b8fe74d9 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -12,7 +12,7 @@ A few aspects of Element Call's interface can be controlled through a global API 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;}[]): void` Sets the list of available audio outputs. `forEarpiece` is used on ios only. +- `controls.setAvailableOutputDevices(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. 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) | undefined` Callback called whenever the user or application selects a new audio output. - `controls.setOutputDevice(id: string): void` Sets the selected audio device in EC menu. This should be used if the os decides to automatically switch to bluetooth. diff --git a/src/controls.ts b/src/controls.ts index bf249ab1..45bf54a7 100644 --- a/src/controls.ts +++ b/src/controls.ts @@ -24,7 +24,7 @@ export interface OutputDevice { forEarpiece?: boolean; isEarpiece?: boolean; isSpeaker?: boolean; - isBluetooth?: boolean; + isExternalHeadset?: boolean; } export const setPipEnabled$ = new Subject(); diff --git a/src/livekit/MediaDevicesContext.tsx b/src/livekit/MediaDevicesContext.tsx index 0dc1df20..506f069f 100644 --- a/src/livekit/MediaDevicesContext.tsx +++ b/src/livekit/MediaDevicesContext.tsx @@ -328,9 +328,9 @@ function useControlledOutput(): MediaDeviceHandle { map((devices) => { const deviceForEarpiece = devices.find((d) => d.forEarpiece); const deviceMapTuple: [string, DeviceLabel][] = devices.map( - ({ id, name, isEarpiece, isSpeaker /*,isBluetooth*/ }) => { + ({ id, name, isEarpiece, isSpeaker /*,isExternalHeadset*/ }) => { let deviceLabel: DeviceLabel = { type: "name", name }; - // if (isBluetooth) // Do we want this? + // if (isExternalHeadset) // Do we want this? if (isEarpiece) deviceLabel = { type: "earpiece" }; if (isSpeaker) deviceLabel = { type: "default", name }; return [id, deviceLabel];