Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion src/js/videojs-dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,51 @@ class Html5DashJS {
}
}

seekable() {
if (this.el_.duration === Number.MAX_VALUE) {
if (!this.mediaPlayer_.isSeeking()) {
const start = this.el_.currentTime - this.mediaPlayer_.time(),
end = start + this.mediaPlayer_.getDVRWindowSize();

this.currSeekable_ = {
start: function() {
return start;
},
end: function() {
return end;
},
length: 1
};
}

if (this.currSeekable_) {
return this.currSeekable_;
}
}

const seekable = this.el_.seekable;

if (seekable.length > 0 && seekable.end(seekable.length-1) === Number.MAX_VALUE) {
return {
start: function() {
return 0;
},
end: function() {
return Infinity;
},
length: 1
};
} else {
return seekable;
}
}

duration() {
const duration = this.el_.duration;

if (duration === Number.MAX_VALUE) {
return Infinity;
const dvrWindowSize = this.mediaPlayer_.getDVRWindowSize();
return (dvrWindowSize) ? dvrWindowSize : Infinity;
}
return duration;
}
Expand Down