mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2024-11-14 14:19:20 +08:00
fix muting and adjust border size
This commit is contained in:
parent
70b15ef04c
commit
d7a52afe5f
@ -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
|
||||
|
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user