From 6bff6b317d6adcd9f94c8d4d8ee225d39f784e0f Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Wed, 13 Jun 2018 22:18:57 +0200 Subject: Remove line breaks in arrays --- src/js/plugins/vimeo.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/js/plugins/vimeo.js') diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js index c8c09b05..312d53cf 100644 --- a/src/js/plugins/vimeo.js +++ b/src/js/plugins/vimeo.js @@ -70,8 +70,8 @@ const vimeo = { // Set aspect ratio // For Vimeo we have an extra 300% height
to hide the standard controls and UI setAspectRatio(input) { - const ratio = is.string(input) ? input.split(':') : this.config.ratio.split(':'); - const padding = 100 / ratio[0] * ratio[1]; + const [x, y] = (is.string(input) ? input : this.config.ratio).split(':'); + const padding = 100 / x * y; this.elements.wrapper.style.paddingBottom = `${padding}%`; if (this.supported.ui) { @@ -294,10 +294,7 @@ const vimeo = { }); // Set aspect ratio based on video size - Promise.all([ - player.embed.getVideoWidth(), - player.embed.getVideoHeight(), - ]).then(dimensions => { + Promise.all([player.embed.getVideoWidth(), player.embed.getVideoHeight()]).then(dimensions => { const ratio = getAspectRatio(dimensions[0], dimensions[1]); vimeo.setAspectRatio.call(this, ratio); }); -- cgit v1.2.3