I
I
Itvanya2016-03-24 21:53:02
JavaScript
Itvanya, 2016-03-24 21:53:02

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;
            };
        });

What is the solution? The main problem is the inability to change the audio position and incomprehensible incoming requests to the server like localhost/null, as well as "Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING". Thank you! :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grenudi, 2016-03-29
@Grenudi

I'm sorry, the question is completely off topic, but there is no HP in the toaster. How can I contact you (vk, mail, face)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question