[whatwg] When to stop <video> elements from playing
Křištof Želechovski
giecrilj at stegny.2a.pl
Fri Oct 19 23:17:22 PDT 2007
And the user probably will not visit the page ever again, just as a page
with bgsound. But that is up to the designer & developer of course.
Sorry for wasting your time, I just could not resist.
Chris
-----Original Message-----
From: whatwg-bounces at lists.whatwg.org
[mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Robert O'Callahan
Sent: Saturday, October 20, 2007 1:32 AM
To: Jonas Sicking
Cc: Maciej Stachowiak; whatwg
Subject: Re: [whatwg] When to stop <video> elements from playing
After some discussion on IRC, I think Jonas, Hixie and I agreed that we're
OK with the following approach:
-- sound is produced for display:none elements and elements not in the DOM
-- removing an element from the DOM automatically calls stop() on that
element
-- tearing down the owner document always stops the element playing (so
navigating away from the page always stops sound)
Therefore
myAudio = new Audio("foo.wav");
myAudio.onload = function () {
this.play();
myAudio = null;
}
will work, and will play until the sound ends or the user leaves the page.
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20071020/c6307a06/attachment.htm>
More information about the whatwg
mailing list