RESOLVED DUPLICATE of bug 238170 238113
Audio element playback ends early when src is a blob URL
https://bugs.webkit.org/show_bug.cgi?id=238113
Summary Audio element playback ends early when src is a blob URL
Peter Fernandes
Reported 2022-03-19 11:23:17 PDT
When playing audio via an HTMLAudioElement instance and the src is a Blob URL, playback halts before the end of the track and the "ended" event is never fired on the audio element. Steps to Reproduce: Please see the jsfiddle link for a demo: https://jsfiddle.net/1yv7b82n/5/ 1. Fetch an mp3 or other audio file and read the response body as a Blob 2. Get an object URL from the blob then set that URL as the src of an audio element 3. Call play() on the audio element Expected: The audio plays all the way through, and the onended event is fired after playback completes. Actual: Playback never completes and onended is never fired. In the example provided in the jsfiddle above, I observed playback ceasing several seconds before the actual end of the audio. I also notice my phone heating up after audio ends so maybe there is runaway CPU/memory usage somewhere. Build Date & Hardware: Safari on iOS 15.4 stable. Does not occur on Safari 15.4 (17613.1.17.1.6) on MacOS.
Attachments
Network tab while blob is playing (627.64 KB, image/png)
2022-03-23 22:28 PDT, Pete Jungwirth
no flags
Radar WebKit Bug Importer
Comment 1 2022-03-21 22:23:56 PDT
Pete Jungwirth
Comment 2 2022-03-23 22:28:22 PDT
Created attachment 455608 [details] Network tab while blob is playing This shows the packets on the Safari network tab with a smaller mp3 than the one submitted in the fiddle with the original bug - the last chunk repeats endlessly.
Pete Jungwirth
Comment 3 2022-03-23 22:32:57 PDT
To clarify the attachment - this bug happens any time a Blob exceeds 65536 bytes. Examining the network tab while the file is playing, it looks like the last chunk in the file never causes the ended event to fire, and it fetches endlessly with 206 returns. If you take the fiddle that was provided in the original post and use a smaller mp3, it's easier to see.
Jer Noble
Comment 4 2022-03-24 10:21:23 PDT
Thanks for this report. From the attachment, this looks like a dup of bug# 238170, recently fixed. Please CC yourself to that bug to follow along. *** This bug has been marked as a duplicate of bug 238170 ***
Note You need to log in before you can comment on or make changes to this bug.