I'm trying to figure it out why the video component is not staying constant on its every render. The first time the video component is loaded, it works fine, however, when I go on another component and then go back to the video component, the video doesnt load.
What could be the problem?
First pic working as expected:
Second pic not working:
let videoUrl = `http://xxx.xxx.xxx.xxx:8080/hls/${appState.profileUser.user.streamKey}.m3u8`;
useEffect(() => {
setIsVisible(true);
}, []);
return (
<>
<div className="video-side">
{isVisible ? (
<ReactPlayer
key={Math.random()}
url={videoUrl}
playing={true}
loop={true}
forcehls="true"
width="fit-content"
muted
controls={true}
height="464"
></ReactPlayer>
) : (
''
)}