8000 fix(html5_video): avoid memory leak in getDuration call by bikegriffith · Pull Request #71 · clappr/clappr-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(html5_video): avoid memory leak in getDuration call #71

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

Merged
merged 3 commits into from
Oct 8, 2021

Conversation

bikegriffith
Copy link
Contributor

Summary

Fixes clappr/clappr#2035 by more carefully managing the call to _updateSettings when el.seekable fails for a live broadcast. This can happen in iOS Safari (specifically for live broadcast with no sliding dvr window) and results in a memory leak and crash within a few seconds-minutes.

Changes

  • Fixes getDuration function

How to test

Test in iOS Safari for a live broadcast. I was able to verify locally very easily.

A picture/video tells a thousand words

Before this PR

Original memory profile showed leak:

image

After this PR

New memory profile looks clean!

image

@leandromoreira
Copy link
Member

thanks @bikegriffith thoughts @jhonatangomes @towerz @joaopaulovieira ?

@towerz
Copy link
Member
towerz commented Oct 8, 2021

LGTM

Copy link
Member
@towerz towerz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jhonatangomes Everything looks good. I think you can just run some checks to see if there's any side effect or any dependency that could be affected by this before merging.

@bikegriffith
Copy link
Contributor Author

Thanks for the quick review! I've done quite a bit of testing on my own in various scenarios and I can't see any side effects. Would love to see this in an official release as soon as reasonably possible (because the new multi-repo setup for Clappr makes it a little tricky to get this fix into a build downstream from my fork, and it's happening to quite a lot of iOS users)

@jhonatangcavalcanti jhonatangcavalcanti merged commit 9a74fab into clappr:master Oct 8, 2021
@jhonatangcavalcanti
Copy link
Member

Thanks, @bikegriffith!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak on iOS Mobile Safari causes crash / page reload with HLS (only when no DVR window)
4 participants
0