Add basic persistent viewership stats

This commit is contained in:
Gabe Kangas
2020-06-10 23:52:55 -07:00
parent 9ebec675b5
commit b47ea89c06
5 changed files with 128 additions and 7 deletions

View File

@@ -41,6 +41,8 @@
</video>
<div id="app">
{{ streamStatus }} {{ viewerCount }} {{ 'viewer' | plural(viewerCount) }}.
Max {{ sessionMaxViewerCount }} {{ 'viewer' | plural(sessionMaxViewerCount) }},
{{ overallMaxViewerCount }} overall.
</div>
</div>

View File

@@ -12,6 +12,8 @@ function setupApp() {
data: {
streamStatus: "",
viewerCount: 0,
sessionMaxViewerCount: 0,
overallMaxViewerCount: 0
},
});
@@ -56,6 +58,8 @@ async function getStatus() {
: "Stream is offline."
app.viewerCount = status.viewerCount
app.sessionMaxViewerCount = status.sessionMaxViewerCount
app.overallMaxViewerCount = status.overallMaxViewerCount
} catch (e) {
app.streamStatus = "Stream server is offline."