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; ...

Get Learning WebRTC now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.