Closed pffdota04 closed 2 years ago
I found a solution:
<Player
src={[...]}
>
{(ref, props) => {
const url = props.src;
if (url.substr(url.length - 4) === "m3u8")
return <ReactHlsPlayer playerRef={ref} {...props} />;
else return <video ref={ref} {...props} autoPlay loop />;
}}
</Player>
Now everything seems to be working in the right. Thank you!
If I just use one url extension (either mp4 or m3u8) for all it doesn't matter. (I use ReactHlsPlayer with m3u8 as your example code). Here is the example data:
How to use both mp4 and m3u8 in one Player? Is it possible? I expect something like this: