Play sound in iPhone web app using Javascript?

I am currently creating a web application for the iPhone for piano chords, and I wanted to add a parameter that allows the user to press the play button and play the selected chord. However, I am not sure how to do this, or if it is possible.

Basically, is there a way to programmatically (through Javascript) play a sound file (wav, mp3, ...) in the background? (i.e. without leaving the page)

Thanks for any help!

(Keep in mind that I am developing a web application, so I use HTML, CSS and JS, not the native SDK)

+4
source share
4 answers
+2

: no

from :

Safari iPhone - .

+4

With HTML5 audio, iPhone can play without full-screen mode.

+2
source

IOS requires the sound to be played by pressing a control button. If you want to automatically play the sound in any event on the HTML page, forget about it.

0
source

All Articles