The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- Status changed to Needs review
almost 2 years ago 12:36am 31 January 2023 - Status changed to Needs work
almost 2 years ago 6:31pm 1 March 2023 - πΊπΈUnited States smustgrave
Tried testing this with 1000X1000 and the image appears zoomed in to me with the patch.
- Status changed to Needs review
almost 2 years ago 9:45pm 1 March 2023 - π¦πΊAustralia imclean Tasmania
This happens if you set the max_width too high for the region the video is in. I'm not sure what the media module should (or can) do here.
That said, it appears to be a thumbnail issue. I can replicate #35 but when I play the video it fits within the iFrame.
The thumbnail is a fixed width. This was handled in another issue - π Media thumbnail dimensions are wrong for YouTube videos Fixed .
- Status changed to Needs work
almost 2 years ago 3:11pm 2 March 2023 - πΊπΈUnited States smustgrave
So this seems to be just Vimeo videos and not affecting YouTube ones. Using a Vimeo video I was able to replicate the same as #31.
Moving to NW for an issue summary to specifically call out what is the proposed solution. Might be worth noting this doesn't affect YouTube, even though the original post mentions this issue was primarily with YouTube videos.
- π¦πΊAustralia imclean Tasmania
I'm not sure what else I can add to this. The patch does what's described in the updated IS. Google has problems, there are a few issues around that. In this case, the thumbnail is the problem.
Plain embed:
https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=dPiLx...
With maxwidth and maxheight set:
https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=dPiLx...
The thumbnail size doesn't change, but that also doesn't fully explain the problem here.
Plain Google embed without Drupal has the thumbnail problem you describe in #35. Review the following at various browser widths:
https://www.youtube.com/embed/dPiLxdBOnTs
The Oembed spec states thumbnail dimensions must respect maxwidth and maxheight parameters, but clearly this isn't happening with YouTube.
(As an aside, Vimeo seems to handle responsive thumbnails well.)
What do you think we could do here to get around the problem with YouTube's thumbnails? I'd be happy to look into it, but I don't really have any suggestions, other than a theme or JS hack.
- πΊπΈUnited States smustgrave
No donβt need the thumbnail addressed here but I see the expected behavior in the IS but not what clear what was done to address it.
But if you think thatβs not needed can remove the tag and put back into review also
- Status changed to Needs review
almost 2 years ago 11:12pm 2 March 2023 - π¦πΊAustralia imclean Tasmania
+++ b/core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php @@ -224,8 +224,8 @@ public function viewElements(FieldItemListInterface $items, $langcode) { - 'width' => $max_width ?: $resource->getWidth(), - 'height' => $max_height ?: $resource->getHeight(), + 'width' => $resource->getWidth() ?: $max_width, + 'height' => $resource->getHeight() ?: $max_height,
This is the key change in this issue and it affects all video providers.
$max_width
and$max_height
are the values set in the field formatter. These are sent to the oembed provider as the parametersmaxwidth
andmaxheight
.$resource->getWidth()
and$resource->getHeight()
are the values returned by the video provider, which take into account the values sent with the request.Before the patch the dimensions of the video were set the values set as
$max_width
and$max_height
.After the patch, the dimensions are set to the returned values
$resource->getWidth()
and$resource->getHeight()
.It'd be nice to get a few more reviews here.
- Status changed to Needs work
almost 2 years ago 1:27pm 15 March 2023 - π¦πΉAustria hudri Austria
I've tested patch #27 (can't use patch #34 because it does not apply on Drupal v10.0.x, but code in #34 looks pretty similar). The patch has errors when any dimension field is empty. Error log shows access denied, most likley due missing query parameter values.
Field formatter setting
width="1920", height=""
causes an error:
Path: /media/oembed?url=https%3A//www.youtube.com/watch.....&max_width=1920&max_height&hash=.....
Field formatter setting
width="1920", height="1080"
works:
Path: /media/oembed?url=https%3A//www.youtube.com/watch.....&max_width=1920&max_height=1080&hash=.....
- Status changed to Needs review
almost 2 years ago 9:24pm 16 March 2023 - Status changed to RTBC
over 1 year ago 6:31pm 6 April 2023 - πΊπΈUnited States smustgrave
Retested following #31 and got the whitespace and with the patch I did not.
Also may somewhat be related to β¨ Allow oEmbed video iFrames to expand to available space Needs work
The last submitted patch, 34: 2966656-34.patch, failed testing. View results β
- Status changed to Needs work
over 1 year ago 10:24pm 12 April 2023 - π¦πΊAustralia imclean Tasmania
Could this be related? π [random test failure] MediaTest::testLinkManualDecorator() Fixed
- Status changed to RTBC
over 1 year ago 10:56pm 12 April 2023 - πΊπΈUnited States smustgrave
Random ckeditor error.
Know spokje has been working on the random failures.
- last update
over 1 year ago 29,202 pass - last update
over 1 year ago 29,283 pass - last update
over 1 year ago 29,300 pass - last update
over 1 year ago 29,302 pass 14:06 9:23 Running- last update
over 1 year ago 29,359 pass - last update
over 1 year ago 29,366 pass - last update
over 1 year ago 29,366 pass - last update
over 1 year ago 29,371 pass - last update
over 1 year ago 29,378 pass - last update
over 1 year ago 29,379 pass - last update
over 1 year ago 29,380 pass - last update
over 1 year ago 29,383 pass - last update
over 1 year ago 29,388 pass - last update
over 1 year ago 29,388 pass - last update
over 1 year ago 29,387 pass, 2 fail The last submitted patch, 34: 2966656-34.patch, failed testing. View results β
44:08 16:19 Running- last update
over 1 year ago 29,396 pass - last update
over 1 year ago 29,399 pass 14:07 10:39 Running- last update
over 1 year ago 29,400 pass - Open on Drupal.org βEnvironment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago 29,409 pass - last update
over 1 year ago 29,415 pass - last update
over 1 year ago 29,420 pass - last update
over 1 year ago 29,420 pass - last update
over 1 year ago 29,425 pass - last update
over 1 year ago 29,429 pass 59:08 5:15 Running- last update
over 1 year ago 29,430 pass - last update
over 1 year ago 29,430 pass - last update
over 1 year ago 29,436 pass - last update
over 1 year ago 29,436 pass - last update
over 1 year ago 29,436 pass - last update
over 1 year ago 29,442 pass - last update
over 1 year ago 29,443 pass - last update
over 1 year ago 29,443 pass - last update
over 1 year ago 29,443 pass - last update
over 1 year ago 29,439 pass - last update
over 1 year ago 29,439 pass - last update
over 1 year ago 29,443 pass - last update
over 1 year ago 29,444 pass 29:08 27:59 Running- last update
over 1 year ago 29,446 pass - last update
over 1 year ago 29,446 pass - last update
over 1 year ago 29,447 pass - Status changed to Needs work
over 1 year ago 2:16pm 21 July 2023 - π¬π§United Kingdom longwave UK
The patch and fix look good, but I think this needs a release note - this may change the size of embedded video on existing sites when they upgrade?
- πΊπΈUnited States smustgrave
Hiding patches for clarity
Updated issue summary with release note (not great at those)
Moved patch into MR.
- Merge request !7041Issue #2966656 by imclean, cilefen: Negotiate max width/height of oEmbed assets more intelligently β (Closed) created by smustgrave
- Status changed to RTBC
9 months ago 4:23pm 14 March 2024 - πΊπΈUnited States smustgrave
Tests are all green. Since this was previously RTBC going to restore status.
- Status changed to Needs review
9 months ago 11:15pm 23 March 2024 - π¬π§United Kingdom alexpott πͺπΊπ
@nod_ has asked a question that needs answering on the MR.
- Status changed to RTBC
9 months ago 3:10pm 24 March 2024 - πΊπΈUnited States smustgrave
Tried the suggestion but the caused the tests to fail https://git.drupalcode.org/issue/drupal-2966656/-/jobs/1143627
So reverted back.
- Status changed to Needs work
9 months ago 8:57am 25 March 2024 - π¬π§United Kingdom alexpott πͺπΊπ
Let's add the comment @nod_ is suggesting
- Status changed to RTBC
9 months ago 1:53pm 25 March 2024 - Status changed to Fixed
9 months ago 4:10pm 25 March 2024 - πΊπΈUnited States DamienMcKenna NH, USA
For anyone reading the comments via email, the change was also merged to the 10.3.x branch.
Automatically closed - issue fixed for 2 weeks with no activity.