WebRTC is a new front in the long war for an open and unencumbered web. Brendan Eich, inventor of JavaScript
Real-time communication without plugins
Client-side WebRTC code samples. To test your webcam, microphone and speakers we need permission to use them, approve by selecting “Allow”. About:webrtc in Firefox; chrome://webrtc-internals screenshot; Cross browser interop notes; adapter.js is a JavaScript shim for WebRTC maintained by Google with help from the WebRTC community that abstracts vendor prefixes, browser differences, and spec changes. To learn more about WebRTC signaling processes, check the appr.tc log output to the.
Imagine a world where your phone, TV, and computer could communicate on a common platform. Imagine it was easy to add video chat and peer-to-peer data sharing to your web app. That's the vision of WebRTC.
Want to try it out? WebRTC is available on desktop and mobile in Google Chrome, Safari, Firefox, and Opera. A good place to start is the simple video chat app at appr.tc:
- Open appr.tc in your browser.
- Click Join to join a chat room and let the app use your webcam.
- Open the URL displayed at the end of the page in a new tab or, better still, on a different computer.
Quick start
Haven't got time to read this article or only want code?
To get an overview of WebRTC, watch the following Google I/O video or view these slides:
- If you haven't used the
getUserMedia
API, see Capture audio and video in HTML5 and simpl.info getUserMedia. - To learn about the
RTCPeerConnection
API, see the following example and simpl.info RTCPeerConnection. - To learn how WebRTC uses servers for signaling, and firewall and NAT traversal, see the code and console logs from appr.tc.
- Can’t wait and just want to try WebRTC right now? Try some of the more-than 20 demos that exercise the WebRTC JavaScript APIs.
- Having trouble with your machine and WebRTC? Visit the WebRTC Troubleshooter.
Alternatively, jump straight into the WebRTC codelab, a step-by-step guide that explains how to build a complete video chat app, including a simple signaling server.
A very short history of WebRTC
One of the last major challenges for the web is to enable human communication through voice and video: real-time communication or RTC for short. RTC should be as natural in a web app as entering text in a text input. Without it, you're limited in your ability to innovate and develop new ways for people to interact.
Historically, RTC has been corporate and complex, requiring expensive audio and video technologies to be licensed or developed in house. Integrating RTC technology with existing content, data, and services has been difficult and time-consuming, particularly on the web.
Gmail video chat became popular in 2008 and, in 2011, Google introduced Hangouts, which uses Talk (as did Gmail). Google bought GIPS, a company that developed many components required for RTC, such as codecs and echo cancellation techniques. Google open sourced the technologies developed by GIPS and engaged with relevant standards bodies at the Internet Engineering Task Force (IETF) and World Wide Web Consortium (W3C) to ensure industry consensus. In May 2011, Ericsson built the first implementation of WebRTC.
WebRTC implemented open standards for real-time, plugin-free video, audio, and data communication. The need was real:
- Many web services used RTC, but needed downloads, native apps, or plugins. These included Skype, Facebook, and Hangouts.
- Downloading, installing, and updating plugins is complex, error prone, and annoying.
- Plugins are difficult to deploy, debug, troubleshoot, test, and maintain—and may require licensing and integration with complex, expensive technology. It's often difficult to persuade people to install plugins in the first place!
The guiding principles of the WebRTC project are that its APIs should be open source, free, standardized, built into web browsers, and more efficient than existing technologies.
Where are we now?
WebRTC is used in various apps, such as Google Meet. WebRTC has also been integrated with WebKitGTK+ and Qt native apps.
WebRTC implements these three APIs:
MediaStream
(also known asgetUserMedia
)
The APIs are defined in these two specs:
All three APIs are supported on mobile and desktop by Chrome, Safari, Firefox, Edge, and Opera.
getUserMedia
: For demos and code, see WebRTC samples or try Chris Wilson's amazing examples that use getUserMedia
as input for web audio.
RTCPeerConnection
: For a simple demo and a fully functional video-chat app, see WebRTC samples Peer connection and appr.tc, respectively. This app uses adapter.js, a JavaScript shim maintained by Google with help from the WebRTC community, to abstract away browser differences and spec changes.
RTCDataChannel
: To see this in action, see WebRTC samples to check out one of the
Developer tools
- WebRTC stats for an ongoing session can be found at:
- chrome://webrtc-internals in Chrome
- opera://webrtc-internals in Opera
- about:webrtc in Firefox
- Cross browser interop notes
- adapter.js is a JavaScript shim for WebRTC maintained by Google with help from the WebRTC community that abstracts vendor prefixes, browser differences, and spec changes.
- To learn more about WebRTC signaling processes, check the appr.tc log output to the console.
- If it's all too much, you may prefer to use a WebRTC framework or even a complete WebRTC service.
- Bug reports and feature requests are always appreciated:
Learn more
- Alan B. Johnston and Daniel C. Burnett maintain a WebRTC book now in its third edition in print and eBook formats at webrtcbook.com.
- webrtc.org is home to all things WebRTC, including demos, documentation, and discussion.
- discuss-webrtc is a Google Group for technical WebRTC discussion.
- Google Developers Talk documentation provides more information about NAT traversal, STUN, relay servers, and candidate gathering.
- Stack Overflow is a good place to look for answers and ask questions about WebRTC.
Standards and protocols
Webrtc Firefox Not Working
- W3C Editor's Draft: Media Capture and Streams (also known as
getUserMedia
) - IETF RTCWEB Working Group Internet-Draft: Web Real-Time Communication Use-cases and Requirements
WebRTC support summary
MediaStream
and getUserMedia
APIs
- Chrome desktop 18.0.1008 and higher; Chrome for Android 29 and higher
- Opera 18 and higher; Opera for Android 20 and higher
- Opera 12, Opera Mobile 12 (based on the Presto engine)
- Firefox 17 and higher
- Microsoft Edge 16 and higher
- Safari 11.2 and higher on iOS, and 11.1 and higher on MacOS
- UC 11.8 and higher on Android
- Samsung Internet 4 and higher
RTCPeerConnection
API
- Chrome desktop 20 and higher; Chrome for Android 29 and higher (flagless)
- Opera 18 and higher (on by default); Opera for Android 20 and higher (on by default)
- Firefox 22 and higher (on by default)
- Microsoft Edge 16 and higher
- Safari 11.2 and higher on iOS, and 11.1 and higher on MacOS
- Samsung Internet 4 and higher
RTCDataChannel
API
- Experimental version in Chrome 25, but more stable (and with Firefox interoperability) in Chrome 26 and higher; Chrome for Android 29 and higher
- Stable version (and with Firefox interoperability) in Opera 18 and higher; Opera for Android 20 and higher
- Firefox 22 and higher (on by default)
For more detailed information about cross-platform support for APIs, such as getUserMedia
and RTCPeerConnection
, see caniuse.com and Chrome Platform Status.
Native APIs for RTCPeerConnection
are also available at documentation on webrtc.org.
Snowflake is a system to defeat internet censorship. People who are censored can use Snowflake to access the internet. Their connection goes through Snowflake proxies, which are run by volunteers. For more detailed information about how Snowflake works see our documentation wiki.
Browser
If your internet access is censored, you should download Tor Browser.
Extension
If your internet access is not censored, you should consider installing the Snowflake extension to help users in censored networks. There is no need to worry about which websites people are accessing through your proxy. Their visible browsing IP address will match their Tor exit node, not yours.
Reporting Bugs
Webrtc Firefox Plugin
If you encounter problems with Snowflake as a client or a proxy, please consider filing a bug report. There are two ways to file a bug report:
- Request an account at the Tor Project GitLab, then open a new issue in the Snowflake project.
- File an anonymous ticket by generating an identifier and logging in with it. Then, find the Snowflake project in the List of all projects and create a new issue.
Please try to be as descriptive as possible with your ticket and if possible include log messages that will help us reproduce the bug.
Embed
It is now possible to embed the Snowflake badge on any website: