Fix for custom controls
This commit is contained in:
19
src/js/controls.js
vendored
19
src/js/controls.js
vendored
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user