Jump to content

Scaling background videos for mobile

Recommended Posts

On 6/15/2023 at 9:19 PM, 27Moon said:

thanks for your reply. I've added the code but unfortunately it doesn't look correct, now the header is almost completely gone and actually the black banner up and down is not disappearing. Any hints?

Screenshot 2023-06-15 at 15.22.18.png

Use this new code

@media screen and (max-width:767px) {
[data-section-id="64496145f57a345d30632979"] {
    min-height: unset !important;
    height: 20vh;
}
    [data-section-id="64496145f57a345d30632979"] h1 {
        font-size: 20px;
        line-height: 30px;
        position: relative;
        top: 50px;
    }
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Hey Tuanphan, 

I just launched a real estate site and am running into the same thing with a background video. On the desktop it looks totally fine but the scaling on mobile is way off. I am guessing most people coming to my site will be looking on their phones so would love to have it correct. 

Website is www.smithmountainlakerealestate.com

 

attached a few screen shots. What would be the best way to make sure it fits right on both desktop and mobile. Thank you so much for your time. 

 

IMG_2640.thumb.PNG.d6078094cdef97ef005a157e1e68b25f.PNGIMG_2641.thumb.PNG.686da5a9f1bfd959be6edea5279bf3dc.PNGScreenShot2023-06-21at12_21_30PM.thumb.png.d1cff85c6cf9aea36b9db044e30280c7.png

Link to comment
On 6/21/2023 at 11:24 PM, BillyDesign123 said:

Hey Tuanphan, 

I just launched a real estate site and am running into the same thing with a background video. On the desktop it looks totally fine but the scaling on mobile is way off. I am guessing most people coming to my site will be looking on their phones so would love to have it correct. 

Website is www.smithmountainlakerealestate.com

 

attached a few screen shots. What would be the best way to make sure it fits right on both desktop and mobile. Thank you so much for your time. 

 

IMG_2640.thumb.PNG.d6078094cdef97ef005a157e1e68b25f.PNGIMG_2641.thumb.PNG.686da5a9f1bfd959be6edea5279bf3dc.PNGScreenShot2023-06-21at12_21_30PM.thumb.png.d1cff85c6cf9aea36b9db044e30280c7.png

Can you share link to page where you use video?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 5 months later...
  • 1 month later...

Hi! I'm having the same issue on my site. https://seniorpost-cms.squarespace.com/new-home

It's a vinmeo video uploaded as a section background. Resizing the page though, the visible part of the video get smaller and smaller until all I have left is the middle of the video. 😞

 

**update - Besides the other code snippets here, I tried changing the aspect ratio on the iframe to aspect-ration: 16/9 !important; widith: auto!important. If I insert different number, I do see changes there, but just moving the iframe left or right, I can't seem to get it to fully display correctly on mobile.

 

Can someone help please?

Edited by SarahGrubb
Update
Link to comment
23 hours ago, SarahGrubb said:

Hi! I'm having the same issue on my site. https://seniorpost-cms.squarespace.com/new-home

It's a vinmeo video uploaded as a section background. Resizing the page though, the visible part of the video get smaller and smaller until all I have left is the middle of the video. 😞

 

**update - Besides the other code snippets here, I tried changing the aspect ratio on the iframe to aspect-ration: 16/9 !important; widith: auto!important. If I insert different number, I do see changes there, but just moving the iframe left or right, I can't seem to get it to fully display correctly on mobile.

 

Can someone help please?

I see you solved?

Or no, but if make it fullsize, we will need to reduce its height

image.thumb.png.7a9630d69c8e45501e06ec5ce5c425bc.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 months later...
On 5/10/2024 at 10:40 PM, MatthiasHoegg said:

@tuanphan I've got the same issue on my website https://matthiashoegg.com/

I'd like the index header video to not be cropped on mobile, so ideally it always maintains it's 16:9 proportions. 

Many thanks 🙏

You mean this video?

image.png.a44c7b54690f54c16bb758d2e06cfced.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
6 hours ago, MatthiasHoegg said:

@tuanphanthat’s the one I want to lock the proportions of, or not crop as much, yes. Thanks for looking into it 🙏🙏

You can use this code to Website > Website Tools > Custom CSS

@media screen and (max-width:640px) {
body.homepage .page-banner-wrapper.page-banner-has-video {
    height: 30vh !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 5 weeks later...

Anyone is interested in using AI Smart cropping the videos so that it can be served with different version automatically? We can achieve that using Cloudinary https://videoapi.cloudinary.com/video-demo/video-smart-cropping but it need to tweak the URL to make it work on SQS background video, drop your Background videos here so we can take a look

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

hi all, 

same as everyone else I here and the bad mobile adaptation of the desktop site. 
Why Is the formatting for this so difficult?

anyway, my background video on desktop for my cover page looks fine and the button stays put, but for mobile it crops it terribly and the button moves around. Just want it the video to stay full between the borders. 

www.wearesupermutt.com

Link to comment
On 6/13/2024 at 2:50 AM, createwithbecks said:

@tuanphan Hi there - I have tried every custom code in every forum you have replied to for this but none of them work for me. I am trying to have my top video on my homepage not cut off in mobile view on the sides, can you share a custom code that I could try to use for this? https://www.thunderbirdflorida.com

You can use this to Website Tools (under Not Linked) > Custom CSS

@media screen and (max-width:767px) {
section[data-section-id="663dfb6d72e54f336c20d483"] {
video {
    object-fit: contain !important;
}
& {
    min-height: unset !important;
    height: 25vh !important;
}
h1 {
    font-size: 30px !important;
    margin-bottom: 0px !important;
}
.html-block {
    position: relative;
    top: -50px;
}}}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.