How can I adjust video size for mobile view?

Topic summary

A user encountered an issue where embedded videos on their Shopify store shrink when played on mobile devices, creating white gaps on both edges instead of filling the screen width.

Solution provided:

  • Navigate to Shopify Admin → Online Store → Themes → Actions → Edit Code
  • Open Asset → base.css file
  • Add the following CSS at the bottom:
deferred-media video {
  object-fit: cover !important;
}

This CSS rule forces the video to cover the full width of the container on mobile view. The original poster confirmed the solution worked successfully.

Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

Hi guys,

I’d like to edit the video size in Mobile view

When I hit/ tap the play button, the video size shrinks and leaves white gaps at the both edges (as picture 1). How can I make the video covers the screen width completely (as the picture 2).

Please check my url: https://189ee3-2.myshopify.com/products/tank-top

Thank you,

@collins276 , do this to fix it in 20 seconds:

  1. In your Shopify Admin go to: online store > themes > actions > edit code
  2. Find Asset > base.css and paste this at the bottom of the file:
deferred-media video{
    object-fit: cover !important;
}

If it helps you please click on the “like” button and mark this answer as a solution!

Thank you.

Kind regards,
Diego

1 Like

Thank you :folded_hands: :grinning_face: