Changing the URL Not Clears Older Media New and Old Media Plays at the Same Time on React 19
Current Behavior React Player is not switching audio; instead, it starts a new audio instance and also plays old audio at the same time. It happens %80 of the time sometimes it works as intended.
Expected Behavior Audio should switch every time I switch the url variable.
Steps to Reproduce
- It was working before I just updated to react 19 It was working perfectly before.
- Downgrading solves the issue.
Environment URL attempting to play: Internal URL addresses contain a wav file. Browser: Google Chrome 131.0.6778.205 Operating system: OSX 15.1.1
Experiencing this as well. Makes loading direct links to files and local files practically unusable.
Experiencing this as well. Are you both using Next.JS?
I am using vanilla React
Is this still an issue in v3? Could you provide a Codesandbox or similar, thanks!
`js
const closeModal = () => {
setURlToPlayer(undefined);
setPlaying(false);
setPlayerKey(`${props.camera?.name}_stop`);
props.closeModal();
}
`
<MediaPlayerComp key={playerKey} muted={muted} type={type} playing={playing} style={{ width: "40em" }} ref={setPlayerRef} label={labelPlayerText} source={urlToPlayer} />
An example of my use of the component in a React application (Vite), when closing a modal window I want to stop the HLS, but the sound continues and the player plays the video, even if the player is visually destroyed, how exactly to stop the broadcast?
@SupershadowTH just pause and remove the src before closing the modal.