Some checks failed
REUSE Compliance Check / lint (push) Failing after 0s
Browser E2E / Test (push) Failing after 3s
Test / test (1.24) (push) Failing after 0s
Test / test-i386 (1.25) (push) Failing after 0s
Test / test-i386 (1.24) (push) Failing after 0s
Test / test-windows (1.25) (push) Failing after 0s
Test / test-windows (1.24) (push) Failing after 0s
Test / test (1.25) (push) Failing after 0s
Examples Tests / Test (push) Failing after 3s
Test / test-macos (1.25) (push) Failing after 0s
Test / test-macos (1.24) (push) Failing after 0s
Go mod tidy / tidy (push) Failing after 0s
Test / test-wasm (push) Failing after 0s
CodeQL / analyze (push) Failing after 1s
Fuzz / fuzz (push) Failing after 0s
broadcast
broadcast is a Pion WebRTC application that demonstrates how to broadcast a video to many peers, while only requiring the broadcaster to upload once.
This could serve as the building block to building conferencing software, and other applications where publishers are bandwidth constrained.
Instructions
Download broadcast
go install github.com/pion/webrtc/v4/examples/broadcast@latest
Open broadcast example page
jsfiddle.net You should see two buttons Publish a Broadcast and Join a Broadcast
Run Broadcast
Linux/macOS
Run broadcast OR run main.go in github.com/pion/webrtc/examples/broadcast
Start a publisher
- Click
Publish a Broadcast - Press
Copy browser SDP to clipboardor copy theBrowser base64 Session Descriptionstring manually - Run
curl localhost:8080 -d "$BROWSER_OFFER".$BROWSER_OFFERis the value you copied in the last step. - The
broadcastterminal application will respond with an answer, paste this into the second input field in your browser. - Press
Start Session - The connection state will be printed in the terminal and under
logsin the browser.
Join the broadcast
- Click
Join a Broadcast - Copy the string in the first input labelled
Browser base64 Session Description - Run
curl localhost:8080 -d "$BROWSER_OFFER".$BROWSER_OFFERis the value you copied in the last step. - The
broadcastterminal application will respond with an answer, paste this into the second input field in your browser. - Press
Start Session - The connection state will be printed in the terminal and under
logsin the browser.
You can change the listening port using -port 8011
You can Join the broadcast as many times as you want. The broadcast Golang application is relaying all traffic, so your browser only has to upload once.
Congrats, you have used Pion WebRTC! Now start building something cool