Getting Started with WebRTC
By Rob Manson
()
About this ebook
Related to Getting Started with WebRTC
Related ebooks
WebRTC Blueprints Rating: 0 out of 5 stars0 ratingsLearning WebRTC Rating: 0 out of 5 stars0 ratingsWebSocket Essentials – Building Apps with HTML5 WebSockets Rating: 0 out of 5 stars0 ratingsNode.js By Example Rating: 2 out of 5 stars2/5Node Web Development, Second Edition Rating: 0 out of 5 stars0 ratingsPractical XMPP Rating: 0 out of 5 stars0 ratingsMonitoring Docker Rating: 0 out of 5 stars0 ratingsJasmine JavaScript Testing - Second Edition Rating: 0 out of 5 stars0 ratingsDeploying Node.js Rating: 5 out of 5 stars5/5Learning .NET High-performance Programming Rating: 0 out of 5 stars0 ratingsDart Essentials Rating: 0 out of 5 stars0 ratingsGetting Started with React Native Rating: 4 out of 5 stars4/5Learning Behavior-driven Development with JavaScript Rating: 5 out of 5 stars5/5Hands-On Network Programming with C# and .NET Core: Build robust network applications with C# and .NET Core Rating: 0 out of 5 stars0 ratingsExpress Web Application Development Rating: 3 out of 5 stars3/5ASP.NET Core 3 and React: Hands-On full stack web development using ASP.NET Core, React, and TypeScript 3 Rating: 0 out of 5 stars0 ratingsApache Solr PHP Integration Rating: 0 out of 5 stars0 ratingsOpa Application Development Rating: 0 out of 5 stars0 ratingsPractical OneOps Rating: 0 out of 5 stars0 ratingsWebRTC Cookbook Rating: 0 out of 5 stars0 ratingsWebRTC Integrator's Guide Rating: 5 out of 5 stars5/5CORS Essentials Rating: 0 out of 5 stars0 ratingsHTML5 for .NET Developers: Single page web apps, JavaScript, and semantic markup Rating: 0 out of 5 stars0 ratingsOpenCart Theme and Module Development Rating: 0 out of 5 stars0 ratingsWebRTC: APIs and RTCWEB Protocols of the HTML5 Real-Time Web, Third Edition Rating: 5 out of 5 stars5/5Concurrency in .NET: Modern patterns of concurrent and parallel programming Rating: 0 out of 5 stars0 ratingsGetting Started with Grunt: The JavaScript Task Runner Rating: 3 out of 5 stars3/5Mastering Web Application Development with Express Rating: 0 out of 5 stars0 ratingsPHP in Action: Objects, Design, Agility Rating: 4 out of 5 stars4/5
Programming For You
Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Python: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Web Designer's Idea Book, Volume 4: Inspiration from the Best Web Design Trends, Themes and Styles Rating: 4 out of 5 stars4/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5C Programming for Beginners: Your Guide to Easily Learn C Programming In 7 Days Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Unity from Zero to Proficiency (Beginner): Unity from Zero to Proficiency, #2 Rating: 5 out of 5 stars5/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsPython QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsPython Projects for Beginners: A Ten-Week Bootcamp Approach to Python Programming Rating: 0 out of 5 stars0 ratings
Reviews for Getting Started with WebRTC
0 ratings0 reviews
Book preview
Getting Started with WebRTC - Rob Manson
Table of Contents
Getting Started with WebRTC
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. An Introduction to Web-based Real-Time Communication
Introducing WebRTC
Uses for WebRTC
Try WebRTC yourself right now!
Browser compatibility
Chrome and Firefox on the PC
Chrome and Firefox on Android
Opera
Microsoft
Apple
Staying up-to-date
Summary
2. A More Technical Introduction to Web-based Real-Time Communication
Setting up communication
The general flow
Connect users
Start signals
Find candidates
Negotiate media sessions
Start RTCPeerConnection streams
Using WebSockets
Other signaling options
MediaStream API
RTCPeerConnection API
The caller's flow
Register the onicecandidate handler
Register the onaddstream handler
Register the message handler
Use getUserMedia to access the local camera
The JSEP offer/answer process
The callee's flow
Register the onicecandidate handler
Register the onaddstream handler
Register the message handler
Use getUserMedia to access the local camera
The JSEP offer/answer process
Where does RTCPeerConnection sit?
RTCDataChannel API
Summary
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
Summary
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
Summary
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
Summary
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 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
Summary
7. Example Application 1 – Education and E-learning
Applying WebRTC for education and e-learning
Overall application architecture
Educators
Students
WebRTC capable browser
Existing or new web application
Signaling server
TURN server
Archive server
Potential issues that may be faced
Privacy
Copyright and intellectual property
Restrictive networks
Restrictive SOEs
Outdated student browsers
Interoperability
Benefits that can be delivered
The opportunity for educators
Summary
8. Example Application 2 – Team Communication
Applying WebRTC for team communication
Overall application architecture
Managers
Team members
WebRTC capable browser
New and existing web applications
Signaling server
TURN server
Messaging server
Potential issues that may be faced
Privacy
Data security
Restrictive networks
Restrictive SOEs
Interoperability
Timezones
Benefits that can be delivered
The opportunity for managers
Summary
Index
Getting Started with WebRTC
Getting Started with WebRTC
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2013
Production Reference: 1180913
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK..
ISBN 978-1-78216-630-6
www.packtpub.com
Cover Image by Suresh Mogre (<suresh.mogre.99@gmail.com>)
Credits
Author
Rob Manson
Reviewers
Todd Hunter
Alexandra Young
Acquisition Editor
Akram Hussain
Commissioning Editor
Shaon Basu
Technical Editors
Pratik More
Anusri Ramchandran
Project Coordinator
Akash Poojary
Proofreader
Clyde Jenkins
Indexers
Hemangini Bari
Mariammal Chettiyar
Graphics
Ronak Dhruv
Production Coordinator
Prachali Bhiwandkar
Cover Work
Prachali Bhiwandkar
About the Author
Rob Manson is the CEO and co-founder of buildAR.com, the world's leading Augmented Reality Content Management System. Rob is the Chairman of the W3C Augmented Web Community Group, and an Invited Expert with the ISO, W3C, and the Khronos Group. He is one of the co-founders of ARStandards.org and is an active evangelist within the global AR and standards communities. He is regularly invited to speak on the topics of the Augmented Web, Augmented Reality, WebRTC, and multi-device platforms.
I'd like to thank Alex, my wife and business partner—yes that's as crazy as it sounds! She's a great inspiration and always happy to put up with my creative ideas for using new technologies. She makes both my ideas and me as a person better in every way. I'd also like to thank Maggie and Todd for providing feedback and working with me on all our Multi-Device, WebRTC, and Augmented Web projects. I'm constantly amazed by just how much our team can achieve and you guys are the backbone that make this happen. I'm proud to say I work with you both.
About the Reviewers
Todd Hunter is a software developer with over 10 years experience of developing applications in a variety of industries. He is crazy enough to find his niche building interesting things with Perl, but with an eye for building things with the latest technologies. He has spent time in a wide range of companies, from the big multinationals to the smallest startups in industries ranging from large software companies, finance, to small high tech startups. He has a Bachelor's degree in Technology (Hons) and a Bachelor's degree in Applied Economics. He has a serious caffeine addiction.
Alexandra Young has been an innovator in User Experience across emerging technologies since the mid-90s. She led a team of designers and developers for one of Australia's largest telecommunications companies, responsible for defining the way in which people used products across Interactive TV, online, and mobile. For the last 6 years, Alex has worked on defining multi-device experiences for MOB (the research and development technology company she co-founded) on MOB's products, and complex platform developments for Enterprise, Government, and Cultural organizations. She is also an advocate for the Augmented Web, of which WebRTC is a critical component. Alex also speaks regularly at conferences on Augmented Reality, Mobile and Web Technologies, and User Experience.
Alexandra Young
CXO (Chief Experience Officer)
MOB-labs
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Preface
Getting Started with WebRTC provides all the practical information you need to quickly understand what WebRTC is, how it works, and