Page MenuHomePhabricator

Playing audio for the second time always stutters
Open, Needs TriagePublic


Wikimedia’s audio playback widget sometimes stutters. To reproduce, go to any audio page such as and press the play button on that page. Then, press the same button again; you’ll likely hear stuttering audio. Initially, I had assumed this was a browser bug and reported it to Chrome. However, the Chrome developers said it’s likely a bug in Wikipedia’s JavaScript. The JavaScript bug only shows when the file is served from cache (eg. on the second press of the play button), or possibly when the user is on a very fast network connection.


I think it's a player bug in the Wikipedia page [...] It seems like it's creating a new tag each time the play button is clicked which may be leading to some of a previous tag playing depending on if they're using WebAudio for playback.


I see in devtools they’re using and a redundant audioElement.currentTime = 0 in [apparently] setTimeout which produces the glitch so indeed it seems like the player is doing the wrong thing.

As you’ll see in that Chrome bug, Chrome 19 and older didn't stutter, but concludes:

Possibly we're queuing audio buffers more quickly now, so the seek occurred before we played out a buffer on older versions.