Why can't Safari play HTML5 audio over https?

I am trying to play voice in safari using HTML5 Audio. But this does not work on https, http is excellent.

var audio = new Audio(); audio.src = "https://example.com/xxxx.wav"; audio.play(); 

Can't play audio via https ? If you are not using html5 audio, is there another alternative solution for playing voice over https under safari?

thanks

+6
source share
1 answer

As far as I know, this is a Webkit bug and thus also occurs on iPhone and Android mobile phones. We serve all the audio on top of the standard cross-domain site via http, and they work fine even when the DOM itself is retrieved via https.

It can work in some versions of Safari over https if you download audio from the same host as the DOM. See here: http://areweplayingyet.org/

+1
source

Source: https://habr.com/ru/post/899779/


All Articles