You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: iOS Safari WebKit frequently runs out of memory and force-reloads the page when using Video.js #425
When watching videos on iOS Safari with the new Video.js player enabled, WebKit memory frequently spikes/exhausts and iOS terminates the tab process, causing Safari to force-reload the page repeatedly during playback or after switching between a few videos.
I don't have a macOS environment to profile the iOS WebKit memory timeline via Safari Web Inspector locally, so I checked the dev branch frontend code and spotted a few possible causes that I wanted to share in case you can take a look.
Steps to reproduce
Switch to or enable the Video.js player engine on iOS Safari (iPhone).
Play a video (HLS / DASH / SABR) for several minutes, or switch between multiple videos continuously.
Observe Safari suddenly crashing/reloading the page ("A problem repeatedly occurred" / WebKit Jetsam memory limit).
Area
Frontend (web app)
Channel
beta
Anything else?
Possible Causes Spotted in dev
Unbounded HLS buffer in apps/web/src/components/videojs-media.tsx:
<HlsJsVideo> currently only passes engine: { hlsJs: { startPosition: live ? -1 : startRef.current / 1000 } } inside hlsSource.
It does not appear to wire up the buffer limits from hls-buffer-config.ts (backBufferLength, maxBufferLength, maxMaxBufferLength, maxBufferSize). Under iOS Safari (ManagedMediaSource / MSE), unbounded hls.js backward buffers can quickly hit WebKit's strict per-tab memory cap.
Inline source object & missing buffer pruning on <DashVideo> (apps/web/src/components/videojs-media.tsx):
<DashVideo ref={mediaRef} {...mediaProps} source={{ src: source.src }}> creates a new source object literal on every re-render, and doesn't pass dashjs buffer pruning settings (bufferToKeep, bufferPruningInterval, bufferTimeAtTopQuality, etc.), which may cause unnecessary reloads or SourceBuffer retention.
Default preload: "auto", teardown, and GPU layer overhead (apps/web/src/components/videojs-video-player.tsx):
mediaProps sets preload: "auto" unconditionally.
Ensuring explicit engine destruction plus video.pause(); video.removeAttribute("src"); video.load() on unmount/source switch helps iOS Safari release hardware decoder frames and MediaSource buffers faster.
Additionally, @videojs/react/video/skin.css uses backdrop-filter overlays on top of the hardware-decoded video layer, which allocates extra high-resolution IOSurface GPU memory in iOS WebKit.
Activity