[Webkit-unassigned] [Bug 287430] New: Playing video in Safari can generate non-monotonic 'timeupdate' events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 10 13:22:01 PST 2025


https://bugs.webkit.org/show_bug.cgi?id=287430

            Bug ID: 287430
           Summary: Playing video in Safari can generate non-monotonic
                    'timeupdate' events
           Product: WebKit
           Version: Safari 18
          Hardware: Mac (Apple Silicon)
                OS: macOS 15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Media
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: rob.smith at awayteam.co.uk

Created attachment 474184

  --> https://bugs.webkit.org/attachment.cgi?id=474184&action=review

Event log showing that 'timeupdate' event times do not increase monotonically

# Description

Playing video in Safari can generate non-monotonic 'timeupdate' events

# Steps to reproduce

1. Load the video in the web page attached to see the event log.
2. Press the Safari play control to play the video to the end (only 5 secs long).
3. Note that 'timeupdate' event times increase monotonically in the event log.
4. Repeat step 2.
5. Note that 'timeupdate' event times do not increase monotonically in the event log - see example screenshot.

# Expected result

Event times of 'timeupdate' events should always increase monotonically when the video is played.

The expected result is observed when the test is performed using either Firefox 128.5.2esr(64-bit) or Chrome 131.0.6778.140.

# Actual result

Event times of 'timeupdate' events do not always increase monotonically when the video is played in Safari 18.2(20620.1.16.11.8).

# Further details

The steps 1-5 above are the simplest way to reproduce the error - press play, wait and press play again - because there are only two user actions required. However, I've traced the cause to the seek operation in Safari. There is an implicit seek from the end of the first play operation back to the start of the second play operation.

There are many other ways to reproduce the same error. Any sequence of actions which cause a seek operation produce a similar result. For instance:
 a. Play, pause, seek to start (time 0) and then play.
 b. Play, wait for the first few 'timeupdate' events and then seek to start so play restarts automatically.
 c. Play, pause, seek forwards or backwards and then resume play.
 d. Play, seek forwards or backwards so play resumes automatically at the new time.

The seek operation in the steps a-d above can be triggered either by clicking on Safari's video timeline bar, or by clicking Safari's skip 15 second buttons, or by using the custom buttons in the attached web page to set the HTMLMediaElement.currentTime directly in Javascript. This behaviour is not unique to the example video file provided.

Repeating these tests in Firefox or Chrome also produces the expected results above.

This error is not observed in Safari if the seek operation is omitted. For instance:
 i. Load the page and play the video.
 ii. Wait for the first few 'timeupdate' events and then pause before the end of the video.
 iii. Resume the video without seeking.
 iv. Note that 'timeupdate' event times always increase monotonically as expected - in contrast to test c above.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20250210/72c6ba0b/attachment.htm>


More information about the webkit-unassigned mailing list