mirror of
https://github.com/videojs/video.js.git
synced 2024-12-27 02:43:45 +02:00
@bc-bbay fixed instance where progress bars would go passed 100%. closes #2040
This commit is contained in:
parent
793da0979a
commit
9c99def186
@ -26,6 +26,7 @@ CHANGELOG
|
||||
* @gkatsev updated the component.js styles to match the new style guide ([view](https://github.com/videojs/video.js/pull/2105))
|
||||
* @gkatsev added error logging for bad JSON formatting ([view](https://github.com/videojs/video.js/pull/2113))
|
||||
* @gkatsev added a sensible toJSON function ([view](https://github.com/videojs/video.js/pull/2114))
|
||||
* @bc-bbay fixed instance where progress bars would go passed 100% ([view](https://github.com/videojs/video.js/pull/2040))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -31,7 +31,7 @@ class LoadProgressBar extends Component {
|
||||
// get the percent width of a time compared to the total end
|
||||
let percentify = function (time, end){
|
||||
let percent = (time / end) || 0; // no NaN
|
||||
return (percent * 100) + '%';
|
||||
return ((percent >= 1 ? 1 : percent) * 100) + '%';
|
||||
};
|
||||
|
||||
// update the width of the progress bar
|
||||
|
@ -34,7 +34,8 @@ class SeekBar extends Slider {
|
||||
}
|
||||
|
||||
getPercent() {
|
||||
return this.player_.currentTime() / this.player_.duration();
|
||||
let percent = this.player_.currentTime() / this.player_.duration();
|
||||
return percent >= 1 ? 1 : percent;
|
||||
}
|
||||
|
||||
handleMouseDown(event) {
|
||||
|
Loading…
Reference in New Issue
Block a user