From 6101706fa742015e6b9d94b93c58dbaf2fab3eeb Mon Sep 17 00:00:00 2001 From: Ian Ramzy Date: Mon, 13 Apr 2020 01:11:17 -0400 Subject: [PATCH] Basic redirection of unsupported browsers, rewording on landing + readme --- README.md | 9 +-- public/chat.html | 1 + public/js/chat.js | 37 ++++++---- public/landing.html | 8 +-- public/newcall.html | 11 --- public/notsupported.html | 15 +--- public/notsupportedios.html | 136 ++++++++++++++++++++++++++++++++++++ server.js | 4 ++ 8 files changed, 174 insertions(+), 47 deletions(-) create mode 100644 public/notsupportedios.html diff --git a/README.md b/README.md index d27e73d..1704d89 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Zipcall - Decentralized Video Chat [![Author](https://img.shields.io/badge/Author-ianramzy-brightgreen.svg)](https://ianramzy.com) -![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) +![License: CC-NC](https://img.shields.io/badge/License-CCNC-blue.svg) [![Donate](https://img.shields.io/badge/Donate-PayPal-brightgreen.svg)](https://paypal.me/ianramzy) [![Repo Link](https://img.shields.io/badge/Repo-Link-black.svg)](https://github.com/ianramzy/decentralized-video-chat) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?)](https://github.com/prettier/prettier) @@ -60,10 +60,11 @@ npm start - Open `localhost:3000` in browser - If you want to use a client on another computer/network, make sure you publish your server on an HTTPS connection. You can use a service like [ngrok](https://ngrok.com/) for that. - + ## Contributing + Pull Requests are welcome! -Please run prettier on all of your PRs before submitting, this can be done with `` prettier --write`` in the project directory +Please run prettier on all of your PRs before submitting, this can be done with `prettier --write` in the project directory -For communication we use Glitter Chat we can be found here: [![Join the chat at https://gitter.im/zipcall](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zipcall) +For communication we use Gitter Chat we can be found here: [![Join the chat at https://gitter.im/zipcall](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zipcall) diff --git a/public/chat.html b/public/chat.html index 5cbbd34..046cace 100644 --- a/public/chat.html +++ b/public/chat.html @@ -133,6 +133,7 @@ + diff --git a/public/js/chat.js b/public/js/chat.js index a284320..ff7059d 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -837,22 +837,29 @@ function togglePictureInPicture() { //Picture in picture function startUp() { - // Redirect mobile browsers - // if ( - // /webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( - // navigator.userAgent - // ) - // ) { - // alert( - // "Zipcall is not currently supported on mobile. Please try again on desktop." - // ); - // window.location.href = "/notsupported"; - // } - // Redirect unsupported browsers + // Try and detect in-app browsers and redirect + var ua = navigator.userAgent || navigator.vendor || window.opera; + if ( + DetectRTC.isMobileDevice && + (ua.indexOf("FBAN") > -1 || + ua.indexOf("FBAV") > -1 || + ua.indexOf("Instagram") > -1) + ) { + if (DetectRTC.osName === "iOS") { + window.location.href = "/notsupportedios"; + } else { + window.location.href = "/notsupported"; + } + } + + // Redirect all iOS browsers that are not Safari + if (DetectRTC.isMobileDevice) { + if (DetectRTC.osName === "iOS" && !DetectRTC.browser.isSafari) { + window.location.href = "/notsupportedios"; + } + } + if (!isWebRTCSupported || browserName === "MSIE") { - alert( - "Your browser doesn't support Zipcall. Please use Chrome, Firefox, or Safari. If using iOS please use Safari" - ); window.location.href = "/notsupported"; } diff --git a/public/landing.html b/public/landing.html index b165212..1925cb1 100755 --- a/public/landing.html +++ b/public/landing.html @@ -114,7 +114,7 @@ Zipcall is built radically different. We left behind slow bulky servers, opting for decentralized peer to peer calling. We engineered a platform with maximum video quality - and low latency. + and lowest latency.

@@ -134,7 +134,7 @@

Best Video Quality

- State of the art VP9 video compression combined with our + State of the art video compression combined with our scaling optimization makes your calls crystal clear.

@@ -224,8 +224,8 @@

No Server Needed

Calls are entirely between you and your caller, - decentralized from any server. Data never leaves the - browser. Cool right? + decentralized from any server. Call data never leaves + the browser. Cool right?

diff --git a/public/newcall.html b/public/newcall.html index 876311b..481f7c6 100755 --- a/public/newcall.html +++ b/public/newcall.html @@ -45,17 +45,6 @@ /> - diff --git a/public/notsupported.html b/public/notsupported.html index 5b87fc1..728b0ca 100644 --- a/public/notsupported.html +++ b/public/notsupported.html @@ -44,17 +44,6 @@ /> - @@ -71,8 +60,8 @@ class="mt-0 mb-16 reveal-from-bottom" data-reveal-delay="150" > - Your browser is not supported. Please try Chrome, Safari, - or Firefox on a desktop/laptop browser. + Your browser is not supported. Try updating your browser + or try Chrome, Safari, or Firefox. + + + + + + + + + + + diff --git a/server.js b/server.js index 8389164..13dbf22 100644 --- a/server.js +++ b/server.js @@ -52,6 +52,10 @@ app.get("/notsupported", function (req, res) { res.sendFile(path.join(public, "notsupported.html")); }); +app.get("/notsupportedios", function (req, res) { + res.sendFile(path.join(public, "notsupportedios.html")); +}); + // Serve static files in the public directory app.use(express.static("public"));