Commit ed841a8c authored by Michael Hitzler's avatar Michael Hitzler Committed by Nikita Hovratov
Browse files

[BUGFIX] Add sd and hq YouTube preview image resolutions

The YouTube helper tries to fetch from highest to
lowest image for possible previews.
The "sd" and "hq" versions were missing while checking
for an available image and got added.

Resolves: #98098
Releases: main, 11.5
Change-Id: Idec13fdc5c820e6674f8ccebd610455b50d57895
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75456


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
parent e2fa9411
......@@ -50,7 +50,7 @@ class YouTubeHelper extends AbstractOEmbedHelper
$temporaryFileName = $this->getTempFolderPath() . 'youtube_' . md5($videoId) . '.jpg';
if (!file_exists($temporaryFileName)) {
$tryNames = ['maxresdefault.jpg', 'mqdefault.jpg', '0.jpg'];
$tryNames = ['maxresdefault.jpg', 'sddefault.jpg', 'hqdefault.jpg', 'mqdefault.jpg', '0.jpg'];
foreach ($tryNames as $tryName) {
$previewImage = GeneralUtility::getUrl(
sprintf('https://img.youtube.com/vi/%s/%s', $videoId, $tryName)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment