mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b802f622f8
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.
16 lines
325 B
HTML
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>
|