mp3.js
Dead Simple Audio for the Web
quizlet.github.io/mp3.js
1. Get It!
Download mp3.js
2. Include mp3.js on your page
<html>
<head>
...
<script type="text/javascript" src="/path/to/mp3.js" />
</head>
...
3. Drop some beats
var player = new AudioPlayer();
player.play('/hammertime.mp3');
player.preload('/what-the-fox-say.mp3');
player.play('/all-along-the-watchtower.mp3', {
onLoad: function() { console.log('Audio Loaded!'); },
onError: function() { console.log('Error Loading Audio!'); },
onStop: function() { console.log('Audio Stopped Playing!'); },
timeout: 5000
});
player.stopAll();
player.stop('/hammertime.mp3');