iOS background audio using HTML5 audio tag

2,281 views
Skip to first unread message

Danny Bisby

unread,
Aug 5, 2012, 7:31:19 AM8/5/12
to phon...@googlegroups.com
Is it possible to allow for background audio when the home button is pressed to continue to play using the html5 audio tag?

Thanks,
Danny

Danny Bisby

unread,
Aug 5, 2012, 3:11:53 PM8/5/12
to phon...@googlegroups.com
I've come up with a work around to use <audio> tag. use the media api to play a .10 second blank mp3 to initialise the media player, set the background modes to audio and it will successfully run the <audio> tags in the background :D

Sandeep Singh

unread,
Aug 5, 2012, 5:01:16 PM8/5/12
to phon...@googlegroups.com
http://docs.phonegap.com/en/2.0.0/cordova_media_media.md.html#media.play 

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
 
 

Devgeeks

unread,
Aug 5, 2012, 9:09:52 PM8/5/12
to phon...@googlegroups.com
html5 works awesome in the background on iOS. 


I haven't updated the PhoneGap version, but the example doesn't even use any PhoneGap APIs.

Devgeeks

unread,
Oct 9, 2012, 11:57:54 PM10/9/12
to phon...@googlegroups.com
The .10 second blank mp3 is a clever hack...

You could also just set the AV Session Category to the correct one...

Reply all
Reply to author
Forward
0 new messages