applySelectedAudioOutputDevice

View as MarkdownOpen in Claude
1applySelectedAudioOutputDevice(element): Promise<boolean>

Apply the currently selected audio output device to an HTMLMediaElement (e.g. the <audio> or <video> element the consumer attached the remote stream to). Uses HTMLMediaElement.setSinkId under the hood. Returns a Promise<boolean>: true if the sink was applied, false if the browser doesn’t support setSinkId or no device is selected.

Parameters

element
HTMLMediaElementRequired

HTML media element to route audio output to.

Returns

Promise<boolean>

Examples

1audioEl.srcObject = call.remoteStream;
2await client.applySelectedAudioOutputDevice(audioEl);