# Embed videos aspect ratio

**URL:** <https://forum.getkirby.com/t/embed-videos-aspect-ratio/24912>\
**Category:** Questions\
**Created:** [March 7, 2022, 7:04am UTC](https://forum.getkirby.com/t/embed-videos-aspect-ratio/24912 "2022-03-07T07:04:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [March 7, 2022, 7:04am UTC](https://forum.getkirby.com/t/embed-videos-aspect-ratio/24912/1 "2022-03-07T07:04:42Z")

</div>

Hello 🙂 I use the video block to embed videos from Vimeo in my site. since some of the videos in this website are old they have different aspect ratio.

I would need to give the wrapper element of the video some padding like this: padding of 56.2% 0 0 0 so they could be shown with their full width and height, but some videos don’t fit to this magic number and it causes black gaps at the top and the bottom of the video. is there a way to get the aspect ratio of the video through Kirby video block?

I stumbled upon this protocol called [oEmbed](https://oembed.com/) and I was wondering if there’s a way to use it with Kirby as well. Or maybe there is a different way in Kirby to show videos with full width and height with their correct ratio.

Thanks in advance! 🙏

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [March 7, 2022, 7:22am UTC](https://forum.getkirby.com/t/embed-videos-aspect-ratio/24912/2 "2022-03-07T07:22:36Z")

</div>

Maybe store this information in your video block via additional width/height fields?

---

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [March 7, 2022, 9:18am UTC](https://forum.getkirby.com/t/embed-videos-aspect-ratio/24912/3 "2022-03-07T09:18:47Z")

</div>

Thanks! sounds good - how do I add additional field to the video block in the yml file?

```auto
  gallery: 
    type: fields
    fields: 
      media: 
        type: blocks
        fieldsets:
            - video
            image:
              name: image
              icon: images
              fields:
                image:
                  type: files

```

---

<div class="post-metadata">

**Author:** ![moonwalk](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@moonwalk](https://forum.getkirby.com/u/moonwalk)\
**Post date:** [March 7, 2022, 9:24am UTC](https://forum.getkirby.com/t/embed-videos-aspect-ratio/24912/4 "2022-03-07T09:24:51Z")

</div>

In the same way as you have modified the image block, i.e. overwrite `video.yml`. But if I were you, I wouldn’t do this in the page blueprint, but overwrite `image.yml` and `video.yml` in `/site/blueprints/blocks` to keep your page blueprint clean.

---

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [March 7, 2022, 9:32am UTC](https://forum.getkirby.com/t/embed-videos-aspect-ratio/24912/5 "2022-03-07T09:32:55Z")

</div>

Ahh I see! now I understand how I can edit the block elements. it’s very useful 🙂

thank a lot 🙏

---

<div class="post-metadata">

**Author:** ![rasteiner](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/rasteiner/32/4788_2.png) [@rasteiner](https://forum.getkirby.com/u/rasteiner)\
**Post date:** [March 7, 2022, 9:36am UTC](https://forum.getkirby.com/t/embed-videos-aspect-ratio/24912/6 "2022-03-07T09:36:28Z")

</div>

There’s also this field plugin: [GitHub - sylvainjule/kirby-embed: Embed field for Kirby 3.](https://github.com/sylvainjule/kirby-embed)  
It automatically queries the source and stores different stuff about the embed (like height, width, and aspect ratio).

You could use that field in your video block
