aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/controls.js
diff options
context:
space:
mode:
authorSam Potts <sam@selz.com>2018-02-17 09:22:19 +1100
committerGitHub <noreply@github.com>2018-02-17 09:22:19 +1100
commit7ac732f45b961301f56877a61d7607b3232537f0 (patch)
tree3f6b9dbc32912a990d0bf1094c5bd33623eb8f59 /src/js/controls.js
parenta59dcb2f53bfbe87812611b35832e1e0ba0f8daa (diff)
parentc90f1bdf08c002b55e92222583f994433239fb37 (diff)
downloadplyr-7ac732f45b961301f56877a61d7607b3232537f0.tar.lz
plyr-7ac732f45b961301f56877a61d7607b3232537f0.tar.xz
plyr-7ac732f45b961301f56877a61d7607b3232537f0.zip
Merge branch 'beta' into gulp-unminified-js-output
Diffstat (limited to 'src/js/controls.js')
-rw-r--r--src/js/controls.js19
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);
}