Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
274 views
in Technique[技术] by (71.8m points)

javascript - WebKit equivalent to Firefox's "moz-chunked-arraybuffer" xhr responseType

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 :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

My guess is that WebKit will get https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm instead


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...