We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Video aspect ratio in video with text template

Video aspect ratio in video with text template

ramyaq
Explorer
56 0 19

Screenshot (170).png

Screenshot (171).png

I want to change the aspect ratio of my video to match the landscape box of it. What code do I require in the CSS section? I want the video to be an auto loop, and it starts as soon as the landing page loads.

  

Replies 3 (3)

TheScriptFlow_
Shopify Partner
848 63 106

Could you please share your store URL and password [if applicable] so that I can take a look and provide you solution code.

Looking forward to hearing back from you.

Thanks

- Need a Shopify Specialist? Chat on WhatsApp +923036471248 Or Email at info@thescriptflow.com

- Boost Your Sales with Affiliate Marketing - UpPromote: Affiliate & Referral


- If my solution was helpful, mark it as a solution and hit the like button!

ramyaq
Explorer
56 0 19

FastBundle-Ian
Excursionist
53 0 3

Hi there! Hope you are well.

 

Ian here from Fast Bundle.
The general code is here but you must customize it based on your theme and it's elements.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Video Landing Page</title>
<style>
/* Full screen layout */
body, html {
margin: 0;
padding: 0;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #000; /* optional background */
}

/* Landscape box */
.video-container {
width: 80vw; /* 80% of viewport width */
aspect-ratio: 16 / 9; /* landscape aspect ratio */
overflow: hidden;
position: relative;
border-radius: 10px; /* optional rounded corners */
box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.video-container video {
width: 100%;
height: 100%;
object-fit: cover; /* makes sure video fills container while keeping aspect */
}
</style>
</head>
<body>

<div class="video-container">
<video autoplay loop muted playsinline>
<source src="your-video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>

</body>
</html>

Please let me know if it works by a Like or marking it as a solution!
Best Regards | Ian

Fast Bundle - Seamless Bundle Builder for Shopify Merchants.