June 2015
Beginner to intermediate
186 pages
4h 1m
English
The following is the entire JavaScript code used in our client application. This includes all the code to hook up the UI, connect to the signaling server, and initiate a WebRTC connection with another user:
var connection = new WebSocket('ws://localhost:8888'), name = ""; var loginPage = document.querySelector('#login-page'), usernameInput = document.querySelector('#username'), loginButton = document.querySelector('#login'), callPage = document.querySelector('#call-page'), theirUsernameInput = document.querySelector('#their- username'), callButton = document.querySelector('#call'), hangUpButton = document.querySelector('#hang-up'); callPage.style.display = "none"; // Login when the user clicks the button loginButton.addEventListener("click", ...Read now
Unlock full access