F
F
Fixxxer2011-11-22 15:30:51
iPhone
Fixxxer, 2011-11-22 15:30:51

Play sound in Safari on iPad

In a web application, there is a need to play a sound when some event occurs. HTML5 audio is used for this purpose. If everything works OK in desktop Safari, then there is no sound on Ipad and Iphone. The official documentation says: if the user does not initiate the event himself, the audio file is not loaded - cellular networks, high traffic, that's all. And everything seems to be logical, but why not lose if the application has already downloaded the file. Tried to save in appcache, encode the file in base64 - does not solve the problem. Maybe someone who has experienced this, I will be glad if there is a solution.

UPD: My conclusion is this: this problem cannot be completely bypassed in iOS > 3.2. I hung up sound.load () on the touchstart event - after the first touch, the sound appears. Even so.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Shishkin, 2011-11-22
@lsoul

Sorry for offtopic, but it's terrible when a site allows itself to make sounds without your direct permission.

T
TerrorDroid, 2011-11-22
@TerrorDroid

If I’m not mistaken, there used to be a hack using javascript that allowed you to implement what you need, it was closed in iOS 4.X, I haven’t seen newer solutions - most likely you won’t be able to get around the problem in a normal way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question