Answer the question
In order to leave comments, you need to log in
How to configure node.js server to properly return buffered/chuncked information for html5 audio api?
Guys, hello everyone. There is a website - an audio player. It has a lot of music, biographies of musicians, covers, albums, etc. The server communicates with the client via resutful api. The problem is that the owner discovered the problem: even during downtime, requests like https://localhost/null come to the server and browsers complain about "Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING". The audio is played using html5 audio, and the loading of tracks at play time is done using the native html5 audio api. Again, due to incorrect server behavior, it is not possible to jump to different sections of the audio (audio.currentTime is not set) unless reloading the audio using a specific ajax request. Something like that :
$http.get(audioFileURL,
{responseType:'blob'})
.success(function(data){
var fr = new FileReader;
fr.readAsDataURL(data);
fr.onloadend = function(){
domObjects.audio.src = fr.result;
};
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question