From d3b31e595a323208972f9422bf458b792da8c185 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Tue, 21 Nov 2017 20:14:57 +1100 Subject: Handle no audio, more docs in code, fix for playing getter --- src/js/ui.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/js/ui.js') 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); -- cgit v1.2.3