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
« Groups Home
Message from discussion xhr.responseType="arraybuffer"

Received: by 10.66.86.102 with SMTP id o6mr3716705paz.41.1349665783073;
        Sun, 07 Oct 2012 20:09:43 -0700 (PDT)
X-BeenThere: mootools-users@googlegroups.com
Received: by 10.68.226.100 with SMTP id rr4ls20977562pbc.2.gmail; Sun, 07 Oct
 2012 20:09:39 -0700 (PDT)
Received: by 10.66.74.39 with SMTP id q7mr3458085pav.29.1349665779375;
        Sun, 07 Oct 2012 20:09:39 -0700 (PDT)
Received: by 10.66.74.39 with SMTP id q7mr3458084pav.29.1349665779331;
        Sun, 07 Oct 2012 20:09:39 -0700 (PDT)
Return-Path: <bvanoudtsho...@gmail.com>
Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43])
        by gmr-mx.google.com with ESMTPS id js4si4076414pbb.2.2012.10.07.20.09.39
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 07 Oct 2012 20:09:39 -0700 (PDT)
Received-SPF: pass (google.com: domain of bvanoudtsho...@gmail.com designates 209.85.220.43 as permitted sender) client-ip=209.85.220.43;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of bvanoudtsho...@gmail.com designates 209.85.220.43 as permitted sender) smtp.mail=bvanoudtsho...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-pa0-f43.google.com with SMTP id fb1so3365737pad.2
        for <mootools-users@googlegroups.com>; Sun, 07 Oct 2012 20:09:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=message-id:date:from:user-agent:mime-version:to:subject:references
         :in-reply-to:content-type:content-transfer-encoding;
        bh=pDN//6zmZh2kF1zide3HxoySrBKi/pIrTi7Q3HxVgd0=;
        b=JpRLTWGObwHcbF2+aSw0qlid9XswjLuLq+AsyjjfjQjhqklg3c04VKwC4TbF6hh+M/
         en2mvfiTiFlO24VfmKGkqxJCrNsgI1o+GCBuYDw/xRajhPFacMl4vCYMYHKQLuXeQQhy
         TG4wTGE2vKNFuMcQn8DUvMcA6NI4y/1EDiJEoHRuDmarCTF/iXhOSOuhDoK9n0578VCG
         BYpzov32YwBC8TiHwf7XquidYEUYOcdIRClENxEjF8SixJ9wqXoUvGwmhRhj/L+vmQtQ
         WudDXUYpLlydy7EyfW7BwpZQtRzQYcbYmij/C4abx12IHwNoOiAdI7Z58RYgQTByosA1
         2ADg==
Received: by 10.66.77.74 with SMTP id q10mr24021456paw.81.1349665779192;
        Sun, 07 Oct 2012 20:09:39 -0700 (PDT)
Return-Path: <bvanoudtsho...@gmail.com>
Received: from [192.168.10.35] (203-59-162-117.perm.iinet.net.au. [203.59.162.117])
        by mx.google.com with ESMTPS id uj3sm9963771pbc.39.2012.10.07.20.09.37
        (version=SSLv3 cipher=OTHER);
        Sun, 07 Oct 2012 20:09:38 -0700 (PDT)
Message-ID: <507243DF.3030...@gmail.com>
Date: Mon, 08 Oct 2012 11:09:19 +0800
From: Barry van Oudtshoorn <bvanoudtsho...@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121005 Thunderbird/16.0
MIME-Version: 1.0
To: mootools-users@googlegroups.com
Subject: Re: [Moo] xhr.responseType="arraybuffer"
References: <507149CB....@leegoddard.net>
In-Reply-To: <507149CB....@leegoddard.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

This sounds like it'd be something that could reasonably be exposed as 
an option on the Request class, so my recommendation would be to alter 
that class and send a pull request. No guarantee that it'll be accepted, 
of course, but this is certainly the way that I'd want to interact with 
this in MooTools. It's a pretty fundamental operation on XHR, to be 
honest, so I think it's worthwhile.

On 07/10/12 17:22, Lee Goddard wrote:
> I'm making XHR requets with reponseType set to 'arraybuffer', so that 
> I can receive binary data to pass to a Web Audio API audio context's 
> decodeAudioData() method.
>
> As far as I know, this cannot be done with MooTools as it stands, 
> because although I could sub-class Request and adjust the 
> onStateChange() and success(), access is required to the private XHR 
> so that the responseType can be set after the requested is open()ed.
>
> Over-riding the send() method seems like a bad idea, as I'd have to 
> keep it updated with any change made to the core.
>
> The only solution I can see is to expose the currently-private xhr 
> object, but I guess it is private for a reason.
>
> Does anyone have any suggestions, please?
>
> TIA
> Lee


-- 
Barry van Oudtshoorn
www.barryvan.com.au