[whatwg] Limiting the amount of downloaded but not watched video

Boris Zbarsky bzbarsky at MIT.EDU
Tue Jan 18 11:09:09 PST 2011


On 1/18/11 2:01 PM, Zachary Ozer wrote:
> On Tue, Jan 18, 2011 at 6:46 PM, Boris Zbarsky<bzbarsky at mit.edu>  wrote:
>> On 1/18/11 12:11 PM, Zachary Ozer wrote:
>>>
>>> (Side
>>> note: I also haven't found a browser that stops loading the resource
>>> even if you destroy the video tag.)
>>
>> "destroy" in what sense?  You verified in a debugger that it had been
>> garbage collected?
>
> I'm doing document.body.removeChild. Is there a better way to do it?

Not really, no.  Once you remove it, even if there is nothing 
referencing it anymore (which may or may not be the case depending on 
what other code is running on the page), it still won't be destroyed 
until the next time garbage collection happens.  In the case of garbage 
collectors that can do different levels of collection (generational, 
etc), it won't be destroyed until whatever level is needed to destroy it 
happens.

In general, depending on finalizers to release resources (which is 
what's happening here) is not really a workable setup.  Maybe we need an 
api to explicitly release the data on an audio/video tag?

-Boris


More information about the whatwg mailing list