On Sun, Jul 19, 2015 at 2:45 PM, Robert O'Callahan <rob...@ocallahan.org> wrote:
> On Thu, Jul 16, 2015 at 5:09 PM, Jonas Sicking <jo...@sicking.cc> wrote:
>>
>> On Wed, Jul 15, 2015 at 12:42 PM, Jan-Ivar Bruaroey <j...@mozilla.com>
>> wrote:
>> > This means it will throw TypeError on set of: MediaSource objects, Blob
>> > objects, and File objects, for now.
>>
>> For what it's worth, I think implementing Blob/File support would be
>> quite trivial. Just make
>>
>> elem.srcObject = blob;
>>
>> internally call
>>
>> URL.revokeObjectURL(this.mOldObjectURL);
>> this.mOldObjectURL = URL.createObjectURL(blob);
>> LoadSrc(this.mOldObjectURL);
>
> With this implementation, if you set elem.srcObject = blob and then release
> all references to the media element, the media element is GCed and the Blob
> is leaked. Avoiding that is exactly why the srcObject API is preferred over
> createObjectURL.

Good point. We also need to call
URL.revokeObjectURL(this.mOldObjectURL); in the .src setter and in the
dtor.

/ Jonas
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to