iamcal / oembed

The oEmbed Spec
http://oembed.com
MIT License
1.32k stars 651 forks source link

Loosen up `height` and `width` requirement or define a new type #557

Open amimas opened 3 years ago

amimas commented 3 years ago

I'm working on building a plugin for a markdown parser. The idea is that an URL from a provider will automatically be replaced with appropriate contents from the provider, when the markdown file is parsed and converted into a static html file.

According to oEmbed spec, the rich media type embeds must have a height and width set. However, twitter doesn't follow that requirement from the spec.

https://developer.twitter.com/en/docs/twitter-for-websites/oembed-api

I'd love to follow the spec but it's difficult to do that when providers do not respect the spec. Not sure if this was brought to your attention or not. I can understand that it is difficult for twitter to set a constrained height and width. It seems Drupal already decided to loosen the validation of provider response:

Does it make sense to loosen the requirement in the spec about height and width for rich type responses? In general, rich type embed response is very broad topic. As you can see in the above example, sometimes these requirements are not feasible.

Or, should there be a completely new "type" defined?

kylebrowning commented 1 year ago

For native mobile embeds not having the width and the height wreaks havoc fast performing scroll views.

ChristopherMatthews commented 1 year ago

Soundcloud also does not follow the height and width requirement