How to make My Youtube link Match what my Cover Image size

Solved

How to make My Youtube link Match what my Cover Image size

DavidBeuy
Excursionist
26 0 4

So for my product page I have a lot of Videos on YouTube that Id like to add for a sales tool. I can seem to figure out what code I need to target to take away the black border and have the YouTube video match the same size as my cover image. Is there anyone out that could help me out? The theme is Warehouse if that is helpful at all. And here is the link to the Product page so you can see what I'm talking about. 

https://usamadefactory.com/products/thrasher-htr-composite-60-100lbs-6-1pc-mf

The Size of the Cover Image is 1000x1000 and I just want it to where you click the video instead of it being a 6x9 ratio I want it to be square with now black fill behind the video

Accepted Solution (1)

namphan
Shopify Partner
2132 284 322

This is an accepted solution.

Hi @DavidBeuy,

Please go to Actions > Edit code > Assets > theme.css file and paste this at the bottom of the file:

.product-gallery__external-video .video-wrapper {
    height: 0;
    padding-bottom: 100%;
}
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com

View solution in original post

Replies 8 (8)

jennifer0188
Visitor
1 0 0

@DavidBeuy wrote:

So for my product page I have a lot of Videos on YouTube that Id like to add for a sales tool. I can seem to figure out what code I need to target to take away the black border and have the YouTube video match the same size as my cover image. Is there anyone out that could help me out? The theme is Warehouse if that is helpful at all. And here is the link to the Product page so you can see what I'm talking about. 

https://usamadefactory.com/products/thrasher-htr-/Skydiving in Bir Billing, Himachal Pradesh/composite-60-100lbs-6-1pc-mf

The Size of the Cover Image is 1000x1000 and I just want it to where you click the video instead of it being a 6x9 ratio I want it to be square with now black fill behind the video


Hello, @DavidBeuy 

 

I understand you want to embed YouTube videos on your product page and have them match the size of your cover image (1000x1000 pixels) without the black borders. Here's how you can achieve this using HTML and CSS:

HTML Code
First, ensure your YouTube video embed code is set to match the dimensions of your cover image:

 

<iframe width="1000" height="1000" src="https://www.youtube.com/embed/VIDEO_ID" frameborder="0" allowfullscreen></iframe>

 

CSS Code
Next, add some CSS to remove the black borders and ensure the video fills the entire container:

 

iframe {
width: 100%;
height: 100%;
border: none;
}

 

Full Example
Here's how you can integrate this into your Wix Studio Editor:

Add the HTML Code: Insert the iframe code into your product page where you want the video to appear.

Add the CSS Code: Add the CSS code to your theme's stylesheet or use the custom CSS section in Wix Studio Editor.

Additional Tips
Responsive Design: If you want the video to be responsive, you can use percentages instead of fixed pixel values for width and height.

Testing: Always test the changes on different devices and browsers to ensure the video displays correctly.

 

 

I hope this info is helpful to you.

 

 

Best Regard,
Jennifer Anderson

DavidBeuy
Excursionist
26 0 4

Hi Jennifer, thanks for the reply. So Im not sure if it is embedded or not. I Uploaded the video through the Upload URL on the Media area on the  Product Page where you can edit all the details of that product. So I don't know if it uses iFrame tag. I just cant seem to find the right code to target that video to remove the black boarder spacing. 

DitalTek
Shopify Partner
842 100 119

I think this issue it involve to how to you make video, you are make too much spacing both sides video.

DitalTek_0-1734691598785.png

 

- You can please Like and Accepted Solution if my suggestion helpful.
- And you want to hire developer Theme or App Shopify => Feel free to send me a DM or contact to us via Email | WhatApp
DavidBeuy
Excursionist
26 0 4

Ah the videos are shot in Square frame so that padding or white area is something that Youtube adds on. I want to remove that somehow

 

namphan
Shopify Partner
2132 284 322

This is an accepted solution.

Hi @DavidBeuy,

Please go to Actions > Edit code > Assets > theme.css file and paste this at the bottom of the file:

.product-gallery__external-video .video-wrapper {
    height: 0;
    padding-bottom: 100%;
}
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com
DavidBeuy
Excursionist
26 0 4

Works fantastic! Thank you @namphan

namphan
Shopify Partner
2132 284 322

Hi @DavidBeuy,

You're welcome and happy to help you 😊

Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com

DaisyVo
Shopify Partner
2325 288 334

Hi @DavidBeuy 

 

The configuration for the YouTube video is set to have a width greater than its height.
Even though the video inside has a 1:1 aspect ratio, it will still be displayed with a 16:9 aspect ratio.
In this case, the video's width will be full-width, while the height will adjust automatically. It cannot have a fixed height as mentioned, because it will change depending on the screen size.

 

I hope this helps

 

Best,

 

Daisy

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Avada SEO & Image Optimizer - The #1 SEO solution