github.com/pion/webrtc/v4@v4.0.1/examples/swap-tracks/README.md (about)

     1  # swap-tracks
     2  swap-tracks demonstrates how to swap multiple incoming tracks on a single outgoing track.
     3  
     4  ## Instructions
     5  ### Download swap-tracks
     6  ```
     7  go install github.com/pion/webrtc/v4/examples/swap-tracks@latest
     8  ```
     9  
    10  ### Open swap-tracks example page
    11  [jsfiddle.net](https://jsfiddle.net/1rx5on86/) you should see two text-areas and two buttons: `Copy browser SDP to clipboard`, `Start Session`.
    12  
    13  ### Run swap-tracks, with your browsers SessionDescription as stdin
    14  In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually.
    15  We will use this value in the next step.
    16  
    17  #### Linux/macOS
    18  Run `echo $BROWSER_SDP | swap-tracks`
    19  #### Windows
    20  1. Paste the SessionDescription into a file.
    21  1. Run `swap-tracks < my_file`
    22  
    23  ### Input swap-tracks's SessionDescription into your browser
    24  Copy the text that `swap-tracks` just emitted and copy into second text area
    25  
    26  ### Hit 'Start Session' in jsfiddle, enjoy your video!
    27  Your browser should send streams to Pion, and then a stream will be relayed back, changing every 5 seconds.
    28  
    29  Congrats, you have used Pion WebRTC! Now start building something cool