Merge pull request #1134 from mjfwebb/hide-empty-controls

Hide empty controls
This commit is contained in:
Sam Potts 2018-07-30 22:47:10 +10:00 committed by GitHub
commit f964e34d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

9
src/js/controls.js vendored
View File

@ -1455,12 +1455,9 @@ const controls = {
target = this.elements.container;
}
// Inject controls HTML
if (is.element(container)) {
target.appendChild(container);
} else if (container) {
target.insertAdjacentHTML('beforeend', container);
}
// Inject controls HTML (needs to be before captions, hence "afterbegin")
const insertMethod = is.element(container) ? 'insertAdjacentElement' : 'insertAdjacentHTML';
target[insertMethod]('afterbegin', container);
// Find the elements if need be
if (!is.element(this.elements.controls)) {

View File

@ -109,3 +109,11 @@
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
display: inline-block;
}
.plyr__controls:empty {
display: none;
~ .plyr__captions {
transform: translateY(0);
}
}