Closed Glodenox closed 2 years ago
It is possible to load and autostart the YouTube video, as detailed here. This requires using the iframe JavaScript API, so make sure to load this only once this option gets activated in the settings.
I've split off the autoplay feature from this issue to #33, allowing this issue to be closed.
Try to obtain the maximum resolution image, but be ready to fall back to the high quality resolution picture or medium quality resolution picture if one is unavailable (generally only the case for older videos).
YouTube responds with an HTTP 404 if an image is not found, but it does provide a replacement image. It is best to check whether this actually triggers an
error
event. If not: it is possible to check thenaturalWidth
of the image after loading to check whether thesrc
needs to be adjusted.It would also be nice to investigate whether it is plausible to show the first x frames of the video or even have the video start automatically. All optional, of course.