Free Sample
+ Collection

Getting Started with WebRTC

Rob Manson

If you have basic HTML and JavaScript, you’re well on the way to adding real time, peer-to-peer communication to your web applications using WebRTC. This book shows you how through a totally practical, structured course.
RRP $19.99
RRP $32.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782166306
Paperback114 pages

About This Book

  • Set up video calls easily with a low bandwidth audio only option using WebRTC
  • Extend your application using real-time text-based chat, and collaborate easily by adding real-time drag-and-drop file sharing
  • Create your own fully working WebRTC application in minutes

Who This Book Is For

This book is ideal for developers new to the WebRTC standards who are interested in adding sensor-driven, real-time, peer-to-peer communication to their web applications. You will only need basic experience with HTML and JavaScript.

Table of Contents

Chapter 1: An Introduction to Web-based Real-Time Communication
Introducing WebRTC
Uses for WebRTC
Try WebRTC yourself right now!
Browser compatibility
Chapter 2: A More Technical Introduction to Web-based Real-Time Communication
Setting up communication
MediaStream API
RTCPeerConnection API
RTCDataChannel API
Chapter 3: Creating a Real-time Video Call
Setting up a simple WebRTC video call
Using a web server to connect two users
Setting up a signaling server
Creating an offer in the caller's browser
Creating an answer in the callee's browser
Previewing the local video streams
Establishing peer-to-peer streams
Stream processing options
Extending this example into a Chatroulette app
Chapter 4: Creating an Audio Only Call
Setting up a simple WebRTC audio only call
The HTML user interface for audio only calls
Adding an audio only flow to the signaling server
Audio stream processing options
Chapter 5: Adding Text-based Chat
Adding text-based chat to our video chat app
The HTML user interface for text-based chat
Adding JavaScript functions to enable chatting
Handling text-based chat signals on the server
Other text message processing options
Chapter 6: Adding File Sharing
Adding file sharing to our video chat app
The HTML user interface for file sharing
Adding JavaScript for enabling file sharing
Adding files using the <input> element
Adding support for drag-and-drop
Adding JavaScript for transferring files via WebSockets
Handling the file-sharing signals on the server
Sending a thumbnail preview before the entire file
Providing progress updates
Establishing an RTCDataChannel connection
Transfering files via an RTCDataChannel connection
Other file-sharing options
Chapter 7: Example Application 1 – Education and E-learning
Applying WebRTC for education and e-learning
Overall application architecture
Potential issues that may be faced
Benefits that can be delivered
The opportunity for educators
Chapter 8: Example Application 2 – Team Communication
Applying WebRTC for team communication
Overall application architecture
Potential issues that may be faced
Benefits that can be delivered
The opportunity for managers

What You Will Learn

  • Discover how to offer an audio only option as an alternative
  • Create an extensible Web Socket signaling server
  • Detect which browsers support WebRTC
  • Extend your application with real-time text-based chat
  • Add rich collaboration with drag-and-drop file sharing
  • Use RTCDataChannels to share real-time data
  • Design a state-based user interface for WebRTC apps
  • Explore the options available for image and audio post-processing and analysis

In Detail

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.


Read More