This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24292 - Video and Audio constructors should accept File and Blob.
Summary: Video and Audio constructors should accept File and Blob.
Status: RESOLVED DUPLICATE of bug 23775
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 16:52 UTC by oao.hikaru.oao
Modified: 2014-02-16 11:09 UTC (History)
7 users (show)

See Also:


Attachments

Description oao.hikaru.oao 2014-01-14 16:52:38 UTC
Now, when use `File` to `Audio`, we should write like this,

var audio = new Audio(URL.createObjectURL(file));

but, that is redundancy, and `createObjectURL` need `revokeObjectURL` to release it's data.

Therefore, we should be writable like this,

var audio = new Audio(file);
Comment 1 Philip Jägenstedt 2014-01-14 16:58:17 UTC
The HTMLMediaElement.srcObject suggestion in bug 23775 is relevant.

Also note that there is no Video constructor, not that it matters.
Comment 2 Arun 2014-01-14 18:28:22 UTC
(In reply to oao.hikaru.oao from comment #0)
> Now, when use `File` to `Audio`, we should write like this,
> 
> var audio = new Audio(URL.createObjectURL(file));
> 
> but, that is redundancy, and `createObjectURL` need `revokeObjectURL` to
> release it's data.
> 
> Therefore, we should be writable like this,
> 
> var audio = new Audio(file);

FYI, URL.createFor does not need developers to couple a URL.revokeObjectURL call with it.
Comment 3 oao.hikaru.oao 2014-01-14 19:08:33 UTC
(In reply to Philip Jägenstedt from comment #1)
> The HTMLMediaElement.srcObject suggestion in bug 23775 is relevant.
> 
> Also note that there is no Video constructor, not that it matters.

Thanks.
That mean we can write like this ?

var audio = new Audio();
audio.srcObject = file;
Comment 4 oao.hikaru.oao 2014-01-14 19:14:27 UTC
(In reply to Arun from comment #2)

> FYI, URL.createFor does not need developers to couple a URL.revokeObjectURL
> call with it.

Thanks.
I learned that.
Comment 5 Philip Jägenstedt 2014-01-15 03:28:26 UTC
(In reply to oao.hikaru.oao from comment #3)
> (In reply to Philip Jägenstedt from comment #1)
> > The HTMLMediaElement.srcObject suggestion in bug 23775 is relevant.
> > 
> > Also note that there is no Video constructor, not that it matters.
> 
> Thanks.
> That mean we can write like this ?
> 
> var audio = new Audio();
> audio.srcObject = file;

Yes, I believe that's how it's supposed to work.
Comment 6 oao.hikaru.oao 2014-01-15 04:21:07 UTC
(In reply to Philip Jägenstedt from comment #5)
> (In reply to oao.hikaru.oao from comment #3)
> > (In reply to Philip Jägenstedt from comment #1)
> > > The HTMLMediaElement.srcObject suggestion in bug 23775 is relevant.
> > > 
> > > Also note that there is no Video constructor, not that it matters.
> > 
> > Thanks.
> > That mean we can write like this ?
> > 
> > var audio = new Audio();
> > audio.srcObject = file;
> 
> Yes, I believe that's how it's supposed to work.

I think it's good form.
Thank you!
Comment 7 Silvia Pfeiffer 2014-02-16 11:09:55 UTC

*** This bug has been marked as a duplicate of bug 23775 ***