Re: [whatwg] HTML Audio Element removal from DOM

<B5374FFB-0A80-4122-956A-7E7C386E74B2@jumis.com>

Current votes: None.

The issue I'm having with webkit is with running play() immediately after re=
moveChild. Are you hearing an audible pause when doing so in Opera and FF? I=
 believe there should be no audible pause even though there is an event paus=
e and a loop/queue cycle.

-Charles

On Jan 17, 2012, at 9:54 PM, "Michael A. Puls II" <shadow2531@gmail.com> wro=
te:

> On Tue, 17 Jan 2012 16:19:37 -0500, Charles Pritchard <chuck@jumis.com> wr=
ote:
>=20
>> When an <audio> element is removed from the DOM while playing, is that el=
ement paused?
>> That seems to be the behavior in Chrome. I'm looking for clarification.
>=20
> It's the behavior in Firefox and Opera too.
>=20
> In both cases below, the audio is paused when removed from the document. W=
hen added back it's still paused and when you call play(), it continues play=
ing from where it left off.
>=20
> <!DOCTYPE html>
> <html lang=3D"en">
>    <head>
>        <meta charset=3D"utf-8">
>        <title></title>
>        <script>
>            window.addEventListener("DOMContentLoaded", function() {
>                var player =3D document.createElement("audio");
>                player.controls =3D true;
>                player.autoplay =3D true;
>                player.src =3D "test.oga";
>                document.body.appendChild(player);
>                setTimeout(function() {
>                    document.body.removeChild(player);
>                    setTimeout(function() {
>                        document.body.appendChild(player);
>                        player.play();
>                    }, 3000);
>                }, 7000);
>            }, false);
>        </script>
>    </head>
>    <body>
>=20
>    </body>
> </html>
>=20
>=20
> <!DOCTYPE html>
> <html lang=3D"en">
>    <head>
>        <meta charset=3D"utf-8">
>        <title></title>
>        <script>
>            window.addEventListener("DOMContentLoaded", function() {
>                var player =3D document.getElementsByTagName("audio")[0];
>                setTimeout(function() {
>                    player =3D document.body.removeChild(player);
>                    setTimeout(function() {
>                        player =3D document.body.appendChild(player);
>                        player.play();
>                    }, 3000);
>                }, 7000);
>            }, false);
>        </script>
>    </head>
>    <body>
>        <audio controls autoplay src=3D"test.oga"></audio>
>    </body>
> </html>
>=20
> --=20
> Michael