Bug 255772

Summary: REGRESSION (Safari 15): HTMLVideoElement exposing wrong currentTime when calling play() and pause() back-to-back
Product: WebKit Reporter: Andreas Kogler <andreas.kogler>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: eric.carlson, jer.noble, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: All   
OS: All   
Attachments:
Description Flags
Testpage for reproduction none

Description Andreas Kogler 2023-04-21 02:41:44 PDT
Created attachment 466028 [details]
Testpage for reproduction

When calling `play()` and `pause()` in quick succession on an HTMLVideoElement after page load, the exposed `currentTime` jumps to a nonsensical value.

Looks like an internal timer gets exposed instead of the actual `currentTime`. 
Reproduction steps:

1. Open a web-page that has an HTMLVideoElement `muted` and with any `src` (HLS or progressive) loaded
3. Open the console
4. Wait for 10 seconds
3. Call `play()` and `pause()` on the video element
4. Observe that the `currentTime` is now close to 10 (instead of 0); Note: if you wait 20 seconds in step 4, the `currentTime` is going to be close to 20 etc.


Issue starts to occur on Safari 15 and still exists in Safari 16. Also tested and verified same behaviour with Orion browser(WebKit  615.1.16.1).

The attached test-page executes all steps for you. It waits for 10 seconds and then calls `play()` and `pause()` back-to-back, logging the `currentTime` every 200ms.
Comment 1 Radar WebKit Bug Importer 2023-04-23 14:28:42 PDT
<rdar://problem/108430206>