You are previewing Learning WebRTC.
O'Reilly logo
Learning WebRTC

Book Description

Develop interactive real-time communication applications with WebRTC

In Detail

The book begins by teaching you how to capture audio and video streams from the browser using the Media Capture and Streams API.

You will then create your first WebRTC application capable of audio and video calling. The book will also give you in-depth knowledge about signaling and building a signaling server in Node.js. While being introduced to the RTCDataChannel object, you will learn how it relates to WebRTC and how to add text-based chat to your application. You will also learn to take your application further by supporting multiple users through different technologies and scale its performance and security. This book will also cover several theories using full mesh networks, partial mesh networks, and multipoint control units. By the end of this book, you will have an extensive understanding of real-time communication and the WebRTC protocol and APIs.

What You Will Learn

  • Understand the underlying platform that WebRTC is built upon

  • Create applications that utilize your web camera and microphone

  • Build your very own signaling server from scratch

  • Enable your applications to communicate with multiple users

  • Share data and files across peer-to-peer connections using WebRTC

  • Implement best practices to secure and make a WebRTC application perform

  • Get to know more about multi-peer mesh networks for more than two users

  • Learn the best practices behind traversing networks, signaling, security, and data transport in WebRTC applications

  • Use full mesh networks, partial mesh networks, and multipoint control units to manage your applications

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Learning WebRTC
      1. Table of Contents
      2. Learning WebRTC
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Getting Started with WebRTC
        1. Audio and video communication today
        2. Enabling audio and video on the Web
          1. Camera and microphone capture
          2. Encoding and decoding audio and video
          3. Transportation layer
          4. Session management
        3. Creating web standards
          1. Browser support
            1. Compatibility with Chrome, Firefox, and Opera
            2. Compatibility with Android OS
            3. Compatibilty with Apple
            4. Compatibility with Internet Explorer
        4. Using WebRTC in your browser
        5. Applications enabled by WebRTC
        6. Self-test questions
        7. Summary
      9. 2. Getting the User's Media
        1. Getting access to media devices
          1. Setting up a static server
          2. Creating our first MediaStream page
        2. Constraining the media stream
          1. Constraining the video capture
        3. Handling multiple devices
          1. Creating a photo booth application
        4. Modifying the media stream
        5. Self-test questions
        6. Summary
      10. 3. Creating a Basic WebRTC Application
        1. Understanding UDP transport and real-time transfer
        2. The WebRTC API
          1. The RTCPeerConnection object
          2. Signaling and negotiation
          3. Session Description Protocol
          4. Finding a clear route to another user
            1. Session Traversal Utilities for NAT
            2. Traversal Using Relays around NAT
            3. Interactive Connectivity Establishment
        3. Building a basic WebRTC application
          1. Creating a RTCPeerConnection
          2. Creating the SDP offer and response answer
          3. Finding ICE candidates
          4. Adding streams and polishing
        4. Running your first WebRTC application
        5. Self-test questions
        6. Summary
      11. 4. Creating a Signaling Server
        1. Building a signaling server
        2. Setting up our environment
        3. Getting a connection
          1. Testing our server
        4. Identifying users
        5. Initiating a call
        6. Answering a call
        7. Handling ICE candidates
        8. Hanging up a call
        9. Complete signaling server
        10. Signaling in the real world
          1. The woes of WebSockets
          2. Connecting with other services
            1. XMPP
            2. Session Initiation Protocol
        11. Self-test questions
        12. Summary
      12. 5. Connecting Clients Together
        1. The client application
        2. Setting up the page
        3. Getting a connection
        4. Logging in to the application
          1. Starting a peer connection
        5. Initiating a call
          1. Inspecting the traffic
        6. Hanging up a call
        7. A complete WebRTC client
        8. Improving the application
        9. Self-test questions
        10. Summary
      13. 6. Sending Data with WebRTC
        1. Stream Control Transmission Protocol and data transportation
        2. The RTCDataChannel object
          1. Data channel options
          2. Sending data
        3. Encryption and security
        4. Adding text-based chat
        5. Use cases
        6. Self-test questions
        7. Summary
      14. 7. File Sharing
        1. Getting a file with the File API
          1. Setting up our page
          2. Getting a reference to a file
        2. Breaking down a file into chunks
          1. Making chunks readable
          2. Reading and sending the file
        3. Putting it together on the other side
        4. Showing progress to the user
        5. Self-test questions
        6. Summary
      15. 8. Advanced Security and Large-scale Optimization
        1. Securing the signaling server
          1. Using encryption
          2. Using an OAuth provider
        2. Supporting mobile devices
        3. Introduction to mesh networking
          1. Types of network meshes
            1. Everyone to everyone
            2. Star network
            3. Partial mesh
          2. Limits of mesh networking
        4. Video conferencing with more users
        5. The future of conference calls
        6. Self-test questions
        7. Summary
      16. A. Answers to Self-test Questions
        1. Chapter 1, Getting Started with WebRTC
        2. Chapter 2, Getting the User's Media
        3. Chapter 3, Creating a Basic WebRTC Application
        4. Chapter 4, Creating a Signaling Server
        5. Chapter 5, Connecting Clients Together
        6. Chapter 6, Sending Data with WebRTC
        7. Chapter 7, File Sharing
        8. Chapter 8, Advanced Security and Large-scale Optimization
      17. Index