oembed icon indicating copy to clipboard operation
oembed copied to clipboard

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

Open amimas opened this issue 4 years ago • 3 comments

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:

  • https://www.drupal.org/project/drupal/issues/3071682
  • https://www.drupal.org/project/drupal/issues/2966043

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?

amimas avatar Jun 15 '21 15:06 amimas

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

kylebrowning avatar Mar 28 '23 03:03 kylebrowning

Soundcloud also does not follow the height and width requirement

ChristopherMatthews avatar Sep 06 '23 07:09 ChristopherMatthews