Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home for chromium.org
« Groups Home
Message from discussion Loading streaming binary data with XHR ArrayBuffer
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Karel Tuma  
View profile   Translate to Translated (View Original)
 More options Apr 25 2012, 10:05 am
From: Karel Tuma <karel.t...@gmail.com>
Date: Wed, 25 Apr 2012 07:05:54 -0700 (PDT)
Local: Wed, Apr 25 2012 10:05 am
Subject: Re: Loading streaming binary data with XHR ArrayBuffer
Hi,

Unfortunately, this is not possible with current XHR Level 2. Chunked/
progressive
arraybuffers|blobs didnt make it into the spec, however it is most
likely
going to be implemented:

http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0741.html

Currently, responseText hacks (*BAD* idea for media streaming) are
easy and it
usually works (until the process runs out of RAM, that is). For
multimedia though,
one has to do it properly, ie via NaCl wrapper
https://developers.google.com/native-client/pepper18/peppercpp/classp...

NaCl can pass arraybuffers to javascript, or just share the sandboxed
filesystem where
progressively downloaded assets can be saved.

//k

On Apr 21, 3:29 pm, Adam Malcontenti-Wilson <adman....@gmail.com>
wrote:

> Hi,
> I've recently found that if you try to use the
> responseType="arraybuffer" property that the response property doesn't
> get populated until the actual file has finished loading, which poses
> a problem when I want to try and read data from a streaming binary
> source (e.g. such as a Shoutcast stream (although they may be other
> similar use-cases)).
> Progress events show me how much data has been downloaded but doesn't
> actually allow me to access any of it (that I can see). If I don't
> specify a responseType, I can use the responseText property which
> shows what it has read thus far, but this is almost useless for binary
> data.
> Is this a bug (e.g. simply not yet implemented in any major browser),
> or a lacking part of the specification? I notice that in the XHR spec,
> it defines the "response entity body" as "the fragment of the entity
> body of the response received so far" which means that I would have
> expected it to work as I've described, but it seems not to. Have I
> misinterpreted the spec in this way?

> P.S. Ideally for this use-case as it is infinite streaming, XHR might
> need to be extended to allow progress events to only contain the last
> chunk, and discard the rest of the data instead of buffering it in
> memory waiting for the end of the response to fire the load event,
> however this might not be the case with other examples such as
> attempting to unzip a zip file while it is still being downloaded, and
> although it might be a good suggestion for future XHR work, not the
> question I am asking at the moment. Also, I understand that I could
> use a proxy to decode and chunk over WebSockets, but I'm asking more
> about being able to do this in-browser with HTML5 rather than using
> intermediate servers.

> Thanks,
> Adam.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.