From ac7cca77eb3c69d898949acb3bfa55cafd7ac295 Mon Sep 17 00:00:00 2001
From: Kevin von Spiczak <kevin.spiczak@sgalinski.de>
Date: Tue, 30 Aug 2022 14:51:11 +0200
Subject: [PATCH] [TASK] override default ratio, so that vertical videos work

---
 Resources/Public/JavaScript/sgVimeoLightbox.js | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Resources/Public/JavaScript/sgVimeoLightbox.js b/Resources/Public/JavaScript/sgVimeoLightbox.js
index cea0fdd..c911de3 100644
--- a/Resources/Public/JavaScript/sgVimeoLightbox.js
+++ b/Resources/Public/JavaScript/sgVimeoLightbox.js
@@ -18,7 +18,20 @@ export default class SgVimeoLightbox {
 			}
 		});
 
-		LightboxManager.init({ type: 'video', glightbox: { selector: '.sg-vimeo-item' } });
+		LightboxManager.init({
+			type: 'video',
+			glightbox: {
+				selector: '.sg-vimeo-item',
+				plyr: {
+					config: {
+						// override 16:9 default ratio, so that plyr automatically detects the video dimensions
+						// without this, vertical videos will have black bars around them,
+						// see also: https://github.com/biati-digital/glightbox/issues/196#issuecomment-817070671
+						ratio: '',
+					}
+				}
+			}
+		});
 	}
 
 	disableLightbox(event) {
-- 
GitLab