Using a web server to connect two users
The very first step is simply to connect two separate users using the Web. We start by creating a standard HTML5 web page that includes a DOCTYPE
definition, a document head
, and a document body
:
<!DOCTYPE html> <html> <head> … </head> <body> … </body> </html>
Tip
Downloading the example code
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.
Then, the first element inside the document head
is the webrtc_polyfill.js
script included inline between a pair of <script>
tags. The webrtc_polyfill.js
code is exactly what it says it is and is designed to make it easy to write JavaScript that works across all common browser implementations of the WebRTC and MediaStream APIs. Here is an overview of how...