github.com/pion/webrtc/v3@v3.2.24/examples/broadcast/README.md (about) 1 # broadcast 2 broadcast is a Pion WebRTC application that demonstrates how to broadcast a video to many peers, while only requiring the broadcaster to upload once. 3 4 This could serve as the building block to building conferencing software, and other applications where publishers are bandwidth constrained. 5 6 ## Instructions 7 ### Download broadcast 8 ``` 9 export GO111MODULE=on 10 go get github.com/pion/webrtc/v3/examples/broadcast 11 ``` 12 13 ### Open broadcast example page 14 [jsfiddle.net](https://jsfiddle.net/us4h58jx/) You should see two buttons `Publish a Broadcast` and `Join a Broadcast` 15 16 ### Run Broadcast 17 #### Linux/macOS 18 Run `broadcast` OR run `main.go` in `github.com/pion/webrtc/examples/broadcast` 19 20 ### Start a publisher 21 22 * Click `Publish a Broadcast` 23 * Press `Copy browser SDP to clipboard` or copy the `Browser base64 Session Description` string manually 24 * Run `curl localhost:8080/sdp -d "$BROWSER_OFFER"`. `$BROWSER_OFFER` is the value you copied in the last step. 25 * The `broadcast` terminal application will respond with an answer, paste this into the second input field in your browser. 26 * Press `Start Session` 27 * The connection state will be printed in the terminal and under `logs` in the browser. 28 29 ### Join the broadcast 30 * Click `Join a Broadcast` 31 * Copy the string in the first input labelled `Browser base64 Session Description` 32 * Run `curl localhost:8080/sdp -d "$BROWSER_OFFER"`. `$BROWSER_OFFER` is the value you copied in the last step. 33 * The `broadcast` terminal application will respond with an answer, paste this into the second input field in your browser. 34 * Press `Start Session` 35 * The connection state will be printed in the terminal and under `logs` in the browser. 36 37 You can change the listening port using `-port 8011` 38 39 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. 40 41 Congrats, you have used Pion WebRTC! Now start building something cool