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.
- From the oEmbed response (when maximum width and/and maximum height are 0)
- 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
- In a remote video field set both maximum width and maximum height to 100 pixels
- Add a video using the oEmbed URL widget: https://vimeo.com/7073899
- 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
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | oembed_video_use_height_width-3310520-11.patch | 2.73 KB | imclean |
| #10 | oembed_video_use_height_width-3310520-10.patch | 1.81 KB | imclean |
| #9 | oembed_video_use_height_width-3310520-9.patch | 1.78 KB | imclean |
| #9 | oembed_video_use_height_width-3310520-9-TEST-ONLY-FAIL.patch | 960 bytes | imclean |
Comments
Comment #2
imclean commentedComment #3
imclean commentedComment #4
imclean commentedI've added a longer explanation in another issue. #3060968-51: Some oEmbed videos do not maintain aspect ratio
Comment #5
imclean commentedComment #6
imclean commentedComment #9
imclean commentedComment #10
imclean commentedSorry for the noise. I failed to notice that the changes applied to all oEmbed resources, even those without height and width.
Comment #11
imclean commentedLast one I think. I can update the test only patch if this one passes.
Comment #15
wim leersThe changes make sense to me.
To convince myself of this, I created this small isolated experiment:
Looks like there's some tests that still need to be updated though.
Comment #16
cilefen commentedNo one has reported this before?
Comment #17
wim leersA simple search for 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!
Comment #18
imclean commentedGood find, I did that exact search, among others, and missed that issue. I'll review my patch and upload it to the other issue.