How to set the thumbnail image on an HTML5 video?

Spread the love

Sometimes, we want to set the thumbnail image on an HTML5 video.

In this article, we’ll look at how to set the thumbnail image on an HTML5 video.

How to set the thumbnail image on an HTML5 video?

To set the thumbnail image on an HTML5 video, we set the poster attribute.

For instance, we write

<video width="470" height="255" poster="placeholder.png" controls>
  <source src="video.mp4" type="video/mp4" />
</video>

to set the poster attribute to the URL of the thumbnail image.

Conclusion

To set the thumbnail image on an HTML5 video, we set the poster attribute.

Leave a Reply

Your email address will not be published.