diff --git a/web/static/js/viewersCounter.js b/web/static/js/viewersCounter.js index 2b0ba2b..29d5015 100644 --- a/web/static/js/viewersCounter.js +++ b/web/static/js/viewersCounter.js @@ -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) diff --git a/web/template/player.html b/web/template/player.html index ae7d284..4f753fa 100644 --- a/web/template/player.html +++ b/web/template/player.html @@ -50,7 +50,7 @@ // Wait a bit before pulling viewers counter for the first time setTimeout(() => { - refreshViewersCounter({{.Cfg.ViewersCounterRefreshPeriod}}) + refreshViewersCounter({{.Path}}, {{.Cfg.ViewersCounterRefreshPeriod}}) }, 1000) {{end}} \ No newline at end of file