Bug 233257 - Safari intermittently stopping playing Spotify Web Player (currentTime goes backwards)
Summary: Safari intermittently stopping playing Spotify Web Player (currentTime goes b...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL: https://open.spotify.com/
Keywords: InRadar
: 234302 (view as bug list)
Depends on:
Reported: 2021-11-17 08:20 PST by Sam Sneddon [:gsnedders]
Modified: 2021-12-14 14:37 PST (History)
7 users (show)

See Also:

Patch (4.24 KB, patch)
2021-12-14 10:10 PST, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2021-11-17 08:20:46 PST
Every so often, it appears that HTMLVideoElement plays beyond the end of the duration (i.e., media.currentTime > media.duration), and there appears to be some case where the currentTime can move _backwards_ while playing in that state.

Specifically, looking at timeupdate events:

[Log] currentTime: 197.2047248660011, duration: 197.09333333333333, lastTimeUpdatePosition: 196.95360709999474 (vendor~web-player.526a81f5.js, line 1)
[Log] currentTime: 197.09790954431364, duration: 197.09333333333333, lastTimeUpdatePosition: 197.20374170400382 (vendor~web-player.526a81f5.js, line 1)

(lastTimeUpdatePosition is from their own JS, but updated for each event, currentTime and duration are from the HTMLVideoElement)

Ultimately, this causes their JS to throw an exception (because, except when seeking or changing track, they assume currentTime will always progress forwards), causing playback to stop.
Comment 1 Radar WebKit Bug Importer 2021-11-17 08:21:02 PST
Comment 2 Jer Noble 2021-11-17 08:44:27 PST
Likely a bug in our currentTime heuristic, where we allow currentTime > duration.
Comment 3 Jer Noble 2021-12-14 10:09:32 PST
*** Bug 234302 has been marked as a duplicate of this bug. ***
Comment 4 Jer Noble 2021-12-14 10:10:59 PST
Created attachment 447140 [details]
Comment 5 EWS 2021-12-14 14:37:30 PST
Committed r287050 (245247@main): <https://commits.webkit.org/245247@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447140 [details].