Commit Graph

8 Commits

Author SHA1 Message Date
Zaggy1024
459578c280 LibWeb: Implement the buffered attribute on SourceBuffer
This is used to detect what data is still needed to maintain or resume
playback based on the current playback position. This is the last piece
that was preventing YouTube MSE from working.
2026-04-01 02:54:22 -05:00
Zaggy1024
51c3f7c41e LibWeb: Implement appending and demuxing WebM MSE segments
The segments are parsed for the SourceBufferProcessor by the
WebMByteStreamParser. It parses the initialization segment to update
its internal set of tracks, then SourceBufferProcessor/SourceBuffer set
them up for playback. When a media segment is received, it also parses
as much of it as is available, returning all the coded frames found so
far. SourceBufferProcessor then tells TrackBufferDemuxer to remove any
overlapping frames and insert the new ones.

TrackBufferDemuxer implements the Demuxer interface in terms of the
coded frame store maintained by the SourceBufferProcessor. It returns
the frames in decode order when requested by a data provider. When a
is needed, it finds the keyframe prior to the target timestamp, and
checks that there are no gaps in data up to the target timestamp. If
there are any gaps, it blocks until the gaps are gone.
2026-04-01 02:54:22 -05:00
Zaggy1024
e627376368 LibWeb: Implement some of SourceBuffer.appendBuffer()
Currently, it just fires the error event immediately.
2026-04-01 02:54:22 -05:00
Zaggy1024
e3b37694f5 LibWeb: Implement MediaSource.addSourceBuffer() and sourceBuffers
This gets us a bit further in MediaSource initialization, and gives
SourceBufferList some actual storage.
2026-04-01 02:54:22 -05:00
Zaggy1024
d960c1eaf5 LibWeb: Implement assignment of MediaSource to HTMLMediaElement src
Also, support the srcObject attribute, and fire the sourceopen event
at the MediaSource.
2026-04-01 02:54:22 -05:00
Zaggy1024
a54a86c024 Meta: Treat MediaSource as a platform object
This allows URL.createObjectURL(new MediaSource()) to succeed.
2026-04-01 02:54:22 -05:00
Zaggy1024
4dba9f0a0d LibWeb: Report support for WebM (VP9/Opus) in MediaSource 2026-04-01 02:54:22 -05:00
Zaggy1024
59bc23f309 Tests: Add a test to demonstrate MSE progress 2026-04-01 02:54:22 -05:00