aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/ui.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-06-19 19:24:47 +1000
committerSam Potts <sam@potts.es>2018-06-19 19:24:47 +1000
commitbb546fe43fc6537a4dc0a350a7aa4260a3f97b1d (patch)
treeb70095eb74061a7a4089ecc043c0e4b27c0f934b /src/js/ui.js
parent9e1218547b18e87921d0bd95d259cac4fe538c61 (diff)
parent52ea5bd0ab211cc18e7d1f6de06a78d805a94b62 (diff)
downloadplyr-bb546fe43fc6537a4dc0a350a7aa4260a3f97b1d.tar.lz
plyr-bb546fe43fc6537a4dc0a350a7aa4260a3f97b1d.tar.xz
plyr-bb546fe43fc6537a4dc0a350a7aa4260a3f97b1d.zip
Merge branch 'develop' into a11y-improvements
# Conflicts: # dist/plyr.js.map # dist/plyr.min.js # dist/plyr.min.js.map # dist/plyr.polyfilled.js.map # dist/plyr.polyfilled.min.js # dist/plyr.polyfilled.min.js.map
Diffstat (limited to 'src/js/ui.js')
-rw-r--r--src/js/ui.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/js/ui.js b/src/js/ui.js
index d0b27ae7..34fe7e82 100644
--- a/src/js/ui.js
+++ b/src/js/ui.js
@@ -135,11 +135,9 @@ const ui = {
}
// If there's a play button, set label
- if (is.nodeList(this.elements.buttons.play)) {
- Array.from(this.elements.buttons.play).forEach(button => {
- button.setAttribute('aria-label', label);
- });
- }
+ Array.from(this.elements.buttons.play || []).forEach(button => {
+ button.setAttribute('aria-label', label);
+ });
// Set iframe title
// https://github.com/sampotts/plyr/issues/124
@@ -214,11 +212,9 @@ const ui = {
toggleClass(this.elements.container, this.config.classNames.stopped, this.stopped);
// Set state
- if (is.nodeList(this.elements.buttons.play)) {
- Array.from(this.elements.buttons.play).forEach(target => {
- target.pressed = this.playing;
- });
- }
+ Array.from(this.elements.buttons.play || []).forEach(target => {
+ target.pressed = this.playing;
+ });
// Only update controls on non timeupdate events
if (is.event(event) && event.type === 'timeupdate') {