Created
August 17, 2014 11:22
-
-
Save sasekazu/9a77044fd29fe90ab3cc to your computer and use it in GitHub Desktop.
HTML5 Audio
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>audio test</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function () { | |
$("#puyon1Button").click(function () { | |
console.log("puyon1"); | |
document.getElementById("puyon1").play(); | |
}); | |
$("#nyu1Button").click(function () { | |
console.log("nyu1"); | |
document.getElementById("nyu1").play(); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<div> | |
<input id="puyon1Button" value="ぷよん" type="button" /> | |
<input id="nyu1Button" value="ニュッ1" type="button" /> | |
</div> | |
<audio id="puyon1" preload="auto"> | |
<source src="sound/puyon1.mp3" type="audio/mp3"> | |
<source src="sound/puyon1.ogg" type="audio/ogg"> | |
<source src="sound/puyon1.wav" type="audio/wav"> | |
<p>※ご利用のブラウザでは音声を再生することができません。</p> | |
</audio> | |
<audio id="nyu1" preload="auto"> | |
<source src="sound/nyu1.mp3" type="audio/mp3"> | |
<source src="sound/nyu1.ogg" type="audio/ogg"> | |
<source src="sound/nyu1.wav" type="audio/wav"> | |
<p>※ご利用のブラウザでは音声を再生することができません。</p> | |
</audio> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment