devcshort / react-hls

Simple React component for playing hls/rtmp live streams.
https://www.npmjs.com/package/react-hls-player
MIT License
118 stars 48 forks source link

Define thumbnail for video #21

Open ChrisMcHarvey opened 3 years ago

ChrisMcHarvey commented 3 years ago

Have you thought about adding functionality for defining the thumbnail for a video file? Mine show a black viewer right now.

devcshort commented 3 years ago

This is a great suggestion, I'll have to look in to it :)

ChrisMcHarvey commented 3 years ago

Thanks!

devcshort commented 3 years ago

Hey @ChrisMcHarvey I looked in to this. This functionality actually should be available through this package already. Since the underlying component is just a regular video component, you can pass in any normal video element property that you'd normally have access to. This includes the ability to add a poster, which would just be a url to the image you want displayed as the thumbnail.

You can checkout this Tutorial that shows how to use the poser property.

Let me know if this is what you were needing, thanks!