Hello, I am hoping to get some help with properly sizing a video on my website. Right now, I think the size is fine on the mobile version ( can you let me know your thoughts?)
Is there a way to resize the one on the desktop version so it’s not so huge? more centered on the desktop screen so it fits better and doesn’t take up as much space? Thoughts?
I would also like to know if there is a way I could automatically get the video to play when someone scrolls over it on my website?
the website is www.tropetails.com
Thank you in advance!
You can try this code by following these steps:
Step 1: Go to the online store ->Theme ->Edit Code.
Step 2: Find the theme.liquid file and add the following code before the tag
Result:
And for automatic video playback, you can refer to the instructions on this blog to achieve it
https://shopidev.shinetechsoftware.com/blogs/675bf523895ae883840771ca
Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!
Hi @margaretcbeeler ,
- Please go to Actions > Edit code > Assets > base.css file and paste this at the bottom of the file:
@media screen and (min-width: 990px) {
.video-section.section-template--18089802825868__video_jVT4tQ-padding {
width: 50%;
margin: auto;
}
.video-section.section-template--18089802825868__video_jVT4tQ-padding deferred-media {
--ratio-percent: 90% !important;
}
}
for 90% you can change it yourself to fit the design you want.
- For autoplay: Do you want it to start playing when scrolled to, and after scrolling past the video, will it turn off, or will it always autoplay?
Please let me know, I will check it.
It did not work and I pasted exactly where you said.
This did not work, the video is still huge
I can help you with it. So I need to access your store. Can you please share me your collaborator code?
Hello @margaretcbeeler ,
Here are the steps to apply the necessary changes in your Shopify store:
- In your Shopify Admin, navigate to Online Store > Themes > Actions > Edit Code.
- Locate Asset > Video-section.css and paste the following code at the bottom of the file:
body .video-section.section-template--18089802825868__video_jVT4tQ-padding {
width: 50% !important;
height:auto !important;
margin: 0 auto !important;
display:flex;
flex-direction:column;
}
body .video-section.section-template--18089802825868__video_jVT4tQ-padding deferred-media {
--ratio-percent: 110% !important;
}
@media screen and (min-width: 749px) {
.video-section__media {
display: block !important;
}
}
Let me know if you need further assistance!