Shopify themes, liquid, logos, and UX
I was struggling to get video to autoplay on the Origin theme homepage and found this code that I used to make a custom CSS section:
<video controls="" loop="" muted="" playsinline="" autoplay="" src="url" width="100%" height="100%"></video>
This is the preview of what it's looking like: https://60d67rdas8gg36td-55947755706.shopifypreview.com
It's working but I have two questions:
- is there a way to get rid of the video controls?
- can I make the video block clickable with a link?
thanks in advance
Solved! Go to the solution
This is an accepted solution.
Hello @Shredventure ,
You can remove the controls attribute from the <video> tag like this
<video loop muted playsinline autoplay src="url" width="100%" height="100%"></video>
To make the video block clickable with a link, wrap the <video> tag in an <a> tag and add a "href" attribute with the desired link URL like this:
<a href="https://example.com">
<video loop muted playsinline autoplay src="url" width="100%" height="100%"></video>
</a>
Hope this can help.
Ali Reviews team.
1. Yes, you have to just change the value of controls="false" autoplay="true" loop="true" muted the controls won't see.
2. Yes, you have to put video tag in the anchor tag like this <a href="your-link"><video> </video></a>
Please let me know if works and please like mark as solve!
This is an accepted solution.
Hello @Shredventure ,
You can remove the controls attribute from the <video> tag like this
<video loop muted playsinline autoplay src="url" width="100%" height="100%"></video>
To make the video block clickable with a link, wrap the <video> tag in an <a> tag and add a "href" attribute with the desired link URL like this:
<a href="https://example.com">
<video loop muted playsinline autoplay src="url" width="100%" height="100%"></video>
</a>
Hope this can help.
Ali Reviews team.
this worked perfectly, thanks!
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024