Problem/Motivation

Remote videos are displayed in an iFrame with width and height attributes hardcoded. There are currently two possible ways to determine the values.

  1. From the oEmbed response (when maximum width and/and maximum height are 0)
  2. From the maximum width and maximum height fields (when maximum width and/or maximum height are greater than 0)

When maxwidth and maxheight are sent as part of the request to the oEmbed resource, the response will contain new width and height values which both fit within the maximums set. This maintains the video's aspect ratio.

The maximum height and maximum width values are correctly sent in the oEmbed request but the return values are being ignored.

Rather than using maximum width and maximum height to specify the exact dimensions, the oEmbed resource values for height and width should be used.

Steps to reproduce

  1. In a remote video field set both maximum width and maximum height to 100 pixels
  2. Add a video using the oEmbed URL widget: https://vimeo.com/7073899
  3. Save it and view the output.

Expected result

Video with width 100 and height 67.

Actual result

Video with width 100 and height 100.

Proposed resolution

Use the oEmbed returned height and width values.

Remaining tasks

Update test
Implement change

User interface changes

API changes

Data model changes

Release notes snippet

Comments

imclean created an issue. See original summary.

imclean’s picture

Issue summary: View changes
imclean’s picture

Status: Active » Needs review
StatusFileSize
new707 bytes
new1.53 KB
imclean’s picture

I've added a longer explanation in another issue. #3060968-51: Some oEmbed videos do not maintain aspect ratio

imclean’s picture

Issue summary: View changes
imclean’s picture

Issue summary: View changes

Status: Needs review » Needs work

The last submitted patch, 3: oembed_video_use_height_width-3310520-3.patch, failed testing. View results

imclean’s picture

Status: Needs work » Needs review
StatusFileSize
new960 bytes
new1.78 KB
imclean’s picture

Sorry for the noise. I failed to notice that the changes applied to all oEmbed resources, even those without height and width.

imclean’s picture

Last one I think. I can update the test only patch if this one passes.

The last submitted patch, 9: oembed_video_use_height_width-3310520-9.patch, failed testing. View results

The last submitted patch, 10: oembed_video_use_height_width-3310520-10.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 11: oembed_video_use_height_width-3310520-11.patch, failed testing. View results

wim leers’s picture

The changes make sense to me.

To convince myself of this, I created this small isolated experiment:

<?php

$max_width = 100;
$actual_width = 67;


// When an actual width is returned by the oEmbed provider.
$concluded_width_currently = $max_width ?: $actual_width;
$concluded_width_proposed = $actual_width ?: $max_width;
var_dump($concluded_width_currently);
var_dump($concluded_width_proposed);


// When NO actual width is returned by the oEmbed provider.
$actual_width = NULL;
$concluded_width_currently = $max_width ?: $actual_width;
$concluded_width_proposed = $actual_width ?: $max_width;
var_dump($concluded_width_currently);
var_dump($concluded_width_proposed);

Looks like there's some tests that still need to be updated though.

cilefen’s picture

Version: 9.4.x-dev » 9.5.x-dev

No one has reported this before?

wim leers’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2966656: Negotiate max width/height of oEmbed assets more intelligently

A simple search for oEmbed height immediately surfaced #2966656: Negotiate max width/height of oEmbed assets more intelligently. So, yes, this is a duplicate.

@imclean: can you please move your last patch to that issue? Because that already has eyes on it from a media system maintainer! 😊

Thanks!

imclean’s picture

Good find, I did that exact search, among others, and missed that issue. I'll review my patch and upload it to the other issue.