You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Yes, it's related to controlling the size of an HTML5 video when using Fancybox. I couldn't find a way to set a desired video size via data attributes.
Specifically, I want the video to maintain a 1:1 aspect ratio, with both the width and height around 1000px. No matter what I do, the video height seems to be locked at 526.5px with an inline CSS. I tried using data-width and data-height, but they didn't have any effect. Also tried removing the data-aspect-ratio, still no effect on the width and the height.
I ended up fixing it with CSS, but had to use !important to override the inline styles. It would be great if there was clearer option for achieving this with data attributes.
Describe the solution you'd like
I'd like to see support for setting video size (width and/or height) through data attributes, just like data-video-ratio. This would let users define custom dimensions for HTML5 videos without needing CSS overrides, giving better control directly in the HTML.
Describe alternatives you've considered
As mentioned, I've solved the issue with CSS by overriding the inline styles, which worked but feels like a workaround rather than a clean solution. Ideally, data attributes like data-width and data-height should handle this directly.
Is your feature request related to a problem? Please describe.
Yes, it's related to controlling the size of an HTML5 video when using Fancybox. I couldn't find a way to set a desired video size via data attributes.
Specifically, I want the video to maintain a 1:1 aspect ratio, with both the width and height around
1000px
. No matter what I do, the video height seems to be locked at526.5px
with an inline CSS. I tried usingdata-width
anddata-height
, but they didn't have any effect. Also tried removing thedata-aspect-ratio
, still no effect on the width and the height.I ended up fixing it with CSS, but had to use
!important
to override the inline styles. It would be great if there was clearer option for achieving this with data attributes.Describe the solution you'd like
I'd like to see support for setting video size (width and/or height) through data attributes, just like
data-video-ratio
. This would let users define custom dimensions for HTML5 videos without needing CSS overrides, giving better control directly in the HTML.Describe alternatives you've considered
As mentioned, I've solved the issue with CSS by overriding the inline styles, which worked but feels like a workaround rather than a clean solution. Ideally, data attributes like
data-width
anddata-height
should handle this directly.Additional context
Here’s the HTML snippet I used:
<a href="video_url" data-fancybox data-video-ratio="1/1" data-width="1000" data-height="1000">
Thanks for your time!
The text was updated successfully, but these errors were encountered: