- Issue created by @eduardo morales alberti
- Merge request !22Resolve #3413985 "Get playlist thumbnail" β (Open) created by eduardo morales alberti
- last update
11 months ago 48 pass - last update
11 months ago 48 pass - Status changed to Needs review
11 months ago 10:35am 11 January 2024 - πΊπΈUnited States luke.leber Pennsylvania
Added a related issue. This one is really tricky.
I really feel that making blocking web requests on the server side in the formatter isn't the direction that should be taken, as it opens up the potential for denial of service security concerns.
Ideally this information would be captured when the oembed resource is created and then able to be referenced from the formatter. Obviously that's a much wider scope issue, but it's the only safe way I can see to accomplish this.
Thoughts?
- Status changed to Needs work
11 months ago 1:07pm 11 January 2024 - πΊπΈUnited States luke.leber Pennsylvania
I'd be happy to discuss this further. I have some ideas, but am sadly short on time due to #dayjob.
If you're on slack, feel free to hop into #oembed-lazyload and we can chat :-). I'm drafting up a quick and dirty of what I feel might be the most holistic approach to making thumbnails the most useful to the most users, hopefully finishing up within the next 12 mins or so.
- πΊπΈUnited States luke.leber Pennsylvania
I've pushed out a branch called
flexible-metadata-alter-architecture
that scaffolds in some API additions such that...- Users may opt into customizing oEmbed metadata altering (it won't be activated by default)
- If enabled, all
ProviderEnhancer
plugin types will get a chance to customize metadata through a new method:public function alterOembedMetadata(array &$data, $url)
For example, the YouTube provider enhancer can download thumbnails of various resolutions based on what's available on the remote end - Speaking of YouTube...the stock enhancer now ships with a setting that allows end-users to opt into downloading the "highest resolution thumbnail available"
Work yet to be done:
- Continue adding test coverage -- there are now significant gaps.
- Figure out how to plumb this into the front-end while retaining API backwards-compatibility
- πΊπΈUnited States luke.leber Pennsylvania
I've just pushed a minimal viable product for the front-end bits. It's still not 100% useful, as the front-end still coerces everything to use a 16:9 aspect ratio.
Additional formatter settings are still required to make this a 100% turn-key solution. Luckily though, I think we can do all of this while still retaining backwards compatibility. It looks like we'll need a conditional container sizing mechanism that lets users choose between rendering things with...
- An aspect ratio (has to be the default option, for b/c purposes
- A maximum width / height (the options are already in the formatter settings, but are presently ignored!)
I'll take a peek at how the off-the-shelf oembed formatter does the CSS bits for the max width/height rendering strategy, but as the branch now stands, an end-to-end test should be possible after sprinkling some custom CSS on things.
- Merge request !24Add a flexible metadata alter architecture with new rendering capabilities β (Merged) created by luke.leber
- πΊπΈUnited States luke.leber Pennsylvania
I'm satisfied with the functional pieces and test coverage here. The only remaining task is an upgrade path + upgrade path testing.
-
Luke.Leber β
committed a9abbb35 on 2.1.x
Issue #3413985: Provide an extensible mechanism for thumbnail...
-
Luke.Leber β
committed a9abbb35 on 2.1.x
- Status changed to Fixed
10 months ago 7:31pm 16 February 2024 - πΊπΈUnited States luke.leber Pennsylvania
Committed and pushed to 2.1.x! Thanks for everything, Eduardo.
I'll be cutting a 2.1.0 feature release in the near future. Take care.
Automatically closed - issue fixed for 2 weeks with no activity.