html5 audio delay in Safari

Where: HTML5

What: Audio tag (player) in conjunction with Safari

Issue: Performance problem


Hi guys,


There is a noticeable audio delay when using Safari in conjuction with onclick audio events. Specifically: the audio does not sync with the onclick event. The user may click on the icon, link, li etc. and the event takes place but the audio associated with the event does not occur until 1 - 4 secs later. This makes for cumbersom and awkward user experience.


Example: https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_audio_autoplay2

notice the slight delay after clicking on enable autoplay

*no delay in other browsers such as firefox, chrome, etc


I am new to development as well as Safari and Apple. Is this normal? or is there some specific code adjustment needed for Safari. (works fine in all other browsers).


*Delay is much more pronouced depending on audio event such as games etc.

html5 audio delay in Safari
 
 
Q