diff options
Diffstat (limited to 'src/js/controls.js')
-rw-r--r-- | src/js/controls.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/js/controls.js b/src/js/controls.js index ea30acec..5e16b952 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -215,7 +215,16 @@ const controls = { utils.setAttributes(button, attributes); - this.elements.buttons[type] = button; + // We have multiple play buttons + if (type === 'play') { + if (!utils.is.array(this.elements.buttons[type])) { + this.elements.buttons[type] = []; + } + + this.elements.buttons[type].push(button); + } else { + this.elements.buttons[type] = button; + } return button; }, @@ -893,7 +902,6 @@ const controls = { // Play/Pause button if (this.config.controls.includes('play')) { container.appendChild(controls.createButton.call(this, 'play')); - // container.appendChild(controls.createButton.call(this, 'pause')); } // Fast forward button @@ -1147,9 +1155,10 @@ const controls = { // Null by default let container = null; + this.elements.controls = null; - // HTML passed as the option - if (utils.is.string(this.config.controls)) { + // HTML or Element passed as the option + if (utils.is.string(this.config.controls) || utils.is.element(this.config.controls)) { container = this.config.controls; } else if (utils.is.function(this.config.controls)) { // A custom function to build controls @@ -1193,7 +1202,7 @@ const controls = { } // Find the elements if need be - if (utils.is.element(this.elements.controls)) { + if (!utils.is.element(this.elements.controls)) { utils.findElements.call(this); } |