From 180534cfafc50db7131fba735c42b310e2b6d75e Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 6 Jul 2020 00:04:07 -0700 Subject: [PATCH] Force poster to reload so it uses the recent thumbnail. #37 --- webroot/js/status.js | 1 - webroot/js/utils.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webroot/js/status.js b/webroot/js/status.js index 54d05c5a5..5a710c5d1 100644 --- a/webroot/js/status.js +++ b/webroot/js/status.js @@ -15,7 +15,6 @@ function handleStatus(status) { app.overallMaxViewerCount = status.overallMaxViewerCount; app.isOnline = status.online; setVideoPoster(app.isOnline); - } function handleOffline() { diff --git a/webroot/js/utils.js b/webroot/js/utils.js index e02e459bd..1fa5bf2ff 100644 --- a/webroot/js/utils.js +++ b/webroot/js/utils.js @@ -120,7 +120,8 @@ function generateUsername() { function setVideoPoster(online) { const player = videojs(VIDEO_ID); - const poster = online ? POSTER_THUMB : POSTER_DEFAULT; + var cachebuster = Math.round(new Date().getTime() / 1000); + const poster = online ? POSTER_THUMB + "?okhi=" + cachebuster : POSTER_DEFAULT; player.poster(poster); }