Shopify themes, liquid, logos, and UX
I have embedded a video from YouTube on my online store. I want the video smaller and I want it to autoplay. I cannot figure out how to accomplish either. My theme is craft. Thank you!
Solved! Go to the solution
This is an accepted solution.
Hi @havenmercantile,
May I suggest to update code these steps:
1. Go to Store Online-> theme -> edit code
2. sections/video.liquid
3. Add code below to top of file
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
if($('.video-section__poster').length > 0){
$(".video-section__poster").click();
$(".video-section video").on("loadeddata", function() {
var video = $(" .video-section video").get(0);
video.play();
});
}
});
</script>
This is an accepted solution.
Hi @havenmercantile,
May I suggest to update code these steps:
1. Go to Store Online-> theme -> edit code
2. sections/video.liquid
3. Add code below to top of file
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
if($('.video-section__poster').length > 0){
$(".video-section__poster").click();
$(".video-section video").on("loadeddata", function() {
var video = $(" .video-section video").get(0);
video.play();
});
}
});
</script>
You are awesome. Thank you so much!
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025