diff options
author | Sam Potts <sam@potts.es> | 2018-06-15 15:34:29 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-15 15:34:29 +1000 |
commit | d522e405942e060180c7f5b28c914028e94a917b (patch) | |
tree | 71986987e1c10eca00d6796551b2f065f9d07d03 /src/js/plugins/vimeo.js | |
parent | 3cd2b9a6c3ab2a7b530f1f0e6eae884ba41b9211 (diff) | |
parent | 6bff6b317d6adcd9f94c8d4d8ee225d39f784e0f (diff) | |
download | plyr-d522e405942e060180c7f5b28c914028e94a917b.tar.lz plyr-d522e405942e060180c7f5b28c914028e94a917b.tar.xz plyr-d522e405942e060180c7f5b28c914028e94a917b.zip |
Merge pull request #1034 from friday/remove-array-newline-rule
Suggestion: Remove array newline rule
Diffstat (limited to 'src/js/plugins/vimeo.js')
-rw-r--r-- | src/js/plugins/vimeo.js | 9 |
1 files changed, 3 insertions, 6 deletions
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 <div> 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); }); |