I’m finally working on updating my site from Kirby1.something to the latest release. It’s mostly going well but one thing has me stumped. On pages that have a YouTube or Vimeo embed (using kirbytext), the embed appears at 300px x 150px.
Previously I’d just do this
(vimeo: https://vimeo.com/176644101)
And the video would be the same width as the page text, with height scaled depending on the video aspect ratio. With Kirby 2 that gives me a tiny postage stamp embed.
If I add “width:100%” to the kirbytext tag, the width is as expected but the height is still 150. The only way I’ve found to get a different height is to specify it precisely.
I thought I might have introduced something about video sizes (e.g. with the Phantom theme I’m trying to use). But if I backtrack to my initial git commit (an unmodified copy of the Kirby starter kit), I get the same results.
the kirby video tag automatically wraps the iframe with a figure element and sets a class that you can change via config file (you could also run with the standard kirby class and name your css class appropriately)
I use the video-wrapper css class so I had to set this:
Andi-Lo, I added those styles to assets/css/main.css and added that config line to site/config/config.php. The video is still the same size, but now there’s a lot of extra whitespace around it. It looks like the video-wrapper class is the correct size, but the iframe inside it is still 300x150.
I’m not setting the iframe height. I’m using an unmodified copy of the Kirby starter kit, so I have what it has and nothing more-- no extra code, and no CSS modifications. I’ve tried the embed tag with and without height and width. Even with neither of them I still get 300x150:
That works! Thanks. Now that I look back at my old Kirby 1.x stuff, your styles are almost the same as what I had been using. I wonder why this was dropped from the Kirby 2 starter kit. Thanks again.