play-from-disk-renegotiation demonstrates Pion WebRTC's renegotiation abilities.
For a simpler example of playing a file from disk we also have examples/play-from-disk
This example requires you to clone the repo since it is serving static HTML.
mkdir -p $GOPATH/src/github.com/pion
cd $GOPATH/src/github.com/pion
git clone https://github.com/pion/webrtc.git
cd webrtc/examples/play-from-disk-renegotiation
ffmpeg -i $INPUT_FILE -g 30 output.ivf
The output.ivf
you created should be in the same directory as play-from-disk-renegotiation
. Execute go run *.go
Open http://localhost:8080 and you should have a Add Track
and Remove Track
button. Press these to add as many tracks as you want, or to remove as many as you wish.
Congrats, you have used Pion WebRTC! Now start building something cool