User alexmas reported issues embedding Bunny.net Stream videos in Discourse, noting that direct links show only a preview image and iframe embeds display nothing. Falco and Canapin confirmed the iframe must be added to the allowed iframes site setting for it to render — which it does, albeit small. alexmas tested both Bunny’s non-responsive and responsive iframe codes, but encountered sizing issues: non-responsive renders too large, responsive too small. Canapin explained that Discourse strips iframe style attributes, making automatic resizing impossible without custom CSS or theme modifications. The best workaround is to use a simple iframe without the responsive wrapper and let users click fullscreen. alexmas settled on using Bunny’s non-responsive code with width="99%" height="300" for acceptable cross-device display, acknowledging that Onebox support for Bunny Stream (currently limited to YouTube, Vimeo, TikTok) would be ideal but unlikely without community contribution via pr-welcome.
I’m not sure an iframe here can properly resize the video.
Style attributes are stripped out from the <iframe> tag, so setting sizes here won’t have any effect, unless you add the CSS in your own theme. But it won’t do magic.
If you set the iframe width to 100% of the post container, it will render like this:
And you can’t set an automatic height that will depend on the video’s ratio.
I think there’s no straightforward solution other than using the small video (don’t put the <div style="position: relative; padding-top: 56.25%;"> part as it will be removed when you post anyway), and people who want to see the video in a larger format will click on the fullscreen icon on the bottom right of the video.
You can also post on Contribute > Feature to ask if a onebox support for Bunny stream videos could be made, but unless there’s a high demand (which I doubt), it will likely belong to the pr-welcome tag, which means that the team won’t add the feature themselves but anyone with a bit of coding knowledge is welcome to code this feature so it can be added into Discourse eventually.