-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(mux-video,mux-audio): reload core on DOM connect #765
fix(mux-video,mux-audio): reload core on DOM connect #765
Conversation
…ently unload core when disconnected.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #765 +/- ##
==========================================
+ Coverage 82.12% 82.18% +0.05%
==========================================
Files 40 40
Lines 7848 7862 +14
Branches 458 456 -2
==========================================
+ Hits 6445 6461 +16
+ Misses 1397 1395 -2
Partials 6 6
|
Unrelated to code, the title needs a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Obviously not ideal but does the job and hopefully in the general case people aren't constantly disconnecting and re-connecting their components.
Yeah that's derived from my branch name, not my intended squash commit msg. That said, since we've moved to squash merges instead of rebase merges, I've def unintentionally merged with the wrong commit msg before. |
Currently, we do an "unload"/teardown of core (and everything that happens in it/is created by it "under the hood") whenever our custom media elements are disconnected from the DOM. Ideally, this would not be the way we handle cleanups, as we're currently treating disconnect as a "
destroy()
" method. This causes issues with more advanced UIs/use cases, especially common in app frameworks where an element may be moved around the DOM for UI/UX purposes without the intention of destroying it. Unfortunately, it looks like we have some dangling references that result in a fairly large memory footprint per media element if we don't do this teardown. As a "middle ground" solution until we can identify a reasonable and reliable resolution of this larger memory management GC issue, we will simply (conditionally) "reload"/re-initialize core when the media element is (re)connected to the DOM.