Handle no audio, more docs in code, fix for playing getter

This commit is contained in:
Sam Potts
2017-11-21 20:14:57 +11:00
parent f33bc5a5c6
commit d3b31e595a
12 changed files with 209 additions and 66 deletions

View File

@ -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);