W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2014

Re: File API: reading a Blob

From: Arun Ranganathan <arun@mozilla.com>
Date: Thu, 17 Jul 2014 09:10:07 -0400
Cc: Anne van Kesteren <annevk@annevk.nl>, Web Applications Working Group WG <public-webapps@w3.org>, Domenic Denicola <domenic@domenicdenicola.com>, Kyle Huey <me@kylehuey.com>
Message-Id: <CE7FF3FB-48BE-47E2-8A20-361B0901195B@mozilla.com>
To: Aymeric Vitte <vitteaymeric@gmail.com>

On Jul 16, 2014, at 8:20 AM, Aymeric Vitte <vitteaymeric@gmail.com> wrote:

> Example:
> var myfile=new Blob();
> //chunks are coming in
> myfile=new Blob([myfile,chunk],...)
> //mylink A tag
> mylink.href=URL.createObjectURL(myfile)
> click on mylink --> does not work
> Expected behavior: the file (a video for example) should play as it is incremented.
> This is inconsistent with the standard files behavior (see [1] for example), this example should work without having to use the Media Source Extensions API.

This is a great use case, but breaks File API currently (and the abstract model, too).  

Options to consider might be:

1. Including partial Blob data with the existing FIle API. But we already ship as is, so we could forego decoding to get this right, but that doesn’t seem optimal either. 

2. Use a new API for this, such as Streams. Since we’ll use streams for non-file cases, it could be useful here (and might be a better fit for the use case, which features heavy video use).

— A*
Received on Thursday, 17 July 2014 13:10:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:26 UTC