Created attachment 331055 [details]
In Safari 11 on both macOS and iOS, it often takes a long time until an audio (e.g. MP3) starts playing after starting it (especially on slower mobile connections).
Safari 11 buffers very much until it starts playing. In the demo I've attached, after you click the button, Safari buffers around 100 seconds of the audio before it starts playing, which seems way too much for me (also notice that the "playing" event is triggered and the loudspeaker icon shown in the URL bar and tab before it is really playing, i.e. it is audible and currentTime is increasing). (The effect is more obvious if you use Network Link Conditioner and throttle your connection to average 3G.)
In other browsers, the audio also starts way earlier, see this video comparing with Chrome and Firefox: http://www.yourfilelink.com/get.php?fid=1464049
This regression seems to have been introduced with Safari 10 on macOS and iOS 10; on iOS 9, audios start playing almost immediately. Here is an image comparing iOS 9 and iOS 10: http://i66.tinypic.com/25ppeoi.png
Created attachment 339764 [details]
Safari (left) and Chrome (right) playing a demo from the popular SoundManager audio library
Came here to file the same bug. As the reporter notes, Safari fires the `play` and `playing` events and then seems to download a large amount of data before it decides to fire `canplaythrough` and actually start outputting sound.
With my cache cleared I loaded this 2.6mb mp3 http://freshly-ground.com/data/audio/sm2/Figub%20Brazlevič%20-%20Bosnian%20Syndicate.mp3 and sound wasn't played until 2.6mb had been downloaded. In comparison Chrome and Firefox start playing sound seemingly immediately.
Here's a video of where I first encountered the problem (I'm sorry this is an external link, but I don't have the original video file any more): https://twitter.com/dunstan/status/991570214541189120
I also saw the problem when using popular sound libraries, such as the SoundManager demo found here http://www.schillmania.com/projects/soundmanager2/demo/bar-ui/ Chrome started playing straight away, while Safari downloaded 2.2mb of the file before playing sound (see attached screenshots).
We are also experiencing delay "canplay" and "playing" events are fired, but actual playback only seems to start when Safari buffers the whole track, sometimes it can take 20+ seconds depending on connects. In Chrome and Firefox events are actually fired when playback starts, and playback starts much faster there as they don't wait till entire track will be downloaded.