Get the value of the "src" attribute I am having hard time with getting the value of YouTube video thumbnail URL, in order to use it as background image in a template file.
I created a video content type and added a remote video field (field_url_vid2). The output format is thumbnail.
{{content.field_url_vid2}} gives the full HTML markup, but I just want the value of the src attribute.
To get the YouTube video thumbnail URL in twig!
Try with:
{{ file_url(content.field_url_vid2.0['#media'].thumbnail.0.entity.uri.value) }}