A user is attempting to add YouTube Shorts (9:16 portrait videos) as product media on a Shopify store, but encounters display issues. The videos appear in landscape format with black bars on desktop and trigger an unwanted modal overlay on mobile devices.
Applying custom CSS to adjust aspect ratio (--ratio: 0.5625)
Remaining problems:
Desktop: CSS fix works correctly
Mobile: Video preview looks acceptable, but clicking opens a modal instead of playing inline
Goal: Remove the modal and enable direct playback on mobile, matching desktop behavior
Technical context:
The user is working with Shopify’s Sense theme, which uses main-product.liquid rather than product.liquid. The modal behavior appears to trigger on screens under 750px width. Multiple liquid files and JavaScript components control the media gallery behavior.
Status: Discussion remains open. One helper offered to assist via email to review the full code. Another user reported experiencing the same issue and requested the solution once found.
Summarized with AI on November 11.
AI used: claude-sonnet-4-5-20250929.
However, this only works for desktop. On mobile, the video preview looks OK, but when I click on it, instead of playing the video, it opens a model (overlay?) which doesn’t look correct (looks landscape), and clicking on that will eventually play the video.
Q: How can I get rid of this modal and make the mobile web work just like the desktop version?
Yes, that’s the goal.
Adding YouTube videos comes with yge theme but it doesn’t work with YT short URLs by default. To make it work the URL must e in this format: youtube.com/watch?v=9xkJtEJbBBM
What you could do, since you might want to have that modal/cover image feature for a future case and don’t want to mess up the settings, is create a new section, where it’s just the video with the sizing that you want. Then you can add your description and other information. This link is helpful: https://community.shopify.com/c/technical-q-a/remove-cover-image-from-video/td-p/1718698
Do you have any experience creating custom sections on Shopify? I can walk you through it if you need me to.
I can also set this up for you if you need help as well. Let me know.
I have seen that link. It’s not what I want to do.
The new section is good only for videos. What I am using is the default product media section which consists of both image and video and many related settings such as thumbnails, 1 or 2 columns and many other things.
So, using a new video section doesn’t seem to be an option.
I need to keep everything as is and just get rid of the modal.
@shExplorer , both the product image and video slide are wrapped in a li tag, so something you could try is in your product.liquid page, comment out the tag with all the code inside, and right under the <div class="product-media-container>, paste in the
code to see if that works.
This should remove the modal and keep the same style as the desktop version.
You might have to do some adjustments with the styles though.
Where exactly do you want me to make this change?
Which .liquid file? Also, what’s the point if it’s not in liquid?
e.g. I can change the CSS style on the fly in the browser and make it work but the whole point is to make the change in the theme code (ie. .liquid template files)
Am I missing something here?
You’re essentially replacing the current mobile video player code with the desktop code.
Also, could you share the CSS code you used to make this work? There may be a way to just paste it in directly and fix this issue if I could see the code you used.
As I mentioned before, main-product.liquid does not have anything similar to the HTML you posted above. The final html code seems to be generated by all or a combination of the following:
main-product.liquid
product-media-gallery.liquid
product-media.liquid
product-media-modal.liquid
component-deferred-media.css
global.js
media-gallery.js
I have touched almost all of the above and was able to make it look a little better on mobile but still have not figured out where it decides to show the modal and how to replicate desktop-like behavior on mobile.