Target browsers: iOS, Android, Blackberry, webOS, Opera Mobile, Firefox Mobile
Multimedia consists of audio and video. Playing audio on mobile can be tricky. There are a few supported audio formats on mobile browsers—Ogg Vorbis, MP3, and WAV. One issue with these formats is that all of them are not supported by all browsers.
Enter the following code in the document:
<!doctype html> <html> <head> <title>Mobile Cookbook</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div id="main"> <audio src="resources/snake_charmer.mp3" controls preload="auto" autobuffer> </audio> </div> </body> </html>
Now when rendering it in the browser, you will see a music player displayed as follows, and when you press play, the music should stream: