1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2024-12-23 17:52:20 +00:00
ghostream/web/static/js/viewersCounter.js

12 lines
370 B
JavaScript
Raw Normal View History

// Refresh viewer count by pulling metric from server
function refreshViewersCounter(period) {
2020-09-30 13:56:24 +00:00
fetch("/_stats/")
.then(response => response.json())
.then((data) => document.getElementById("connected-people").innerText = data.ConnectedViewers)
.catch(console.log)
setTimeout(() => {
refreshViewersCounter(period)
}, period)
}