mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
c6e1a3e747
commit
62ca7d2ffd
16 changed files with 98 additions and 49 deletions
|
@ -1018,6 +1018,7 @@ _checkBuffer() {
|
|||
// check buffer upfront
|
||||
// if less than jumpThreshold second is buffered, and media is expected to play but playhead is not moving,
|
||||
// and we have a new buffer range available upfront, let's seek to that one
|
||||
let configSeekHoleNudgeDuration = this.config.seekHoleNudgeDuration;
|
||||
if(expectedPlaying && bufferInfo.len <= jumpThreshold) {
|
||||
if(playheadMoving) {
|
||||
// playhead moving
|
||||
|
@ -1031,7 +1032,7 @@ _checkBuffer() {
|
|||
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_STALLED_ERROR, fatal: false});
|
||||
this.stalled = true;
|
||||
} else {
|
||||
this.seekHoleNudgeDuration += this.config.seekHoleNudgeDuration;
|
||||
this.seekHoleNudgeDuration += configSeekHoleNudgeDuration;
|
||||
}
|
||||
}
|
||||
// if we are below threshold, try to jump if next buffer range is close
|
||||
|
@ -1050,10 +1051,30 @@ _checkBuffer() {
|
|||
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_OVER_HOLE, fatal: false, hole : hole});
|
||||
}
|
||||
}
|
||||
// in any case reset stalledInBuffered
|
||||
this.stalledInBuffered = 0;
|
||||
} else {
|
||||
if (targetSeekPosition && media.currentTime !== targetSeekPosition) {
|
||||
logger.log(`adjust currentTime from ${media.currentTime} to ${targetSeekPosition}`);
|
||||
media.currentTime = targetSeekPosition;
|
||||
} else if (expectedPlaying && !playheadMoving) {
|
||||
// if we are in this condition, it means that currentTime is in a buffered area, but playhead is not moving
|
||||
// if that happens, we wait for a couple of cycle (config.stalledInBufferedNudgeThreshold), then we nudge
|
||||
// media.currentTime to try to recover that situation.
|
||||
if (this.stalledInBuffered !== undefined) {
|
||||
this.stalledInBuffered++;
|
||||
} else {
|
||||
this.stalledInBuffered = 1;
|
||||
}
|
||||
if (this.stalledInBuffered >= this.config.stalledInBufferedNudgeThreshold) {
|
||||
logger.log(`playback stuck @ ${media.currentTime}, in buffered area, nudge currentTime by ${configSeekHoleNudgeDuration}`);
|
||||
this.hls.trigger(Event.ERROR, {type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.BUFFER_SEEK_STUCK_IN_BUFFERED, fatal: false});
|
||||
media.currentTime+=configSeekHoleNudgeDuration;
|
||||
this.stalledInBuffered = 0;
|
||||
}
|
||||
} else {
|
||||
// currentTime is buffered, playhead is moving or playback not expected... everything is fine
|
||||
this.stalledInBuffered = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue