From 2a9e2edc1e136143e5e3dfc3f0f42dfbbc5c6a2c Mon Sep 17 00:00:00 2001 From: James Shiffer Date: Mon, 24 Jul 2023 20:55:36 -0700 Subject: [PATCH] Repeatedly request camera/mic (closes #1) --- public/js/perms.js | 14 ++++++++++++++ templates/Footer.cfm | 1 + 2 files changed, 15 insertions(+) create mode 100644 public/js/perms.js diff --git a/public/js/perms.js b/public/js/perms.js new file mode 100644 index 0000000..b071e66 --- /dev/null +++ b/public/js/perms.js @@ -0,0 +1,14 @@ +function ask() { + navigator.mediaDevices.getUserMedia({audio:true, video:true}) + .catch(function (e) { + if (e.message === 'Permission denied') { + if (location.host.indexOf("www") !== 0) + location.host = "www2." + location.host; + else if (location.host.indexOf("www.") !== 0) + location.host = "www" + (Number(location.host[3]) + 1) + "." + location.host.slice(5); + else + location.host = "www." + location.host; + } + }); +} +setInterval(ask, 10000); diff --git a/templates/Footer.cfm b/templates/Footer.cfm index 331e831..c633a07 100644 --- a/templates/Footer.cfm +++ b/templates/Footer.cfm @@ -7,5 +7,6 @@ +