tkloht/react-video-cover

Possible to use multiple sources?

davidrhoderick opened this issue · 2 comments

The HTML <video> tag allows for using multiple child <source> tags so that you can provide various formats of videos so that the video renders best on the browser being used (not just MP4 but also ogg/ogv and WebM). Is there a way to use these multiple sources?

yes, it is possible.
the videoOptions are passed as props to the video tag, so you can do something like this:

<VideoCover videoOptions = {{
      children: [
        <source src={'/cat.mp4')} />,
        <source src={'/cat.ogv')} />,
        <source src={'/cat.webm')} />
      ]
}} />

Thanks that worked great @tkloht