fix muting and adjust border size

This commit is contained in:
Khush Jammu 2020-06-01 00:32:09 +08:00
parent 70b15ef04c
commit d7a52afe5f
2 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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);
});