Re: Lifetime of new Audio()

On Mon, Jan 31, 2011 at 2:52 PM, Adrian Bateman <adrianba@microsoft.com> wrote:
> Ignoring for now the timing issue of how quickly the play() actually has enough content to start playing, after the function returns there is no reference to the Audio object. Is the fact that the object is playing enough to pin it in memory? Otherwise the GC could collect the object and stop the playing. I scanned the media section of the spec but couldn't see where it defines this behaviour one way or the other.

This is mentioned in the media section immediately after talking about
'playback rate'

"Media elements that are potentially playing while not in a Document
must not play any video, but should play any audio component. Media
elements must not stop playing just because all references to them
have been removed; only once a media element to which no references
exist has reached a point where no further audio remains to be played
for that element (e.g. because the element is paused, or because the
end of the clip has been reached, or because its playbackRate is 0.0)
may the element be garbage collected."

Chris.
-- 
http://www.bluishcoder.co.nz

Received on Monday, 31 January 2011 04:48:22 UTC