i am using react-player for playing videos. Not sure if there are any better options, but this seems to do the job. The only issue i have is, that i need to get thumbnails for the videos. Any idea how i would go around it ?
If you know about some better option for playing videos in React web app with supported thumbnails, that would be also great.
<ReactPlayer
className="videoFrame"
url={url}
playing
controls
/>
Thanks
Edit: I ended up using the video itself as thumbnail and blocking all mouse events over it. Then use parent div as button. In case of youtube i replace the video with thumbnail provided by youtube ( https://img.youtube.com ), because of the big play button over video. Most of other players dont have it.
ReactPlayer. A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion.
react-hls-player uses hls. js under the hood. You can get the HLS player instance by using ref.
To play video in React, you need to use the HTML video element, specify a source of the video and its type. Along with these required attributes, you can provide additional properties to customize the video player.
Use the light
prop to supply an image URL to the player.
<ReactPlayer
className="videoFrame"
url={url}
light="http://placekitten.com/200/300"
playing
controls
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With