mirror of
https://github.com/videojs/video.js.git
synced 2025-01-15 10:39:58 +02:00
Close GH-643: Fix Player.buffered() to more correct behavior.
This commit is contained in:
parent
1d972a0686
commit
75ff27307d
@ -546,11 +546,12 @@ vjs.Player.prototype.remainingTime = function(){
|
||||
vjs.Player.prototype.buffered = function(){
|
||||
var buffered = this.techGet('buffered'),
|
||||
start = 0,
|
||||
buflast = buffered.length - 1,
|
||||
// Default end to 0 and store in values
|
||||
end = this.cache_.bufferEnd = this.cache_.bufferEnd || 0;
|
||||
|
||||
if (buffered && buffered.length > 0 && buffered.end(0) !== end) {
|
||||
end = buffered.end(0);
|
||||
if (buffered && buflast >= 0 && buffered.end(buflast) !== end) {
|
||||
end = buffered.end(buflast);
|
||||
// Storing values allows them be overridden by setBufferedFromProgress
|
||||
this.cache_.bufferEnd = end;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user