mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-23 07:22:20 +00:00
13 lines
444 B
JavaScript
13 lines
444 B
JavaScript
// Refresh viewer count by pulling metric from server
|
|
function refreshViewersCounter(streamID, period) {
|
|
// Distinguish oneDomainPerStream mode
|
|
fetch("/_stats/" + streamID)
|
|
.then(response => response.json())
|
|
.then((data) => document.getElementById("connected-people").innerText = data.ConnectedViewers)
|
|
.catch(console.log)
|
|
|
|
setTimeout(() => {
|
|
refreshViewersCounter(streamID, period)
|
|
}, period)
|
|
}
|