Advanced
Sample apps
Each program below is in the repository and builds with it. Run the
commands from a checkout of iroh-live.
Most of them print a ticket that irl watch <TICKET> plays.
Applications
| Program | What it shows | Run it |
|---|---|---|
irl | The command line tool: publish, watch, call, room, record, and a QR code scanner. Its source covers every feature of the library | cargo run -p iroh-live-cli -- publish, or download it |
| Video call tutorial | A desktop call app in one file, with an egui window, echo cancellation, and answer and hang-up buttons | Copy the program from the page into a new crate |
| Android demo | Watch, publish the camera, or run a two-way call on a phone. CameraX capture, MediaCodec, and zero-copy drawing | cargo make run-on-device in demos/android/, or install the APK from the release |
| Pi Zero demo | Publish a Raspberry Pi camera with the ticket on an e-paper display, or watch a stream on HDMI with GLES2 | Cross-compile with cargo make cross-build-aarch64 -- -p pi-zero-demo --release, see its README |
Examples
The examples in iroh-live/examples and
iroh-live-node/examples each show one part
of the API in one file.
| Example | What it shows | Run it |
|---|---|---|
publish | Publishes the default camera and microphone, and prints a ticket | cargo run -p iroh-live --features capture --example publish |
publish-file | Publishes an MP4 file in real time, as it is or re-encoded into renditions | cargo run -p iroh-live --features file --example publish-file -- clip.mp4 |
publish-pi | Publishes a Raspberry Pi camera with the Pi’s hardware H.264 encoder | Cross-compile with the rpicam feature, see Publish from a Raspberry Pi |
contacts_only | A node that admits only its contacts, and closes a session when a contact is removed | cargo run -p iroh-live --example contacts_only |
moq_only | A Node with a path scheme of its own, without LiveLayout | cargo run -p iroh-live --example moq_only |
delegated_publisher | A device that publishes into another account’s space with a delegated rcan chain | cargo run -p iroh-live-node --features rcan --example delegated_publisher |
iroh-live/examples/subscribe_test.rs is a test helper for the browser
end-to-end tests, not a sample.
Programs in the guides
Every guide page has a complete Rust program, and CI compiles each one. Copy one into a new crate with the dependencies of Rust quickstart.
Where to go next
- What can I use it for? links the guide for each use case.
- Crates and features describes each crate.