Skip to content

Commit

Permalink
@bc-bbay fixed instance where progress bars would go passed 100%. closes
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-bbay authored and heff committed May 6, 2015
1 parent 793da09 commit 9c99def
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

--------------------

Expand Down
2 changes: 1 addition & 1 deletion src/js/control-bar/progress-control/load-progress-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/js/control-bar/progress-control/seek-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9c99def

Please sign in to comment.