soundjs插件
<!DOCTYPE html>
<html>
<head>
<script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
<script>
var soundID = "Thunder";
function loadSound () {
createjs.Sound.registerSound("/static/1.mp3", soundID);
}
var sound;
function playSound () {
sound = createjs.Sound.play(soundID);
}
function stopSound () {
sound.stop()
}
</script>
</head>
<body onload="loadSound();">
<button onclick="playSound();" class="playSound">Play Sound</button>
<button onclick="stopSound();" class="playSound">Stop Sound</button>
</body>
</html>
本文标题:soundjs插件
本文链接:https://www.haomeiwen.com/subject/grvjaftx.html
网友评论