Skip to content

Commit 84eb232

Browse files
committed
playing event isn't fired as early as it should
https://bugs.webkit.org/show_bug.cgi?id=254256 rdar://107041118 Reviewed by Youenn Fablet. Notify the HTMLMediaElement that the media time has changed on the first change, bypassing the optimisation introduced by webkit.org/b/225396 Code will be exercised by media/media-source/media-source-end-of-stream-buffered.html once the MockMediaPlayerMediaSource will be running in the GPU process (webkit.org/b/225367) * Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::currentTimeChanged): Canonical link: https://commits.webkit.org/261959@main
1 parent 1bce9ee commit 84eb232

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ void MediaPlayerPrivateRemote::sizeChanged(WebCore::FloatSize naturalSize)
415415

416416
void MediaPlayerPrivateRemote::currentTimeChanged(const MediaTime& mediaTime, const MonotonicTime& queryTime, bool timeIsProgressing)
417417
{
418+
auto oldCachedTime = m_cachedMediaTime;
418419
auto reverseJump = mediaTime < m_cachedMediaTime;
419420
if (reverseJump)
420421
ALWAYS_LOG(LOGIDENTIFIER, "time jumped backwards, was ", m_cachedMediaTime, ", is now ", mediaTime);
@@ -423,7 +424,7 @@ void MediaPlayerPrivateRemote::currentTimeChanged(const MediaTime& mediaTime, co
423424
m_cachedMediaTime = mediaTime;
424425
m_cachedMediaTimeQueryTime = queryTime;
425426

426-
if (reverseJump) {
427+
if (reverseJump || (!oldCachedTime && !!mediaTime)) {
427428
if (RefPtr player = m_player.get())
428429
player->timeChanged();
429430
}

0 commit comments

Comments
 (0)