aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/ui.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-06-19 09:12:21 +1000
committerSam Potts <sam@potts.es>2018-06-19 09:12:21 +1000
commitb61ba02f3dbed71f595188d69441132972767eb0 (patch)
tree2f3627f59e3e73d1a3a83750376b3a1151adf3cf /src/js/ui.js
parentea4d91d2a011cdfc835619cb90a25074c039e777 (diff)
downloadplyr-b61ba02f3dbed71f595188d69441132972767eb0.tar.lz
plyr-b61ba02f3dbed71f595188d69441132972767eb0.tar.xz
plyr-b61ba02f3dbed71f595188d69441132972767eb0.zip
Fix issue with play button not changing state (fixes #1048)
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') {