Skip to content

Commit 7ca36bb

Browse files
committed
Linting fixes
1 parent 6e41d5e commit 7ca36bb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/js/plyr.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import source from './source';
1818
import Storage from './storage';
1919
import support from './support';
2020
import ui from './ui';
21-
import { closest } from './utils/arrays';
2221
import { createElement, hasClass, removeElement, replaceElement, toggleClass, wrap } from './utils/elements';
2322
import { off, on, once, triggerEvent, unbindListeners } from './utils/events';
2423
import is from './utils/is';
@@ -678,18 +677,26 @@ class Plyr {
678677
const options = this.options.quality;
679678

680679
let quality;
680+
let qualityInput = input; // We need to modify input if it is a Number
681+
681682
if (!options.length) {
682683
return;
683684
}
684685

685-
if (is.string(input)) {
686+
// Support setting quality as a Number
687+
if (is.number(qualityInput)) {
688+
// Convert this to a string since quality labels are expected to be strings
689+
qualityInput = `${qualityInput}`;
690+
}
691+
692+
if (is.string(qualityInput)) {
686693
// We have only a label
687694
// Convert this into an Object of the expected type
688695
quality = {
689-
value: input,
696+
value: qualityInput,
690697
};
691-
} else if (is.object(input)) {
692-
quality = input;
698+
} else if (is.object(qualityInput)) {
699+
quality = qualityInput;
693700
} else {
694701
this.debug.warn(`Quality option of unknown type: ${input} (${typeof input}). Ignoring`);
695702
return;

0 commit comments

Comments
 (0)