Open matkokvesic opened 1 month ago
destroy
calls removeAllListeners
after detachMedia
because internal components listen for DESTROYING to clean up. The TypeError
above is caused by calling removeAllListeners
before destroy
externally.
Do not call removeAllListeners
before destroy
.
This issue can be categorized as a bug if you change the title to “removeAllListeners
prevents destroy
from functioning properly”. It is categorized as “works as expected” because destroy
always calls detachMedia
.
It’s a good catch and something worth looking into improving. I don't believe we have a documented method for removing only external listeners. That is not a supporter feature.
Thanks! Title changed to identify a bug in this issue.
What version of Hls.js are you using?
1.5.15
What browser (including version) are you using?
128.0.6613.138 (Official Build) (arm64)
What OS (including version) are you using?
macOS 15
Test stream
https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8
Configuration
Additional player setup steps
Calling hls.destroy() doesn't detach previously attached html video element.
In case where same
Checklist
Steps to reproduce
Example code to reproduce issue:
HTML:
JS:
Expected behaviour
No errors
What actually happened?
Errors in console produced by "hanging" destroyed hls.js instance.
Console output
Chrome media internals output
No response