Add support for OEmbed settings max_width and max_height

Created on 24 April 2023, about 1 year ago
Updated 13 May 2023, about 1 year ago

Problem/Motivation

Core's OEmbed formatter has the option to specify max width and max height. These are then passed on to the OEmbed provider (YouTube, Vimeo etc.), which returns an appropriate width and height within those dimensions. (Well, it's a work in progress: ✨ Negotiate max width/height of oEmbed assets more intelligently Needs work ).

When using the Blazy OEmbed formatter, the max_width and max_height parameters are set to 0.

Steps to reproduce

Proposed resolution

Add the config options max_width and max_height.

I'm not sure what the best way is to achieve this. Could Blazy leverage core's OEmbed formatter somehow?

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

🇦🇺Australia imclean Tasmania

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @imclean
  • 🇮🇩Indonesia gausarts

    I am not sure about adding more options. It is too many by now.

    We do have Media image style option when using lightboxes to determine the iframe/ video dimensions, thus eliminating the need for such hardcoded width and height.

    We have several image style options used differently and sometimes re-purposed for different usages like seen at Colorbox options as employed by ElevatezoomPlus module:

    • Image style
    • Thumbnail style
    • Media image style
    • Lightbox image style
    • Responsive image style

    Perhaps using one of them is easier than creating new options? Says when lightbox is off, offer Media image style as the option instead while keeping it work when lightbox is selected.

    Thoughts?

  • 🇦🇺Australia imclean Tasmania

    Local images are probably fine but in terms of OEmbed video, max width and max height are part of the OEmbed specifications.

    The way OEmbed works (and hopefully Drupal too soon) is that these dimensions are passed on as query parameters to the OEmbed provider. The provider then returns the height and width of the video, respecting the video's native aspect ratio. They're not so much hard coded values in this case.

    For example, if you send max_width and max_height of 1000 x 1000, the OEmbed provider might return a video of the dimensions 1000 x 563. These dimensions are also contained in the json response.

    We use this feature in all our projects and are hoping to use it with a Slick carousel. But if there's another way to achieve this I'd be happy to use that.

  • 🇦🇺Australia imclean Tasmania

    This only happens when using Slick Paragraphs Media, not Slick Paragraphs Vanilla, which uses the OEmbed settings in the media entity.

    So potentially there's nothing to be done here, unless Slick Paragraphs Media could also use the OEmbed settings on the remote video media entity.

  • Status changed to Closed: works as designed about 1 year ago
  • 🇮🇩Indonesia gausarts

    Yes, Vanilla option is the easiest route for now.
    Vanilla means Blazy doesn't limit the potentials, and assumes you know better what you need. It simply facilitates the unknown.

    Feel free to re-open however if anyone has any value or patch to put in considering #2.

    Thanks.

Production build 0.69.0 2024