Skip to content

Commit

Permalink
Use Number.isFinite() to check position percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Jul 22, 2019
1 parent 87bee50 commit 04a4013
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/media-controls.js
Expand Up @@ -227,7 +227,7 @@

// Progress.
const positionPercent = this.media.currentTime / this.media.duration * 100;
if (!isNaN(positionPercent) && positionPercent != Infinity) {
if (Number.isFinite(positionPercent)) {
this.elements.progress.value = positionPercent;
} else {
this.elements.progress.value = 0;
Expand Down

0 comments on commit 04a4013

Please sign in to comment.