1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-29 02:57:21 +02:00

@bc-bbay fixed instance where progress bars would go passed 100%. closes #2040

This commit is contained in:
Brandon Bay 2015-05-06 12:10:57 -04:00 committed by heff
parent 793da0979a
commit 9c99def186
3 changed files with 4 additions and 2 deletions

View File

@ -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 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 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)) * @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))
-------------------- --------------------

View File

@ -31,7 +31,7 @@ class LoadProgressBar extends Component {
// get the percent width of a time compared to the total end // get the percent width of a time compared to the total end
let percentify = function (time, end){ let percentify = function (time, end){
let percent = (time / end) || 0; // no NaN let percent = (time / end) || 0; // no NaN
return (percent * 100) + '%'; return ((percent >= 1 ? 1 : percent) * 100) + '%';
}; };
// update the width of the progress bar // update the width of the progress bar

View File

@ -34,7 +34,8 @@ class SeekBar extends Slider {
} }
getPercent() { getPercent() {
return this.player_.currentTime() / this.player_.duration(); let percent = this.player_.currentTime() / this.player_.duration();
return percent >= 1 ? 1 : percent;
} }
handleMouseDown(event) { handleMouseDown(event) {