1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-04-16 12:51:35 -04:00
parent 3e61abaf71
commit 73b495f48c
62 changed files with 875 additions and 512 deletions

View file

@ -234,10 +234,15 @@ class LevelController extends EventHandler {
onLevelLoaded(data) {
// check if current playlist is a live playlist
if (data.details.live && !this.timer) {
if (data.details.live) {
// if live playlist we will have to reload it periodically
// set reload period to playlist target duration
this.timer = setInterval(this.ontick, 1000 * data.details.targetduration);
// set reload period to average of the frag duration, if average not set then use playlist target duration
let timerInterval = data.details.averagetargetduration ? data.details.averagetargetduration : data.details.targetduration;
if (!this.timer || timerInterval !== this.timerInterval) {
clearInterval(this.timer);
this.timer = setInterval(this.ontick, 1000 * timerInterval);
this.timerInterval = timerInterval;
}
}
if (!data.details.live && this.timer) {
// playlist is not live and timer is armed : stopping it