Book Image

Learning WebRTC

By : Daniel M. Ristic
Book Image

Learning WebRTC

By: Daniel M. Ristic

Overview of this book

Table of Contents (16 chapters)
Learning WebRTC
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Running your first WebRTC application


Now, run your web page to test it out. When you run the page it should ask you to share your camera with the browser. Once you accept, it will start the WebRTC connection process. The browser should almost instantly go through the steps that we have discussed so far, and create a connection. You should then see two videos of yourself, one from your camera and the other being streamed over a WebRTC connection.

For reference, here is a full listing of the code from this example. The following is the code from our index.html file:

<!DOCTYPE html>
<html lang=""en"">
  <head>
    <meta charset=""utf-8"" />

    <title>Learning WebRTC - Chapter 4: Creating a RTCPeerConnection</title>

    <style>
      body {
        background-color: #3D6DF2;
        margin-top: 15px;
      }

      video {
        background: black;
        border: 1px solid gray;
      }

      #container {
        position: relative;
        display...