Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
JavaScript by Example

You're reading from   JavaScript by Example Learn modern web development with real-world applications

Arrow left icon
Product type Paperback
Published in Aug 2017
Publisher Packt
ISBN-13 9781788293969
Length 298 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Dani Akash S Dani Akash S
Author Profile Icon Dani Akash S
Dani Akash S
Arrow right icon
View More author details
Toc

Building the Video Call app

Everything's in place, so let's start coding. As usual, as we did in the previous apps, open your home.js file and create your Home class with a constructor:

class Home {
constructor() {

}
}

After that, create an instance of the Home class and assign it to an object, home, as follows:

const home = new Home();

We are going to have a use for the home object later. We now add the SimpleWebRTC package to our project by running the following command in the terminal from our project root folder:

npm install -S simplewebrtc

And add the following import statement to the top of your home.js file:

import SimpleWebRTC from 'simplewebrtc';

As per the SimpleWebRTC documentation, we need to create an instance of the SimpleWebRTC class with some configuration to use it in our application. In your home.js file, before the Home class, add the following...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime