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:
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 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))
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user