persistent m3u8 requests and detached DOM nodes after unmount
🔍 Observed Problem Phenomena
When using ReactPlayer with m3u8 streams, the following abnormal behaviors are observed in Chrome DevTools
📊 Network Panel Observations Continued requests after unmount: m3u8 requests persist after route changes or component unmounting
🧠 Memory Panel Observations Growing Detached DOM Nodes: Each component unmount leaves uncleaned nodes
🎯 Affected Scenarios Any scenario that causes ReactPlayer component unmounting
React Router route changes
Conditional rendering toggles ({show && <ReactPlayer />})
List item key changes
Component remounting
💭 Suspected Root Cause
- hls.js instance timers aren't cleared
- Nnetwork requests aren't aborted
- Event listeners aren't removed
Same issue
This behavior is inline with how the native video behaves, if you remove it from the DOM it will still keep playback intact.
Try setting the src to null before unmounting.