Book Image

Getting Started with WebRTC

By : Rob Manson
Book Image

Getting Started with WebRTC

By: Rob Manson

Overview of this book

WebRTC delivers web-based real-time communication and is set to revolutionize our view of what the Web really is. Streaming audio and video from browser to browser, as well as opening raw access to the camera and microphone, is already creating a whole new dynamic web. WebRTC also introduces real-time data channels that will allow interaction with dynamic data feeds from sensors and other devices. This really is a great time to be a web developer! Getting Started with WebRTC provides all of the practical information you need to quickly understand what WebRTC is, how it works, and how you can add it to your own web applications. It includes clear working examples designed to help you get started building your own WebRTC-enabled applications right away. Getting Started with WebRTC will guide you through the process of creating your own WebRTC application that can be applied in a number of different real-world situations, using well documented and clearly explained code examples. You will learn how to quickly and easily create a practical peer-to-peer video chat application, an audio only call option, and how a Web-Socket-based signaling server can also be used to enable real-time text-based chat. You will also be shown how this same server and application structure can easily be extended to include simple drag-and-drop file sharing with transfer updates and thumbnail previews.
Table of Contents (15 chapters)
Getting Started with WebRTC
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

MediaStream API


The MediaStream API is designed to allow you to access streams of media from local input devices, such as cameras and microphones. It was initially focused upon the getUserMedia API or gUM for short, but has now been formalized as the broader media capture and streams API, or MediaStream API for short. However, the getUserMedia() method is still the primary way to initiate access to local input devices.

Each MediaStream object can contain a number of different MediaStreamTrack objects that each represents different input media, such as video or audio from different input sources.

Each MediaStreamTrack can then contain multiple channels (for example, the left and right audio channels). These channels are the smallest units that are defined by the MediaStream API.

MediaStream objects can then be output in two key ways. First, they can be used to render output into a MediaElement such as a <video> or <audio> element (although the latter may require pre-processing...