diff --git a/public/js/chat.js b/public/js/chat.js index 1e6304c..b997901 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -501,6 +501,8 @@ function sendToAllDataChannels(message) { function muteMicrophone() { var audioTrack = null; + VideoChat.audioEnabled = !VideoChat.audioEnabled; + VideoChat.peerConnections.forEach(function (value, key, map) { value.getSenders().find(function (s) { if (s.track.kind === "audio") { @@ -510,8 +512,6 @@ function muteMicrophone() { audioTrack.enabled = VideoChat.audioEnabled; }); - VideoChat.audioEnabled = !VideoChat.audioEnabled; - // select mic button and mic button text const micButtonIcon = document.getElementById("mic-icon"); const micButtonText = document.getElementById("mic-text"); @@ -865,7 +865,7 @@ function handleRecieveMessage(msg) { // Sets the border color of uuid's stream upon receiving color function setStreamColor(uuid, color) { - document.querySelectorAll(`[uuid="${uuid}"]`)[0].style.border = `4px solid ${color}`; + document.querySelectorAll(`[uuid="${uuid}"]`)[0].style.border = `3px solid ${color}`; } // Show and hide chat diff --git a/server.js b/server.js index de98ade..02cee3a 100644 --- a/server.js +++ b/server.js @@ -8,7 +8,11 @@ var twillioAccountSID = var twilio = require("twilio")(twillioAccountSID, twillioAuthToken); var express = require("express"); var app = express(); -var http = require("http").createServer(app); +const fs = require('fs'); +var http = require("https").createServer({ + key: fs.readFileSync('/Users/khushjammu/certs/privkey.pem'), + cert: fs.readFileSync('/Users/khushjammu/certs/cert.pem') +}, app); var io = require("socket.io")(http); var path = require("path"); var public = path.join(__dirname, "public"); @@ -132,7 +136,7 @@ io.on("connection", function (socket) { }); // Listen for Heroku port, otherwise just use 3000 -var port = process.env.PORT || 3000; +var port = process.env.PORT || 443; http.listen(port, function () { console.log("http://localhost:" + port); });