Get Audio Output Element
Web only
This method is only available in the JavaScript/TypeScript SDK.
Returns the HTMLAudioElement that the SDK uses to play remote call audio. Use this to control playback properties such as volume, or to route audio to a specific output device.
Signature
const audioElement = client.getAudioOutputElement();
Return Type
Returns HTMLAudioElement | undefined. Returns undefined if no active media session exists (i.e. no call is currently connected).
Usage Example
const audioElement = client.getAudioOutputElement();
if (audioElement) {
audioElement.volume = 0.5;
}Notes
- The element is created when media is first established and removed when the last active call ends
- To route audio to a specific output device, use the
setSinkIdAPI on the returned element (requires browser support)
Related Actions
getPeerConnection- Retrieve the underlying RTCPeerConnection for an active call