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

Book Description

Develop your very own media applications and services using WebRTC

In Detail

This book introduces you to WebRTC and how you can utilize its open API. Each chapter covers a new concept of the technology with thoroughly explained code examples of completed applications to help you learn quickly and efficiently.

You will learn about the client and server sides of a WebRTC application in a practical manner, as well as how to implement data exchange between peers using the WebRTC Data API. The book also guides you through how to develop applications for desktop sharing and prerecorded video streaming. The book also teaches you how to use HTTPS with a WebRTC application and why it can be useful. You will also learn how to implement authentication in an application and integrate it with your own TURN server.

What You Will Learn

  • Create video conference web services that work without installing plugins or additional third-party software
  • Use ICE and STUN to pass through NAT and firewalls
  • Learn how to create and use direct peer-to-peer data channels to secure exchange data
  • Build a cross-platform signalling server for WebRTC applications
  • Work with user files from JavaScript code using the modern HTML5 File API
  • Install and configure your own TURN/STUN server
  • Integrate your application with a TURN server using authentication
  • Make your application more secure and safe using HTTPS
  • Develop your own secure web applications and services with practical projects
  • 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 If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

    Table of Contents

    1. WebRTC Blueprints
      1. Table of Contents
      2. WebRTC Blueprints
      3. Credits
      4. About the Author
      5. Acknowledgments
      6. About the Reviewers
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      8. Preface
        1. What is WebRTC?
          1. Supported platforms and devices
          2. Codecs that are supported in WebRTC
          3. Why should I use WebRTC?
            1. Applications you can easily build using WebRTC
            2. More ideas
          4. Benefits of using WebRTC in your business
        2. What this book covers
        3. What you need for this book
        4. Who this book is for
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      9. 1. Developing a WebRTC Application
        1. Establishing a peer-to-peer connection
          1. The Session Description Protocol
          2. ICE and ICE candidates
          3. NAT traversal
          4. WebSocket
        2. Preparing the environment
          1. Installing Erlang
          2. Installing Rebar
          3. Configuring a web server
        3. A simple p2p video conference – the browser application
          1. Developing a WebRTC API adapter
          2. Developing a WebRTC API wrapper
          3. Developing an index page
            1. Local and remote video objects
        4. A simple p2p video conference – the server application
          1. The application description file
          2. The application module
          3. The server supervisor
          4. The WebSocket handler
          5. Developing a configuration script for Rebar
          6. Compiling and running the signaling server
          7. Let's start the conference!
        5. Configuring and installing your own STUN server
        6. Summary
      10. 2. Using the WebRTC Data API
        1. Introducing the Data API
          1. Introducing protocols
        2. Introducing HTML5
        3. Introducing the HTML5 File API
        4. Known limitations
        5. Preparing the environment
        6. A simple file-sharing service – the browser application
          1. The WebRTC API wrapper
        7. Developing the main page of the application
        8. Running the application
        9. Summary
      11. 3. The Media Streaming and Screen Casting Services
        1. Preparing our environment
        2. Using HTTPS and SSL
          1. Configuring a WebSocket proxy
          2. The web browser configuration
          3. Preparing a media file
          4. Developing the application
        3. Developing a signaling server
        4. Limitations
        5. The media streaming and screen casting service
          1. Developing a WebRTC API wrapper
          2. Creating the application's index page
        6. Starting the application and testing it
        7. Summary
      12. 4. Security and Authentication
        1. Preparing our environment
        2. Signaling
        3. Using STUN and TURN
        4. Using the TURN authentication
          1. The TURN transport layer
          2. The TURN REST API
        5. Using web-based identity providers
        6. Deploying the TURN server
        7. Configuring HTTPS and self-signed certificates
          1. Configuring the server's firewall
          2. Configuring the TURN server
          3. The TURN REST API flag
        8. Integrating the TURN server with our application
          1. Improving the signaling server
          2. Improving the JavaScript browser-side code
        9. Starting the application and testing
        10. Summary
      13. 5. Mobile Platforms
        1. Preparing the environment
        2. Supporting WebRTC on mobile platforms
          1. Android
          2. iOS
          3. Windows Phones
          4. Blackberry
          5. Utilizing WebRTC via a native browser
          6. Utilizing WebRTC using browser applications
          7. Developing native mobile applications
        3. Looking at WebRTC on mobile platforms
          1. Hardware
          2. Environment
        4. Using third-party libraries and SDKs
        5. Building a WebRTC native demo application
        6. Building a WebRTC demo application for Android
          1. Configuring the build environment
          2. Obtaining the source code
          3. Installing Oracle JDK
          4. Preparing for compilation
          5. Installing Android Development Tools
          6. Compiling the code
          7. Running the Android demo application on an emulator
          8. Running the Android demo application on your device
          9. Testing the Android demo application
        7. Building a WebRTC demo for iOS
          1. Preparing the environment
          2. Creating a work directory
          3. Downloading the source code
            1. Getting the chromium depot tools
            2. Downloading the WebRTC source code
          4. Building and running a demo application on the iOS 7 simulator
          5. Building and running a demo application on the iOS device
            1. Fixing possible issues in iOS 7
          6. Changing the code
        8. Summary
      14. Index