aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/ui.js
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2017-11-21 20:14:57 +1100
committerSam Potts <me@sampotts.me>2017-11-21 20:14:57 +1100
commitd3b31e595a323208972f9422bf458b792da8c185 (patch)
tree202e8352a9771e6697a9efa26fd0d5ffe342938f /src/js/ui.js
parentf33bc5a5c6bbcf64713dab5506df3bd6c1a37fa1 (diff)
downloadplyr-d3b31e595a323208972f9422bf458b792da8c185.tar.lz
plyr-d3b31e595a323208972f9422bf458b792da8c185.tar.xz
plyr-d3b31e595a323208972f9422bf458b792da8c185.zip
Handle no audio, more docs in code, fix for playing getter
Diffstat (limited to 'src/js/ui.js')
-rw-r--r--src/js/ui.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/js/ui.js b/src/js/ui.js
index 6246a71f..062331dc 100644
--- a/src/js/ui.js
+++ b/src/js/ui.js
@@ -144,7 +144,9 @@ const ui = {
utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.paused);
// Set aria state
- Array.from(this.elements.buttons.play).forEach(button => utils.toggleState(button, this.playing));
+ if (utils.is.array(this.elements.buttons.play)) {
+ Array.from(this.elements.buttons.play).forEach(button => utils.toggleState(button, this.playing));
+ }
// Toggle controls
this.toggleControls(!this.playing);
@@ -153,7 +155,7 @@ const ui = {
// Check if media is loading
checkLoading(event) {
- this.loading = event.type === 'waiting';
+ this.loading = ['stalled', 'waiting'].includes(event.type);
// Clear timer
clearTimeout(this.timers.loading);