WebRTC samples

This is a repository for the WebRTC Javascript code samples. The source for these samples is available at github.com/Temasys/Google-WebRTC-Samples.

It is originally a fork of github.com/webrtc/samples, but updated to integrate the Temasys Plugin, and work on Internet Explorer and Safari.

Some of the samples use new browser features. They may only work in Chrome Canary, Firefox Beta, Microsoft Edge (available with Windows 10), and latest versions of the Temasys Plugin and may require flags to be set.

Most of the samples use AdapterJS, a shim to insulate apps from spec changes and prefix differences. (In fact, the standards and protocols used for WebRTC implementations are highly stable, and there are only a few prefixed names. For full interop information, see webrtc.org/web-apis/interop, and plugin.temasys.com.sg.)

In Chrome and Opera, all samples that use getUserMedia() must be run from a server. Calling getUserMedia() from a file:// URL will work in Firefox and the Temasys Plugin, but fail silently in Chrome and Opera.

The demos


Basic getUserMedia demo

Use getUserMedia with canvas

Use getUserMedia and play the video in a canvas

Use getUserMedia with canvas and CSS filters

Choose camera resolution

Audio-only getUserMedia() output to local audio element

Audio-only getUserMedia() displaying volume

Face tracking, using getUserMedia and canvas

Record stream

getUserMedia in an iFrame



Choose camera, microphone and speaker

Choose media source and audio output

Choose screen/window shared


Basic peer connection demo

Audio-only peer connection demo

Multiple peer connections at once

Forward the output of one PC into another

Munge SDP parameters

Use pranswer when setting up a peer connection

Constraints and stats

Display createOffer output for various scenarios


Display peer connection states

ICE candidate gathering from STUN/TURN servers

Do an ICE restart

Web Audio output as input to peer connection

Peer connection as input to Web Audio


Transmit text

Transfer a file

Transfer data

ArrayBuffer sending

Video chat

AppRTC video chat client powered by Google App Engine

AppRTC URL parameters