Getting Started
All examples can be run locally using the examples server:Access the examples
Browse to localhost to explore all available examples
Media API Examples
Examples demonstrating audio and video streaming capabilities:Media Streaming
Send video and audio from disk to your browser with frame-by-frame control
Save to Disk
Record webcam and microphone streams and save them as VP8/Opus files
Broadcast
Broadcast video to multiple peers with single upload using SFU pattern
RTP Forwarder
Forward audio/video streams via RTP to external applications
Simulcast
Accept and demux single track with 3 simulcast streams into separate tracks
Data Channel API Examples
Examples showing how to use WebRTC data channels for real-time data transfer:Data Channels
Send and receive DataChannel messages between browser and server
ORTC
Use the ORTC API for low-level DataChannel communication control
Key Features
WebAssembly Support
WebAssembly Support
Many Pion WebRTC examples support WebAssembly compilation, allowing you to use WebRTC from Go in both server and browser code with minimal changes.To compile an example for WebAssembly:The examples server will automatically detect and offer the WebAssembly option.
Signaling Pattern
Signaling Pattern
Most examples use a simple copy-paste signaling mechanism for demonstration purposes:
- Run the example application
- Paste the browser’s offer into the terminal
- Copy the answer from terminal to browser
Production applications should implement proper signaling using WebSockets, HTTP polling, or other real-time communication methods.
ICE Configuration
ICE Configuration
All examples use Google’s public STUN server by default:For production deployments, consider using your own STUN/TURN servers.