Native SDKs
Basic connectors for publishing/receiving audio/video and sending peer data. Use one audio track and one primary video track as the interoperability baseline. The SDK is not a replacement for the VDO.Ninja application.
| Language | Code and runnable examples |
|---|---|
| Rust | Rust SDK · audio/video demo |
| Go | Go SDK |
| C | C SDK |
| Python | Python SDK |
| Dart / Flutter | Flutter SDK |
| Kotlin / Java | Android SDK |
| Swift | Swift SDK |
Basic audio/video demo
Install FFmpeg for the test publisher, then run from the repository root:
# Publish a test pattern and tone; open the printed WATCH link.
cargo run --manifest-path rust/Cargo.toml --example av -- --publish my_unique_camera
# Receive browser audio/video to files; open the printed PUBLISH FROM BROWSER link.
cargo run --manifest-path rust/Cargo.toml --example av -- --view my_unique_browser --out received
# Both directions.
cargo run --manifest-path rust/Cargo.toml --example av -- --publish my_unique_camera --view my_unique_browser --out received
Use unique IDs. Allow camera/microphone access in the browser. Ctrl-C sends native bye and finalizes recordings. This example supports one viewing peer at a time; closing and replacing that viewer leaves publishing and recording running.
SDK integration checklist
- Establish the data connection first. Exchange native
infoand preferences on the open control channel before negotiating media. Legacy no-data-channel paths are outside SDK scope. - Match existing message shapes, types, peer/session IDs and offer ownership. No custom greetings, goodbye messages, fields or handshake acknowledgements.
- Use the handshake WebSocket only for supported SDK signaling. No application data, media, files, telemetry or application-data fallback. Use peer data channels.
- Never join a room, collect its listing and disconnect solely to enumerate users;
do not poll that sequence. For page/room status integrations, use the documented
VDO.Ninja
?apioption or iframe interface. - Keep one cancellable retry per stream. Preserve bounded reconnect backoff and the normal unavailable-stream retry interval; do not add tight polling loops, duplicate sockets or counter resets to bypass limits. Stop/disconnect must cancel retries and prevent late callbacks from restoring stopped intent.
- Preserve native bye delivery and cleanup. The handshake server has no room
leaverequest. Native ports leave by closing their signaling connection. - Keep default, disabled and literal passwords distinct. Follow the implementation and shared test cases, not truthiness conversions.
- Test actual audio/video in both directions. An open data channel alone is not a media test. Do not infer extra-track support from an engine accepting track arrays.
Password inputs
Pass original password text to SDK options. Omitted/empty SDK passwords use the
shared default; only an explicit disable option disables password protection.
SDK strings "false", "0" and "off" are literal passwords, while those ordinary
browser URL values disable protection. An empty browser password parameter prompts.
Use the generated demo links, and keep salt and the complete signaling endpoint
consistent on both peers. Do not encode passwords again during join/reconnect.
For the Rust demo, VDONINJA_PASSWORD sets the password, --no-password explicitly
disables password protection, and --salt selects the salt. Printed private-password
links contain the password. The shared default is not a private secret.
Code and tests
The VDO.Ninja application is authoritative. Check its relevant handler and
hss/gemini.js; SDK behavior and server acceptance alone do not establish
correct usage. Do not copy behavior that violates the handshake checklist.
| Check | Starting point |
|---|---|
| JS reference and regressions | SDK, review tests, cancellation tests |
| Password inputs and native browser links | shared cases, URL tests |
| Signaling boundaries and actual server routing | protocol guards, Gemini tests |
| Data-first handshake, A/V, viewer replacement and bye | Rust browser test, native integration tests |
| Retry deduplication and cancellation | Rust tests, Go tests, Python tests, C tests |
Use local fixtures for retry/failure tests. Report unavailable engine coverage; do not claim that an SDK-to-SDK test proves native-browser compatibility. See test commands and each port's README.
License and hosted services
SDK core code is MPL-2.0; see LICENSING.md. Hosted services have separate usage rules and limits. Use the SDK's supported signaling paths.
Protocol audit and migration
The VDO.Ninja application is the source of truth. See the validated audit and migration notes for the reviewed source revision and browser interoperability checks. Removed unsupported identity options (client_id, ClientID, clientId) and WebSocket application-data fallback options must be removed from callers. Rebuild C applications after the struct changes. Custom signaling URLs use routed UUID, not fan-out from. Application data requires an open data channel.
Relay lists follow the browser fallback data. Automatic credentials expire and refresh. Custom discovery URLs preserve their query parameters. The C backend does not implement TURN TCP/TLS; force_tcp fails with EINVAL. Python's aiortc backend cannot enforce relay-only candidate policy through the current API.