oembed icon indicating copy to clipboard operation
oembed copied to clipboard

Support responsive rich resource types

Open robd003 opened this issue 6 years ago • 4 comments

A lot of widgets have a minimum width or height and if the consumer tries to scale down a rich content response for a mobile browser by using an assumed aspect ratio from the height/width it will most likely cut off part of the content.

robd003 avatar Jun 29 '18 23:06 robd003

I've had problems with my static height widget being resized due to consumers assuming they should use an aspect ratio when displaying our content. If we implement a min & max for width and height then responsive widgets can be displayed without having content cut off or tons of whitespace.

robd003 avatar Jun 29 '18 23:06 robd003

@iamcal Any chance we could discuss this pull request?

robd003 avatar Jul 24 '18 23:07 robd003

Why not set an aspect ratio instead of a min max width height? Bootstrap wraps iframes with a div like this https://getbootstrap.com/docs/4.5/utilities/embed/#aspect-ratios This adds some CSS that does this

.embed-responsive-16by9::before {
    padding-top: 56.25%;
}
.embed-responsive::before {
    display: block;
    content: "";
}

Which can be calculated like shown in this file https://github.com/twbs/bootstrap/blob/c28934cb1871d6b6bd6a866660493a1137de17c6/scss/helpers/_embed.scss

trackleft avatar Aug 19 '20 19:08 trackleft