gecko-dev/dom/base/test/file_webaudioLoop2.html
Ehsan Akhgari 2c2295d295 Bug 1180539 - Correctly dispatch media-playback notifications when an AudioContext is closed/suspended/resumed; r=baku
Since navigating away from a page with an active AudioContext will close
it internally, this patch fixes a similar issue to bug 1180535 for Web
Audio too.
2015-07-06 21:21:19 -04:00

16 lines
325 B
HTML

<!DOCTYPE html>
<script>
var ac = new AudioContext();
fetch("audio.ogg").then(response => {
return response.arrayBuffer();
}).then(ab => {
return ac.decodeAudioData(ab);
}).then(ab => {
var src = ac.createBufferSource();
src.buffer = ab;
src.loop = true;
src.start();
src.connect(ac.destination);
});
</script>