Jump to content

Change the aspect ratio of the video container

Recommended Posts

Hello,

I need to change the aspect ratio of the video container so that it can be customized to different video sizes. Currently, the only option I have is to keep it in landscape format, but I have some videos that are in portrait or square format. Can you please help me with this issue? 

Ex: I want this two videos to be portrait (I can crop them on after effects if needed)

image.thumb.png.3510c960da1c8e31d27f8ca2eee1503d.png

Or these ones (the videos are already portrait but the container is landscape):

image.thumb.png.275b46bcf61dc13d1257c5d3423eaede.png

Thank you so much!

Link to comment

Hi. It is a little bit harder to give you the best advice without seeing your website, but I can write here 2 solutions that might work but it all depends of the structure you are having in your video block:

The first:

.video-block { 
    .video-player {
       padding-bottom: 177% !important
    }
}

The second if the first does not work for you:

.video-block {
   .embed-block-wrapper,
   .intrinsic-inner {
    padding-bottom: 177% !important
  }
}

For further explanation or other options please visit my article:

https://www.ui-workarounds.com/control-the-aspect-ratio-of-your-videos-in-squarespace/

If these 2 examples don't help please let me know. The 177% is for 9/16 portrait aspect ratio.

Edited by joseph81

Jozsef Kerekes - Front-end developer and Squarespace enthusiast
My Blog: https://ui-workarounds.com
If you like my answer, please give me an upvote/like. Highly appreciated.

 

 

Link to comment
  • 4 weeks later...

Hello @joseph81,

I have a similar problem.

I need to change the aspect ratio of the video container so that the whole video can be seen on the page. Currently there is empty space above and below the video. 

I already tried your solution but it doesn't work.

www.psk-legal.de/home-2

PW: psk_ws2022

 

Screenshot 2023-02-27 at 14-09-01 Pachmann Schuback Khan.png

Edited by floren_dina
Link to comment

Thank you! That works for the top. And only in squarespace backend. As soon as I leave the backend the video container jumps back to the original size.

Underneath the video ist still a white space. How can I remove this too?

Edited by floren_dina
Link to comment

Actually these are the right classes. But for underneath the video, that seems like the flexible grid issue of Squarespace. Maybe you could delete the video and add it again(keeping the new CSS code). 

.video-block .video-player {
    padding-top: 38.25%;
}

 

Jozsef Kerekes - Front-end developer and Squarespace enthusiast
My Blog: https://ui-workarounds.com
If you like my answer, please give me an upvote/like. Highly appreciated.

 

 

Link to comment

You just need to play with the percentages:

.video-block .video-player {
    padding-top: 16.25% !important;
}

If you want to take out the 2px top and bottom space then write this also:

.video-block {
	border: none!important;
}

 

Jozsef Kerekes - Front-end developer and Squarespace enthusiast
My Blog: https://ui-workarounds.com
If you like my answer, please give me an upvote/like. Highly appreciated.

 

 

Link to comment
  • 2 weeks later...

Hi @joseph81 !

Can you pls pls help me as well? I have different videos on my site and when I use square videos the video itself doesnt fill the frame. How can I just tell the square videos to "fit to frame" so to speak? The video is the one with the numbers/ coordinates to the right.

Very thankful, Anders

 

Screenshot 2023-03-23 at 20.40.42.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.