Merge branch 'develop' of github.com:sampotts/plyr into develop

This commit is contained in:
Sam Potts 2018-06-25 22:31:43 +10:00
commit df458c5e7a
2 changed files with 9 additions and 5 deletions

View File

@ -191,8 +191,10 @@ const captions = {
return;
}
// Toggle state
this.elements.buttons.captions.pressed = active;
// Toggle button if it's enabled
if (this.elements.buttons.captions) {
this.elements.buttons.captions.pressed = active;
}
// Add class hook
toggleClass(this.elements.container, activeClass, active);

View File

@ -431,9 +431,11 @@ class Listeners {
};
// Play/pause toggle
Array.from(this.player.elements.buttons.play).forEach(button => {
bind(button, 'click', this.player.togglePlay, 'play');
});
if (this.player.elements.buttons.play) {
Array.from(this.player.elements.buttons.play).forEach(button => {
bind(button, 'click', this.player.togglePlay, 'play');
});
}
// Pause
bind(this.player.elements.buttons.restart, 'click', this.player.restart, 'restart');