oembed icon indicating copy to clipboard operation
oembed copied to clipboard

possible to display Youtube thumbnail before user gives cookie consent?

Open arentsen opened this issue 1 year ago • 2 comments

Is it possible to display a youtube thumbnail using this plugin? I have a cookie banner which blocks the youtube video until the user gives consent for marketing cookies. I would like to display the Youtube thumbnail however so the layout of the page is not broken. Any tips would be appreciated.

arentsen avatar Jun 13 '24 22:06 arentsen

@arentsen you should be about to use .image no?

reganlawton avatar Jun 13 '24 23:06 reganlawton

That variable did not give me anything. I did find a work around for YouTube. I used:

{% set thumbnail = "https://i.ytimg.com/vi/" ~ youtube_id ~ "/maxresdefault.jpg" %}
<img src="{{ thumbnaill }}">

Then I dumped the media variable {{ dump(entry.field.media.data) }} and found out that I could use the key thumbnail_url which did work.

arentsen avatar Jun 14 '24 22:06 arentsen