This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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);
The HTMLMediaElement.srcObject suggestion in bug 23775 is relevant. Also note that there is no Video constructor, not that it matters.
(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.
(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;
(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.
(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.
(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!
*** This bug has been marked as a duplicate of bug 23775 ***