Created
October 12, 2014 08:32
-
-
Save YutaWatanabe/1ad6686a514d7084811d to your computer and use it in GitHub Desktop.
play audio in phonegap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementById("playBtn") | |
.addEventListener("click", function(){ | |
var media = new Media( | |
"/android_asset/www/sample.mp3", | |
function(){ | |
console.log("success"); | |
}, | |
function(err){ | |
console.log("fail"); | |
} | |
); | |
media.play(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment