NEW332430
[GStreamer] Flush GStreamer pipeline when media element is detached from DOM
https://bugs.webkit.org/show_bug.cgi?id=332430
Summary [GStreamer] Flush GStreamer pipeline when media element is detached from DOM
Enrique Ocaña
Reported 2026-11-19 11:16:11 PST

Some webapps don't do proper cleanup and media elements may end up becoming detached from their HTML Document with their inner pipeline still in PAUSE. In the case of encrypted content being played in a system using Secure Video Memory, this means that valuable resources are being used. Having multiple videos like this leads to secure memory exhaustion and an eventual crash.

The current code in MediaPlayerPrivateGStreamer has a timer to release resources when the player has been on pause (after EOS) for more than 5 minutes, but that works for progressive playback only at the very end and is not recoverable.

We need something that releases video memory from the GStreamer pipeline but can still be able to resume playback afterwards. Flushing the pipeline without resuming streaming threads seems to be the easiest way. Playback can be resumed with an explicit seek or by re-attaching the media element back into the DOM. Other alternatives such as destroying the pipeline or putting it into READY have been tried without satisfactory results, so that's why they're not being proposed.

See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1740

Attachments
Enrique Ocaña
Comment 1 2026-11-19 11:50:52 PST
Note You need to log in before you can comment on or make changes to this bug.