Skip to main content

Class: BrowserWebrtcMedia

The default browser WebRTC backend: capture the mic, answer the server's offer (non-trickle ICE), and play the remote audio through a hidden <audio> element. A-law (PCMA) passthrough is negotiated by the server's offer.

Implements

Constructors

new BrowserWebrtcMedia()

new BrowserWebrtcMedia(iceServers): BrowserWebrtcMedia

Parameters

iceServers

RTCIceServer[] = []

fallback ICE servers; the per-call answer(offer, iceServers) argument (from CallState.ice_servers) takes precedence when provided.

Returns

BrowserWebrtcMedia

Methods

answer()

answer(offer, iceServers?): Promise<string>

Consume the server's SDP offer and return the client's SDP answer, starting audio. Called once per call.

Parameters

offer

string

iceServers?

RTCIceServer[]

STUN/TURN servers the server advertised on the call (CallState.ice_servers) — for off-host NAT traversal; empty in the in-cluster/LAN case.

Returns

Promise<string>

Implementation of

Media.answer


close()

close(): Promise<void>

Tear down the peer (idempotent).

Returns

Promise<void>

Implementation of

Media.close