|
|
1 год назад | |
|---|---|---|
| .. | ||
| jsfiddle | 1 год назад | |
| README.md | 1 год назад | |
| main.go | 1 год назад | |
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.
export GO111MODULE=on
go get github.com/pion/webrtc/v3/examples/broadcast
jsfiddle.net You should see two buttons Publish a Broadcast and Join a Broadcast
Run broadcast OR run main.go in github.com/pion/webrtc/examples/broadcast
Publish a BroadcastCopy browser SDP to clipboard or copy the Browser base64 Session Description string manuallycurl localhost:8080/sdp -d "$BROWSER_OFFER". $BROWSER_OFFER is the value you copied in the last step.broadcast terminal application will respond with an answer, paste this into the second input field in your browser.Start Sessionlogs in the browser.Join a BroadcastBrowser base64 Session Descriptioncurl localhost:8080/sdp -d "$BROWSER_OFFER". $BROWSER_OFFER is the value you copied in the last step.broadcast terminal application will respond with an answer, paste this into the second input field in your browser.Start Sessionlogs in 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