WebKit相当于Firefox的“moz-chunked-arraybuffer” xhr responseType [英] WebKit equivalent to Firefox's "moz-chunked-arraybuffer" xhr responseType
问题描述
我想读取一个MP3流(来自icecast,读取ICY元数据,然后将二进制MP3数据传递给Web Audio Api)。
一个moz-chunked-arraybufferxhr responseType来读取进度数据,但我找不到任何与webkit / chrome相当的功能。
编辑2014/02/03:
Chrome开始实施xhr.responseTypestream
解析在Chrome中登陆(带有--enable-experimental-webkit-features标志),但是xhr.response结果对象(Stream)直接在Javascript中不可用: https://code.google.com/p/chromium/issues/detail?id=240603
编辑2014/07/10:
现在开发: https://github.com/whatwg/streams
Chromium devs计划做一些无需等待标准化完成的原型
编辑2015/01/22:
Streams API 将不会在XHR中实施(仅用于原型设计) 。 最终将在 .whatwg.org /rel =nofollow> Fetch API 实施,最近在Chrome中发布(位于实验性标志后面)。
编辑2015/01/30:
Fetch API有一个意图发货!
Streams API被宣布为即将推出的集成,它就在这里!
编辑2015/04/15:
\ o /荣耀!
Fetch API现在已经在Chrome 42(当前的稳定版本: http://googlechromereleases.blogspot.fr/2015/04/stable-channel-update_14.html )。
42不仅是生命,宇宙和所有东西的答案,而且也是这个问题我怎样才能消费一个像流一样的AJAX请求:
https://github.com /GoogleChrome/samples/blob/gh-pages/fetch-api/fetch-response-stream.html
故事结束:)
我的猜测是WebKit会得到 https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm 改为
I would like to read an MP3 stream (from icecast, to read ICY metadata an then pass the binary MP3 data to a Web Audio Api).
Firefox has a "moz-chunked-arraybuffer" xhr responseType to read data on progress, but I can't find any equivalent for webkit / chrome.
EDIT 2014/02/03 :
Chrome has started implementing xhr.responseType "stream"
The "parsing" is landed in Chrome (with the --enable-experimental-webkit-features flag) but the xhr.response resulted object (Stream) is not yet useable directly in Javascript : https://code.google.com/p/chromium/issues/detail?id=240603
EDIT 2014/07/10 :
The spec is now developped : https://github.com/whatwg/streams
Chromium devs plans to "do some prototype without waiting for completion of standardization"
EDIT 2015/01/22 :
The Streams API will not be implemented in XHR (it was just for prototyping). It will finally be implemented in the Fetch API implementation, which was recently shipped in Chrome (behind the experimental flag).
EDIT 2015/01/30 : Fetch API has an Intent to Ship ! Streams API are announced as "upcoming integrations", it's quite here !
EDIT 2015/04/15 :
\o/ Glory ! The Fetch API is now landed in Chrome 42 (current stable release : http://googlechromereleases.blogspot.fr/2015/04/stable-channel-update_14.html). 42 is not only the answer to life, the universe and everything but also to this question "How can I consume an "AJAX request" like a stream" :
https://github.com/GoogleChrome/samples/blob/gh-pages/fetch-api/fetch-response-stream.html
End of the story :)
My guess is that WebKit will get https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm instead
这篇关于WebKit相当于Firefox的“moz-chunked-arraybuffer” xhr responseType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!