Repository navigation
fix: stop the Video.js memory growth on iOS Safari - #135
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes TypeType-Video/TypeType#425.
I measured WebKit memory on an iOS 26.5 simulator (iPhone 12 mini) while a Twitch VOD played in Video.js: the WebContent process grew by about 70 MB a minute (149 MB to 390 MB in 3.5 minutes), until iOS would reload the tab.
The cause is not the media buffer: the video kept about 50 s buffered, and hls.js alone on a blank page grew far less. Video.js rewrites the time slider on every frame (about 58 style updates a second), and the idle controls stayed in the layout with only opacity 0. Hiding the controls with
display: nonestops the growth;visibility: hiddendoes not.transition-behavior: allow-discrete), and fade back in when shown. With this, memory stayed flat at about 150 MB over 4 minutes on the same simulator.The memory grows again while the controls are shown, so a long time with the controls on screen still costs memory; normal watching keeps them hidden.