Browse Source

Force poster to reload so it uses the recent thumbnail. #37

pull/53/head
Gabe Kangas 6 years ago
parent
commit
180534cfaf
  1. 1
      webroot/js/status.js
  2. 3
      webroot/js/utils.js

1
webroot/js/status.js

@ -15,7 +15,6 @@ function handleStatus(status) {
app.overallMaxViewerCount = status.overallMaxViewerCount; app.overallMaxViewerCount = status.overallMaxViewerCount;
app.isOnline = status.online; app.isOnline = status.online;
setVideoPoster(app.isOnline); setVideoPoster(app.isOnline);
} }
function handleOffline() { function handleOffline() {

3
webroot/js/utils.js

@ -120,7 +120,8 @@ function generateUsername() {
function setVideoPoster(online) { function setVideoPoster(online) {
const player = videojs(VIDEO_ID); 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); player.poster(poster);
} }

Loading…
Cancel
Save