tauri-plugin-webrtc WebRTC for Tauri on Linux GitHub

Web APIs

The shim installs the WebRTC classes on window with W3C shapes and event ordering. This page lists what each one does and where it differs from a browser.

Installed classes

RTCPeerConnection (also as webkitRTCPeerConnection), RTCSessionDescription, RTCIceCandidate, RTCDataChannel, RTCPeerConnectionIceEvent, RTCDataChannelEvent, RTCTrackEvent, RTCRtpSender, RTCRtpReceiver, RTCRtpTransceiver, RTCDTMFSender, RTCDTMFToneChangeEvent and RTCRtpScriptTransform. Worker is wrapped so that transform workers get RTCRtpScriptTransformer.

RTCPeerConnection

MemberNotes
createOffer, createAnswer, setLocalDescription, setRemoteDescriptionFull JSEP, including pranswer, explicit rollback and the implicit rollback that perfect negotiation relies on. An offer on an unchanged session is still an offer. A local description may be re-serialised (line order, candidates, codec parameters) but not edited structurally.
addIceCandidate, icecandidateTrickle both ways, end-of-candidates, mDNS .local candidates
restartIce()The next offer restarts ICE
addTrack, removeTrack, addTransceiver, getTransceivers, getSenders, getReceiversW3C transceiver reuse and association with remote media sections; msid stream ids
createDataChannel, datachannelSee below
getStats()Candidate pairs, candidates and transport (with tlsGroup) from the engine; inbound-rtp and outbound-rtp from the shim's media pipes. A track selector filters by kind.
State attributes and eventsSignalling, ICE gathering, ICE connection and connection states, with their *statechange events; negotiationneeded; canTrickleIceCandidates
getConfiguration, setConfigurationsetConfiguration records new iceServers for getConfiguration; the engine keeps the servers it was created with
sctpmaxMessageSize 262144 bytes
generateCertificate()Rejects with NotSupportedError. Each connection has its own ECDSA P-256 certificate.

Configuration

iceServers (stun:, turn: with ?transport=udp|tcp, turns:), iceTransportPolicy and bundlePolicy behave as in browsers. One member is not W3C: postQuantum, on Post-quantum.

RTCDataChannel

Senders, receivers and transceivers

Codecs

Audio is Opus. Video is VP8 always, and H.264 when WebCodecs in the webview can encode and decode it; the shim probes that before the first offer. Encoding runs in the page, so the webview's WebCodecs decides what is available.

Simulcast

A sender given several sendEncodings sends one layer: the active encoding with the least downscaling. SFUs such as LiveKit accept that and forward it to every subscriber.

RTCDTMFSender

insertDTMF(tones, duration, interToneGap), toneBuffer, canInsertDTMF and tonechange, as in the spec. Tones go out as RFC 4733 telephone events; a comma pauses for two seconds.

Encoded transforms

RTCRtpScriptTransform, the WebKit and Firefox shape of insertable streams, on senders and receivers for audio and video. Construct it with a Worker; the worker receives rtctransform events with readable and writable streams of RTCEncodedVideoFrame and RTCEncodedAudioFrame. LiveKit's end-to-end encryption runs through it unchanged.

Under a CSP that forbids blob: workers, the shim withdraws RTCRtpScriptTransform instead of letting media stall. See CSP and frames.

Not yet