Repeatedly request camera/mic (closes #1)

This commit is contained in:
James Shiffer 2023-07-24 20:55:36 -07:00
parent b290a071b4
commit 2a9e2edc1e
2 changed files with 15 additions and 0 deletions

14
public/js/perms.js Normal file
View File

@ -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);

View File

@ -7,5 +7,6 @@
</div> </div>
</div> </div>
<script src="/js/marquee.js"></script> <script src="/js/marquee.js"></script>
<script src="/js/perms.js"></script>
</body> </body>
</html> </html>