W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2007

[whatwg] When to stop <video> elements from playing

From: Křištof Želechovski <giecrilj@stegny.2a.pl>
Date: Sat, 20 Oct 2007 08:17:22 +0200
Message-ID: <001501c812e0$e4097b20$4d01010a@IBM42F76C011DF>
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@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>
Received on Friday, 19 October 2007 23:17:22 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:37 UTC