github.com/pion/webrtc/v4@v4.0.1/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  go install github.com/pion/webrtc/v4/examples/broadcast@latest
    10  ```
    11  
    12  ### Open broadcast example page
    13  [jsfiddle.net](https://jsfiddle.net/us4h58jx/) You should see two buttons `Publish a Broadcast` and `Join a Broadcast`
    14  
    15  ### Run Broadcast
    16  #### Linux/macOS
    17  Run `broadcast` OR run `main.go` in `github.com/pion/webrtc/examples/broadcast`
    18  
    19  ### Start a publisher
    20  
    21  * Click `Publish a Broadcast`
    22  * Press `Copy browser SDP to clipboard` or copy the `Browser base64 Session Description` string manually
    23  * Run `curl localhost:8080 -d "$BROWSER_OFFER"`. `$BROWSER_OFFER` is the value you copied in the last step.
    24  * The `broadcast` terminal application will respond with an answer, paste this into the second input field in your browser.
    25  * Press `Start Session`
    26  * The connection state will be printed in the terminal and under `logs` in the browser.
    27  
    28  ### Join the broadcast
    29  * Click `Join a Broadcast`
    30  * Copy the string in the first input labelled `Browser base64 Session Description`
    31  * Run `curl localhost:8080 -d "$BROWSER_OFFER"`. `$BROWSER_OFFER` is the value you copied in the last step.
    32  * The `broadcast` terminal application will respond with an answer, paste this into the second input field in your browser.
    33  * Press `Start Session`
    34  * The connection state will be printed in the terminal and under `logs` in the browser.
    35  
    36  You can change the listening port using `-port 8011`
    37  
    38  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.
    39  
    40  Congrats, you have used Pion WebRTC! Now start building something cool