Bug 266332

Summary: Safari cache issue when using MSE
Product: WebKit Reporter: jeroen.veltmans
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: eric.carlson, jean-yves.avenard, jer.noble, mattias.buelens, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Unspecified   
OS: macOS 14   

Description jeroen.veltmans 2023-12-13 02:27:37 PST
Steps to reproduce:
1) Open Safari and go to a page that uses Media Source Extensions to play a video. I've made a minimal repro page here: https://replit.com/@Jeroen-Veltmans/Safari-cache-mse-issue
2) Play the video like normal
3) Press the browser's 'previous page' button
4) Press the browser's 'next page' button
5) Notice how the player stalls

What is the expected behavior?
The player should play the video like normal.

What is the actual behavior?
The player stalls indefinitely.
Checking the mediaSource, all sourceBuffers have been detached. The previous sourceBuffers still exist, but have an 'InvalidStateError: The object is in an invalid state' message for buffered.

Extra notes:
When opening the debugger and disabling cache, everything works like it should.
Comment 1 Radar WebKit Bug Importer 2023-12-13 20:29:30 PST
<rdar://problem/119645471>