Skip to content

Commit

Permalink
Cherry-pick 9ebaa6b. rdar://118902468
Browse files Browse the repository at this point in the history
    [Media] Don't try to loop if current time or duration is zero
    https://bugs.webkit.org/show_bug.cgi?id=265485
    rdar://118902468

    Reviewed by Jer Noble.

    Don't loop if current time or duration is zero.

    * Source/WebCore/html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):

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

Identifier: 267815.622@safari-7617-branch
  • Loading branch information
MyahCobbs committed Dec 7, 2023
1 parent 34dfc8d commit 043ef42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5419,7 +5419,7 @@ void HTMLMediaElement::mediaPlayerTimeChanged()
m_sentEndEvent = false;
// then seek to the earliest possible position of the media resource and abort these steps when the direction of
// playback is forwards,
if (now >= dur) {
if (now >= dur && (now + dur) > MediaTime::zeroTime()) {
ALWAYS_LOG(LOGIDENTIFIER, "current time (", now, ") is greater then duration (", dur, "), looping");
seekInternal(MediaTime::zeroTime());
}
Expand Down

0 comments on commit 043ef42

Please sign in to comment.