One replaceable, send-only WebRTC peer for an Opus preview. The caller owns the peer and receives its ExWebRTC state changes. Capture has its own lifetime.
Summary
Functions
Answers a receive-only browser audio offer containing the browser's ICE candidates.
Stops the underlying WebRTC peer connection if it is still alive.
Sends one Opus RTP packet with separate per-peer sequence (wrapped mod
65_536) and 48 kHz media clock sample_index (wrapped mod 2^32).
Types
@type t() :: %MedEx.Preview{pid: pid(), track_id: ExWebRTC.MediaStreamTrack.id()}
Functions
Answers a receive-only browser audio offer containing the browser's ICE candidates.
The calling process owns the resulting ExWebRTC.PeerConnection and receives
{:ex_webrtc, peer.pid, {:connection_state_change, state}} messages (such as
:connected, :failed, and :closed). Call close/1 on teardown.
Options
:ice_servers— list of ICE server maps passed toExWebRTC.PeerConnection(defaults to[]for direct local candidates).
@spec close(t()) :: :ok
Stops the underlying WebRTC peer connection if it is still alive.
@spec send_opus(t(), binary(), non_neg_integer(), non_neg_integer()) :: :ok
Sends one Opus RTP packet with separate per-peer sequence (wrapped mod
65_536) and 48 kHz media clock sample_index (wrapped mod 2^32).