Shopify themes, liquid, logos, and UX
I have a video I am playing on my Shopify Store and it changes depending on mobile or desktop. Instead of loading both, and displaying one video or the other, I want to write some liquid code that says hey this is a mobile device, let me throw in this video or hey, this is a desktop device, let me throw in this video. Is this possible with liquid or must I JavaScript it?
Note: I am well aware that you can do this in CSS or in JavaScript but I want the server to handle this instead of the client.
@thejameshampton - you can upload videos to youtube and code it in the required way, that is the way for server to handle it.
If you upload video to your shopify then you can upload max 20mb video
You didn't even read the question
You can't do this server-side to my knowledge. From Chat GPT:
"you might need to consider server-side device detection, which can identify the device type (desktop or mobile) based on the user agent string of the incoming request. However, Shopify doesn't natively support server-side device detection."
I was trying to get 2nd thumbnail photo to not load on mobile only when I got this response.
So there's no answer to this simple question
Maybe there's a better way but I do it with JavaScript
let isMobile = window.innerWidth <= 768;
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024