From 9c7e429b48320f6b021baa2ed23e35a6bd9ceae5 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sun, 19 Apr 2020 19:51:06 +1000 Subject: Vimeo ratio fixes --- src/js/utils/style.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/js/utils') diff --git a/src/js/utils/style.js b/src/js/utils/style.js index 0a37e595..c2004fcb 100644 --- a/src/js/utils/style.js +++ b/src/js/utils/style.js @@ -64,9 +64,10 @@ export function setAspectRatio(input) { wrapper.style.paddingBottom = `${padding}%`; // For Vimeo we have an extra
to hide the standard controls and UI - if (this.isVimeo && this.supported.ui) { - const height = 240; + if (this.isVimeo && !this.config.vimeo.premium && this.supported.ui) { + const height = (100 / this.media.offsetWidth) * parseInt(window.getComputedStyle(this.media).paddingBottom, 10); const offset = (height - padding) / (height / 50); + this.media.style.transform = `translateY(-${offset}%)`; } else if (this.isHTML5) { wrapper.classList.toggle(this.config.classNames.videoFixedRatio, ratio !== null); -- cgit v1.2.3