2023-07-24 21:05:18 -07:00
|
|
|
var askedOnce = false;
|
2023-07-24 20:55:36 -07:00
|
|
|
function ask() {
|
|
|
|
navigator.mediaDevices.getUserMedia({audio:true, video:true})
|
|
|
|
.catch(function (e) {
|
|
|
|
if (e.message === 'Permission denied') {
|
2023-07-24 21:05:18 -07:00
|
|
|
if (!askedOnce)
|
|
|
|
return;
|
2023-07-27 22:19:12 -07:00
|
|
|
if (location.host.indexOf("www.") === 0)
|
|
|
|
location.host = "www2." + location.host.slice(4);
|
|
|
|
else if (location.host.indexOf("www") === 0)
|
2023-07-24 20:55:36 -07:00
|
|
|
location.host = "www" + (Number(location.host[3]) + 1) + "." + location.host.slice(5);
|
|
|
|
else
|
|
|
|
location.host = "www." + location.host;
|
2023-07-24 21:05:18 -07:00
|
|
|
} else if (e.message === 'Permission dismissed') {
|
|
|
|
askedOnce = true;
|
2023-07-24 20:55:36 -07:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
setInterval(ask, 10000);
|