mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 16:12:19 +00:00
Stream ID was broken in the current viewers stats
This commit is contained in:
parent
a2efa1126f
commit
e154fe1a1e
@ -1,7 +1,7 @@
|
||||
// Refresh viewer count by pulling metric from server
|
||||
function refreshViewersCounter(period) {
|
||||
function refreshViewersCounter(streamID, period) {
|
||||
// Distinguish oneDomainPerStream mode
|
||||
fetch("/_stats/" + (location.pathname === "/" ? location.host : location.pathname.substring(1)))
|
||||
fetch("/_stats/" + streamID)
|
||||
.then(response => response.json())
|
||||
.then((data) => document.getElementById("connected-people").innerText = data.ConnectedViewers)
|
||||
.catch(console.log)
|
||||
|
@ -50,7 +50,7 @@
|
||||
|
||||
// Wait a bit before pulling viewers counter for the first time
|
||||
setTimeout(() => {
|
||||
refreshViewersCounter({{.Cfg.ViewersCounterRefreshPeriod}})
|
||||
refreshViewersCounter({{.Path}}, {{.Cfg.ViewersCounterRefreshPeriod}})
|
||||
}, 1000)
|
||||
</script>
|
||||
{{end}}
|
Loading…
Reference in New Issue
Block a user