This page creates a broadcast called `me` by default. You can use query parameters to use a different broadcast name and create multiple broadcasts.
Reusing the same broadcast path means viewers will automatically reconnect to the new session. Try reloading the page and broadcasting again; viewers will automatically reconnect.
Media only flows over the network when requested! Connecting to a relay means the broadcast is advertised as available, but nothing is transferred until there's at least one viewer per track. If there's multiple viewers, the relay will fan out the media to all of them.
You can create a broadcaster via the provided <moq-publish> Web Component.
Either modify HTML attributes like <moq-publish source="camera" audio />
or access the element's Javascript API:
const publish = document.getElementById("publish");
publish.broadcast.audio.enabled.set(true);
And of course you can use the Javascript API directly instead of the Web Component.
It's a bit more complicated and subject to change, but it gives you more control.
You're not limited to web publishing either.
Try running just pub tos in a new terminal and then watch robots bang.
This uses ffmpeg to produce a fragmented MP4 file piped over stdout then sent over the network.
Yeah it's pretty gross.
If you want to do things more efficiently, you can use the Gstreamer plugin. It's pretty crude and doesn't handle all pipeline events; contributions welcome!
This demo uses `http://` so it's not secure. It works by fetching the certificate hash (via HTTP) and providing that to WebTransport, which requires HTTPS. To run this in production, you'll need a valid certificate (ex. letsencrypt) and to use `https://`.