From 4f1eb7b247a66287b485e9b70869177bfe067ea6 Mon Sep 17 00:00:00 2001 From: Arya Vohra Date: Sun, 31 May 2020 11:32:33 +0800 Subject: [PATCH 1/4] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b8d1b69..7a106c9 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,14 @@ technology. - Screen sharing +- Group call with up to 4 peers - Picture in picture - Live captions - Text chat - Auto-scaling video quality - No download required, entirely browser based - Direct peer to peer connection ensures lowest latency +- No SFU servers, group calls use mesh networks - Single use disposable chat rooms ## Quick start From 26170810e026d35fa42c8fbb7cc3698e362010e1 Mon Sep 17 00:00:00 2001 From: Arya Vohra Date: Sun, 31 May 2020 11:47:53 +0800 Subject: [PATCH 2/4] Updated website with group call features --- public/landing.html | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/public/landing.html b/public/landing.html index 332dced..7e1b62d 100755 --- a/public/landing.html +++ b/public/landing.html @@ -67,9 +67,9 @@ class="mt-0 mb-32 reveal-from-bottom" data-reveal-delay="300" > - Simple, Secure, and Fast. Peer to peer video calling - provides quality and latency simply not available with - traditional technology. + Simple, Secure, and Fast. Peer to peer group video + calling provides quality and latency simply not + available with traditional technology.

-

Total Privacy

+

Decentralized group calls

- Each chat is single use, data stays between you and your - caller. Zipcall is built privacy first. + Zipcall lets you talk to up to four friends by + directly connecting to them, completely + decentralized.

@@ -236,17 +237,18 @@
Feature tile icon 06
-

Maximum Security

+

Total Privacy and Security

- End to end state of the art encryption means your calls + Zipcall is built privacy first. Each chat is single use, + and end to end state of the art encryption means your calls are exactly that. Your calls.

From ff1c6fdec3a200889dc7fbd315249602060e89c4 Mon Sep 17 00:00:00 2001 From: Khush Jammu Date: Sun, 31 May 2020 13:35:28 +0800 Subject: [PATCH 3/4] added graceful disconnect handling --- public/js/chat.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/public/js/chat.js b/public/js/chat.js index 91d2f85..6eddfe6 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -199,7 +199,16 @@ var VideoChat = { // VideoChat.socket.off("offer"); break; case "disconnected": - logIt("disconnected"); + logIt("disconnected - UUID " + uuid); + VideoChat.remoteVideoWrapper.removeChild(document.querySelectorAll(`[uuid="${uuid}"]`)[0]); + VideoChat.connected.delete(uuid); + VideoChat.peerConnections.delete(uuid); + dataChannel.delete(uuid); + + if (VideoChat.peerConnections.size === 0) { + displayWaitingCaption(); + } + break; case "failed": logIt("failed"); // VideoChat.socket.connect @@ -332,6 +341,7 @@ var VideoChat = { node.setAttribute("autoplay", ""); node.setAttribute("playsinline", ""); node.setAttribute("id", "remote-video"); + node.setAttribute("uuid", uuid); VideoChat.remoteVideoWrapper.appendChild(node); // Update remote video source VideoChat.remoteVideoWrapper.lastChild.srcObject = event.stream; @@ -870,7 +880,7 @@ function toggleChat() { } // End Text chat -//Picture in picture +// Picture in picture function togglePictureInPicture() { if ( "pictureInPictureEnabled" in document || @@ -900,7 +910,15 @@ function togglePictureInPicture() { ); } } -//Picture in picture + +// Helper function for displaying waiting caption +function displayWaitingCaption() { + // Set caption text on start + captionText.text("Waiting for other user to join...").fadeIn(); + + // Reposition captions on start + rePositionCaptions(); +} function startUp() { // Try and detect in-app browsers and redirect @@ -994,11 +1012,7 @@ function startUp() { }, }); - // Set caption text on start - captionText.text("Waiting for other user to join...").fadeIn(); - - // Reposition captions on start - rePositionCaptions(); + displayWaitingCaption(); // On change media devices refresh page and switch to system default navigator.mediaDevices.ondevicechange = () => window.location.reload(); From 9c5a9cdc1aa539d7f7d2357651b3510c1bdd93f5 Mon Sep 17 00:00:00 2001 From: Arya Vohra Date: Sun, 31 May 2020 20:14:47 +0800 Subject: [PATCH 4/4] Removing hardcoded https --- server.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server.js b/server.js index 7e8407c..3954423 100644 --- a/server.js +++ b/server.js @@ -9,11 +9,7 @@ var twilio = require("twilio")(twillioAccountSID, twillioAuthToken); var express = require("express"); var app = express(); 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 http = require("http").createServer(app); +var http = require("http").createServer(app); var io = require("socket.io")(http); var path = require("path"); var public = path.join(__dirname, "public"); @@ -145,7 +141,7 @@ io.on("connection", function (socket) { }); // Listen for Heroku port, otherwise just use 3000 -var port = process.env.PORT || 443; +var port = process.env.PORT || 3000; http.listen(port, function () { console.log("http://localhost:" + port); });