[webkit-changes] [WebKit/WebKit] f1c119: Instagram video doesn't replay

Jean-Yves Avenard noreply at github.com
Sat Jan 25 20:05:45 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f1c1197adbc419004979c177898bed371a018c56
      https://github.com/WebKit/WebKit/commit/f1c1197adbc419004979c177898bed371a018c56
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2025-01-25 (Sat, 25 Jan 2025)

  Changed paths:
    A LayoutTests/media/media-source/media-source-reopen-expected.txt
    A LayoutTests/media/media-source/media-source-reopen.html
    M Source/WebCore/Modules/mediasource/MediaSource.cpp

  Log Message:
  -----------
  Instagram video doesn't replay
https://bugs.webkit.org/show_bug.cgi?id=286475
rdar://141590278

Reviewed by Eric Carlson.

The video's buffered ranges weren't recalculated when the MediaSource was
re-opened (its readyState moved from "ended" to "open"). The calculation
of the buffered ranges depends on the MediaSource's readyState.

Whenever the video's buffered attribute change, a message is sent to the GPU
process with the new final value.
In parallel, the GPU's MediaSourcePrivate will recalculate the playable buffered
ranges whenever new data were added.

Instagram when playing a MSE video, append all the data then calls MediaSource.endOfStream()
to then totally unnecessarily re-append once again all the data followed by endOfStream()
several times.
As the video's buffered attribute wasn't updated with the appendBuffer that followed
(which reopened the MediaSource) the GPU process buffered range mirror was
now incorrectly assuming the MediaSource wasn't ended and kept waiting
for more data to come, never reaching the player's ended state.

We now correctly recalculate the buffered ranges whenever the MediaSource is closed
or re-opened.

Added test that ensures:
1- the buffered range gets updated when the MediaSource move back to "open" state
2- we will fire the ended event when playback reaches the end.

* LayoutTests/media/media-source/media-source-reopen-expected.txt: Added.
* LayoutTests/media/media-source/media-source-reopen.html: Added.
* Source/WebCore/Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::onReadyStateChange):

Canonical link: https://commits.webkit.org/289401@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list