Change the poster based on online status

This commit is contained in:
Gabe Kangas 2020-06-25 21:56:43 -07:00
parent 20eb8287ef
commit a9b8a70e8a

View file

@ -21,6 +21,14 @@ async function getStatus() {
? "Stream is online."
: "Stream is offline."
const player = videojs('video');
if (app.isOnline) {
player.poster('/thumbnail.jpg');
} else {
// Change this to some kind of offline image.
player.poster('/img/logo.png');
}
app.viewerCount = status.viewerCount;
app.sessionMaxViewerCount = status.sessionMaxViewerCount;
app.overallMaxViewerCount = status.overallMaxViewerCount;