mhasbini/yt-embed

Support different image formats

Opened this issue · 4 comments

I have made a video in a portrait format and would like to display the thumbnail in the same format. Something like an URL parameter for cropping the preview image would be a great addition!

@LinqLover Can you please post an easy to replicate scenario? i.e. sample video, actual & expected output.

Sorry, probably "format" was the wrong terminus. I was referring to the aspect ratio of images. Take an arbitrary portrait mode from YouTube and the thumbnail will still have a landscape ratio - it would be nice if you could use a URL like https://yt-embed.herokuapp.com/embed?v=3BYNj6Yvl8I&w=1080&h=1920, or just &res=portrait, or something similar. Just an idea :)

I added a change in 3510663 so that you'll be able to specify which image format you need:

https://yt-embed.herokuapp.com/embed?v=DrI2lUXL1no&img=0

List of formats: https://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api

Please let me know if this solve you issue.

Thank you, so there is no possibility to retrieve a portrait-mode thumbnail?