Wavesurfer.js: Replace XMLHttpRequest with fetch API

Created on 7 May 2018  路  5Comments  路  Source: katspaugh/wavesurfer.js

Most helpful comment

I might be interested, we are currently planning on changing a lot of functionality on how to fetch the audio from our services for the wavesurfer. Our issue is that we do not know the content length of the audio stream, so maybe by having the whole fetch api available within wavesurfer will aid us in this.

All 5 comments

@janhartmann perhaps you can take a look at this and make an initial pull request? Because this will break any xhr options I think.. cc @katspaugh

I might be interested, we are currently planning on changing a lot of functionality on how to fetch the audio from our services for the wavesurfer. Our issue is that we do not know the content length of the audio stream, so maybe by having the whole fetch api available within wavesurfer will aid us in this.

1541

@entonbiba since we're going to release a 3.0.0 I suggest

  • we don't offer any backwards-compat; replace XMLHTTPRequest with fetch
  • browsers that do not support fetch (IE11) can use the fetch polyfill

Our issue is that we do not know the content length of the audio stream

fyi @janhartmann with the new fetch implementation in 3.0 your server needs to send a Content-Length header if you want to use the loading event (for progress bars etc).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pyros-endgame picture pyros-endgame  路  4Comments

daslicht picture daslicht  路  3Comments

SGDAT picture SGDAT  路  3Comments

asdfang picture asdfang  路  4Comments

Gerlie15 picture Gerlie15  路  4Comments