|
|
1 year ago | |
|---|---|---|
| .. | ||
| bandwidth-estimation-from-disk | 1 year ago | |
| broadcast | 1 year ago | |
| custom-logger | 1 year ago | |
| data-channels | 1 year ago | |
| data-channels-detach | 1 year ago | |
| data-channels-flow-control | 1 year ago | |
| ice-restart | 1 year ago | |
| ice-single-port | 1 year ago | |
| ice-tcp | 1 year ago | |
| insertable-streams | 1 year ago | |
| internal | 1 year ago | |
| ortc | 1 year ago | |
| pion-to-pion | 1 year ago | |
| play-from-disk | 1 year ago | |
| play-from-disk-renegotiation | 1 year ago | |
| reflect | 1 year ago | |
| rtcp-processing | 1 year ago | |
| rtp-forwarder | 1 year ago | |
| rtp-to-webrtc | 1 year ago | |
| save-to-disk | 1 year ago | |
| save-to-disk-av1 | 1 year ago | |
| simulcast | 1 year ago | |
| stats | 1 year ago | |
| swap-tracks | 1 year ago | |
| trickle-ice | 1 year ago | |
| vnet | 1 year ago | |
| README.md | 1 year ago | |
| example.html | 1 year ago | |
| examples.go | 1 year ago | |
| examples.json | 1 year ago | |
| index.html | 1 year ago | |
We've built an extensive collection of examples covering common use-cases. You can modify and extend these examples to get started quickly.
For more full featured examples that use 3rd party libraries see our example-webrtc-applications repo.
We've made it easy to run the browser based examples on your local machine.
Build and run the example server:
GO111MODULE=on go get github.com/pion/webrtc/v3
git clone https://github.com/pion/webrtc.git $GOPATH/src/github.com/pion/webrtc
cd $GOPATH/src/github.com/pion/webrtc/examples
go run examples.go
Browse to localhost to browse through the examples. Note that you can change the port of the server using the --address flag:
go run examples.go --address localhost:8080
go run examples.go --address :8080 # listen on all available interfaces
Pion WebRTC can be used when compiled to WebAssembly, also known as WASM. In this case the library will act as a wrapper around the JavaScript WebRTC API. This allows you to use WebRTC from Go in both server and browser side code with little to no changes
Some of our examples have support for WebAssembly. The same examples server documented above can be used to run the WebAssembly examples. However, you have to compile them first. This is done as follows:
main.go file under the jsfiddle folder.Build this main.go file as follows:
GOOS=js GOARCH=wasm go build -o demo.wasm
Start the example server. Refer to the usage section for how you can build the example server.
Browse to localhost. The page should now give you the option to run the example using the WebAssembly binary.