1
0
mirror of https://github.com/videojs/video.js.git synced 2025-04-11 11:42:08 +02:00

fix(seek-bar): ensure aria-valuenow attribute in seek-bar is not NaN (#5164)

Updated the getPercent function to return 0 instead of NaN. This is in accordance with the return value in the function's jsdocs.

Fixes #4960.
This commit is contained in:
Monica Olinescu 2018-05-11 11:09:15 -07:00 committed by Gary Katsevman
parent d44682849e
commit ad1bb9db5e

View File

@ -171,7 +171,7 @@ class SeekBar extends Slider {
getPercent() {
const percent = this.getCurrentTime_() / this.player_.duration();
return percent >= 1 ? 1 : percent;
return percent >= 1 ? 1 : (percent || 0);
}
/**