Message from discussion
xhr.responseType="arraybuffer"
Received: by 10.180.86.97 with SMTP id o1mr2110563wiz.2.1349680163071;
Mon, 08 Oct 2012 00:09:23 -0700 (PDT)
X-BeenThere: mootools-users@googlegroups.com
Received: by 10.180.105.1 with SMTP id gi1ls6615951wib.2.canary; Mon, 08 Oct
2012 00:09:21 -0700 (PDT)
Received: by 10.180.86.97 with SMTP id o1mr2110541wiz.2.1349680161432;
Mon, 08 Oct 2012 00:09:21 -0700 (PDT)
Received: by 10.180.86.97 with SMTP id o1mr2110540wiz.2.1349680161423;
Mon, 08 Oct 2012 00:09:21 -0700 (PDT)
Return-Path: <lee...@gmail.com>
Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46])
by gmr-mx.google.com with ESMTPS id hm1si882869wib.3.2012.10.08.00.09.21
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 08 Oct 2012 00:09:21 -0700 (PDT)
Received-SPF: pass (google.com: domain of lee...@gmail.com designates 74.125.82.46 as permitted sender) client-ip=74.125.82.46;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of lee...@gmail.com designates 74.125.82.46 as permitted sender) smtp.mail=lee...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-wg0-f46.google.com with SMTP id dt12so2790443wgb.15
for <mootools-users@googlegroups.com>; Mon, 08 Oct 2012 00:09:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=message-id:date:from:reply-to:user-agent:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
bh=cUGtAT3dWfXNyO22EM27LYD6LeH8gpiylo50/97KuQs=;
b=rC25xSSgdmVXMIk+bqUwZo+QJPyoO1CzVqbk70RXRTMUuJiMsvF3HMUODSVhNl7up3
U/33qrUkOFc3vkUm6J7txcSKSzfTeX+T+TCydsTFyDZ0/OL4XhNd5xJwg6YsPf4BjLpU
djVE0rEwmkPVAoUVKYTVioKZLWRveBk3pQoGoWWWHVDNZ9Jl9MAYb13k9D4oNTJczA+M
BTbogIyL0P+gho49azIgQ560QbheVzlq+2RYlN4F+ALkWrS5eyCmafW7b8ST4moyUjd3
IrgZm/+aUX9a/VAVRx0h320Qw9+hFQJcaIx9k7Stwj+L5QjFaXOgZbWD81yAXGuc+fN3
9UnA==
Received: by 10.216.245.135 with SMTP id o7mr8910278wer.40.1349680161315;
Mon, 08 Oct 2012 00:09:21 -0700 (PDT)
Return-Path: <lee...@gmail.com>
Received: from Lee.local (catv-178-48-88-150.catv.broadband.hu. [178.48.88.150])
by mx.google.com with ESMTPS id m14sm18094089wie.8.2012.10.08.00.09.20
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 08 Oct 2012 00:09:20 -0700 (PDT)
Message-ID: <50727C1F.6040...@gmail.com>
Date: Mon, 08 Oct 2012 09:09:19 +0200
From: Lee <lee...@gmail.com>
Reply-To: l...@leegoddard.net
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version: 1.0
To: mootools-users@googlegroups.com
Subject: Re: [Moo] xhr.responseType="arraybuffer"
References: <507149CB....@leegoddard.net> <507243DF.3030...@gmail.com>
In-Reply-To: <507243DF.3030...@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Thanks Barry.
Exciting. I've not tried this before, but I'm happy to do it (I've made
the mod already). Is there another list, or IRC, where I can ask
possibly stupid questions about the operation, if it is not
straight-forward?
TIA
Lee
On 08/10/2012 05:09, Barry van Oudtshoorn wrote:
> 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
>
>