I have been trying to figure out how to prompt different videos to launch depending on whether the user is viewing the shop on mobile or desktop.
I was told that if I uploaded two custom liquid codes featuring the landscape video (desktop) and portrait video (mobile) then there was a code that would prompt each one to launch for each device.
This was the code I was suggested :
/* Code for Desktop Banner */
@media screen and (max-width: 480px){ #shopify-section-template–22677475131741__custom_liquid_geKPV3 {
display: none;
/* Code contrubution by websensepro.com */
}}
/* Code for Mobile Banner / @media screen and (max-width: 480px) { #shopify-section-template–22677475131741__custom_liquid_zMBVDz {
display: block !important;
/ Code contrubution by websensepro.com */
}}
Now with the code it displays perfectly within the customise tool and also only displays one video on desktop but once I view on a mobile it displays both like so :
How can this be done? i have added a video block and then tried to include the code but nothing worked. I have also tried to include the code within the “edit code” in a new section which i called custom video but nothing happened.
In which section does the custom liquid have to be included and how can i make it play automatically.
Could you please provide the steps for displaying 2 different videos: one for mobile and one for desktop.
Hello! Thanks for your reply. We haven’t launched it yet, it is password protected for visitors. Shall i e-mail the password for visitors to you?
We have added on the homepage a video section from template and tried to put the liquid code with the link of the video but it says that the sintax is wrong. I have tried all this on a copy but nothing worked. I have added the video as a property instead of a liquid code. Also tried to add custom css to the video but nothing, tried to change in html still nothing. Also it’s not playing on loop without having to press play.
Thrilled I found this chat as I have been looking for a similar solution. I currently have my site set up for different banner images but want to change it to having different banner videos for mobile and desktop - I could not find any video or discussion talking about this (only banner images). @EBOOST is it possible to take a quick look at mine to help me figure out what code is needed?
Which theme are you using? If you don’t use a free theme. Could you share code of video section? Because The fee theme will have other structure and I can’t access to see their code. So I need you share code. I will help to apply it for you.
Hello - thanks for the reply. So this works if I just want a different ‘video’, however what i am looking for is different ‘video banners’. That way I can put text/buttons over it.
Unfortunately it is not working properly. Although there is now the option to put a separate desktop and mobile video, the banner is containerized on desktop, even when you disable that option and the videos do not autoplay . Also my mobile video display size is very small with banner and button overlap too big.