]> 105106.c2e0p.group Git - sound.git/blobdiff - sound.html
Add loop and autoplay support.
[sound.git] / sound.html
index 82020e64951cdcd44f8099f5e293ac026bc12aab..6f0a1f6fe19d7dfb29582244fe4ea61bd7c89c9f 100644 (file)
@@ -27,7 +27,7 @@
        function onload() {
                sound = new Sound();
                sound.src = 'Coin.wav';
-               sound.play();
+               sound.autoplay = true;
                sound.addEventListener('ended', eventLogger);
                sound.addEventListener('play', eventLogger);
                sound.addEventListener('pause', eventLogger);
@@ -49,6 +49,7 @@
                <button onclick="sound.pause()">pause</button>
                <button onclick="sound.muted = !sound.muted">mute</button>
                <input type="range" min="0" max="1" step="0.01" onchange="sound.volume = event.target.value" />
+               <button onclick="sound.loop = !sound.loop">loop</button>
        </div>
 
 </body>