Video widget - Auto adjust height/ratio from Dynamic Media CPT

Hello !
Need Help with Video widget and CPT.

I have a CPT for my portfolio, in which i have a repeater that contains video (media meta field).

In my Single portfolio template, i am calling that video with the widget Video from bricks builder using dynamic data. (included in a block with loop settings to display results of that repeater)

My issue is :

  • The size of the video player does not adapt to the ratio of the video in the CPT.

In that repeater i can add multiple videos, and some will be square (1/1), others will be mobile format (9/16), others normal video ration (16/9)…

is there a workaround so that the video player widget will adapt it’s height to the ratio of the media/video pulled from dynamic data from my CPT ?
It looks like the current setup is a based ratio and then the video uses object-fit:cover; … but this is not working for my case.

Thanks for feedback.

Could you set html attributes with the values you want to set from dynamic tags and then use attr() in CSS to read those values and adapt the display for you on each instance?

this means my customer will have to set width and height in the BO when adding video all the time ? They are not really ‘computer friendly’ so i think this might not be the best option… i would like something that will auto detect the ratio of the video inside the player…