Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Paul Neumyer
15,301 PointsI can't get a webpage to play sound on either the iPhone or iPad.
Here are my file types that I am specifying with the <audio> tag:
<audio autoplay loop>
<source src="audio/willy_wonka_bg_music.mp3" type="audio/mp3">
<source src="audio/willy_wonka_bg_music.m4a" type="audio/aac">
<source src="audio/willy_wonka_bg_music.aac" type="audio/aac">
<source src="audio/willy_wonka_bg_music.wav" type="audio/wav">
<source src="audio/willy_wonka_bg_music.ogg" type="audio/ogg">
</audio>
Here is the link to the full website: http://thecrossagency.net/Em-J-Bat-Mitzvah/?fname=Marc&lname=Krigsman&fname2=Lisa&fname3=Jamie&fname4=and%20Em-J
Any help would greatly be appreciated.
3 Answers
Gábor Balogh
7,503 PointsHi! Try it without autoplay property. Most of mobiles are not support autoplay.
Paul Neumyer
15,301 PointsCan you identify which files specifically are for Android, iPhone and Ipad?
Paul Neumyer
15,301 PointsEven with an jquery event handler I can't get the background music to play on Android, iPhone, or iPad.
<audio id="bg_music" loop>
<source src="audio/willy_wonka_bg_music.mp3" type="audio/mp3">
<source src="audio/willy_wonka_bg_music.m4a" type="audio/aac">
<source src="audio/willy_wonka_bg_music.aac" type="audio/aac">
<source src="audio/willy_wonka_bg_music.wav" type="audio/wav">
<source src="audio/willy_wonka_bg_music.ogg" type="audio/ogg">
</audio>
<script>
$('#bg_music').trigger("play");
</script>