PeerTube icon indicating copy to clipboard operation
PeerTube copied to clipboard

Endpoint to get the video thumbnail

Open bohwaz opened this issue 1 year ago • 1 comments

Describe the problem to be solved

We want to be able to replace embed code for PeerTube videos with a static image + link to video, like we do with YouTube. This is done at server level.

This is because loading iframes, and external javascript and other ressources is slow.

It's currently not possible to get the video thumbnail without doing an API request.

Describe the solution you would like

There used to be a endpoint https://domain.tld/static/previews/:videoUUID as described here: https://framacolibri.org/t/thumbnail-of-video/8630

A good idea would be to re-instate it, and make it do a HTTP redirect, or serve directly, the video thumbnail image at a 720p size.

This is similar to what YouTube is doing:

https://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg

Etc.

bohwaz avatar Dec 30 '23 13:12 bohwaz

It would be great also if we can fetch the thumbnail image with the short UUID and not just the the long UUID. The short UUID is so easy to find right in the video page URL. The video embeds can use the short UUID or long UUID. Having an easy way to pull the thumbnail image would be great, such as linking to peertubeinstance.com/lazy-static/previews/jH42P9xTk8BHHwX73DS5bV.jpg (domain/path/shortUUID.jpg). It's a little harder to find the video long UUID in order to use it in a link. It might be neat to have an option on the video page when you click Share, next to URL, QR-Code, Embed, have 'Image Link'. Or when you click URL, have the option under more customization 'Image Link' or 'Thumbnail Link'. That would make it easier to share the video in something like an email.

Mike35538 avatar Dec 31 '23 04:12 Mike35538