Matrix clients
The plugin was built for Matrix clients packaged with Tauri. Tchap, the French government's messenger, is the worked example: its whole integration is three small changes.
The Tchap integration
1. Dependency, Linux only
# src-tauri/Cargo.toml
[target.'cfg(target_os = "linux")'.dependencies]
# WebKitGTK ships without WebRTC; the plugin supplies it through a native engine.
# Pure Rust throughout: TURN over TLS with RustCrypto, and post-quantum key
# agreement (X25519MLKEM768) with moduletto.
tauri-plugin-webrtc = { git = "https://github.com/crabnebula-dev/tauri-plugin-webrtc", branch = "main",
default-features = false, features = ["turn-tls-rustcrypto", "pq-moduletto"] }
2. Plugin, Linux only
// src-tauri/src/lib.rs
#[cfg(target_os = "linux")]
{
builder = builder.plugin(tauri_plugin_webrtc::init());
}
3. Capability, Linux only
// src-tauri/capabilities/linux.json
{
"identifier": "linux-capability",
"platforms": ["linux"],
"windows": ["main"],
"permissions": ["webrtc:default"]
}
No web code changes. The Element Web code inside Tchap sees RTCPeerConnection and enables calls.
What works
| Call type | Path | Tested |
|---|---|---|
| 1:1 voice and video | matrix-js-sdk MatrixCall, peer to peer or through TURN | The app and Chromium as two users on a Synapse fixture, calls in both directions with audio and video checked |
| Group calls | Element Call widget, LiveKit SFU | The app and Chromium in one LiveKit room, plain and with end-to-end encryption, also from an iframe |
| Screen share | getDisplayMedia track on a sender | A screen-share renegotiation inside the 1:1 call test; sent at up to 1080p and 15 fps |
The harnesses drive Tchap builds that carry a small test hook; see Testing. A full manual check in the Element Web interface, with echo, controls and three-person Element Call rooms, is still open.
What matters to a Matrix client
- msid. matrix-js-sdk keys its
sdp_stream_metadataon the stream ids ina=msid. The engine writes the page's stream and track ids. - Re-serialised descriptions. matrix-js-sdk rewrites every local description before setting it. The engine accepts that and refuses only structural edits.
- Perfect negotiation and glare. Implicit rollback resolves simultaneous offers.
- TURN from the homeserver.
/voip/turnServercredentials work over UDP, TCP and TLS. - End-to-end encryption. LiveKit's E2EE worker runs through
RTCRtpScriptTransformin the Element Call iframe. - Echo cancellation. The engine runs AEC3 against the mix it plays out, as a browser does. Its unit test removes a simulated echo; a check with real speakers and a room is part of the open manual check.
Other Tauri apps
Nothing here is specific to Matrix. Any page that uses the standard API works the same way: a LiveKit client, a WebRTC data channel app, or a SIP-over-WebSocket softphone that needs DTMF.