spicywebau / craft-embedded-assets

Manage YouTube videos, Instagram photos and more as first class assets in Craft CMS
MIT License
171 stars 35 forks source link

Youtube Maxres Thumbnail #259

Closed DTesch-Reem closed 5 months ago

DTesch-Reem commented 5 months ago

Bug Description

For YouTube Assets the fetched image is always "hqdefault" How can I force to fetch the maxres-Image?

Steps to reproduce

  1. Fetch Youtube-Video
  2. image-Tag contains always the "hqdefault" Thumbnail

Expected behaviour

No response

Embedded Assets version

4.1.0

Craft CMS version

4.8.10

ttempleton commented 5 months ago

Not all YouTube videos have a maxresdefault image, so I'm comfortable with hqdefault being what we attach to embedded assets.

If you have an embedded asset for a YouTube video that does have a maxresdefault image, you could either manually make that change in the JSON file, or you could do something like the following in your templates:

{% set maxResImage = embeddedAsset.image|replace({
  hqdefault: 'maxresdefault',
}) %}