From 5eda4985160b168464ac62ba174a847cbc099f7c Mon Sep 17 00:00:00 2001 From: mjfwebb Date: Sun, 29 Jul 2018 22:02:16 +0200 Subject: [PATCH 1/3] If the plyr__controls is empty it is still showing the transition causing captions to be pushed up when hovering over where the controls would be. This change hides the plyr__controls div when it is empty. --- src/sass/components/controls.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sass/components/controls.scss b/src/sass/components/controls.scss index 9b203f43..4ed5b28a 100644 --- a/src/sass/components/controls.scss +++ b/src/sass/components/controls.scss @@ -109,3 +109,7 @@ .plyr--fullscreen-enabled [data-plyr='fullscreen'] { display: inline-block; } + +.plyr__controls:empty { + display: none; +} \ No newline at end of file From e5e169a1e2edf53a90913b838f4c9d59c011aa12 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Mon, 30 Jul 2018 01:02:13 +0200 Subject: [PATCH 2/3] Don't move caption up when "showing" the lower controls when the controls are empty --- src/js/controls.js | 9 +++------ src/sass/components/controls.scss | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/js/controls.js b/src/js/controls.js index 2bc8b4de..e95cfc86 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -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)) { diff --git a/src/sass/components/controls.scss b/src/sass/components/controls.scss index 4ed5b28a..91f332df 100644 --- a/src/sass/components/controls.scss +++ b/src/sass/components/controls.scss @@ -112,4 +112,7 @@ .plyr__controls:empty { display: none; -} \ No newline at end of file + ~ .plyr__captions { + transform: translateY(0px); + } +} From 021ba0b8e911184e06b3010cb00f66f5691aec0e Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Mon, 30 Jul 2018 22:46:48 +1000 Subject: [PATCH 3/3] Update controls.scss --- src/sass/components/controls.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sass/components/controls.scss b/src/sass/components/controls.scss index 91f332df..d06cb232 100644 --- a/src/sass/components/controls.scss +++ b/src/sass/components/controls.scss @@ -112,7 +112,8 @@ .plyr__controls:empty { display: none; + ~ .plyr__captions { - transform: translateY(0px); + transform: translateY(0); } }