Getting ERR_CONNECTION_RESET while playing mp3 audio

I am using the following code:

var sound = new Audio(path);
sound.load();

Then I play. He starts to play for about 10-15 seconds. But then he stops. An error is displayed on the console on chrome:

localhost: 8080 / sounds / music.mp3 net :: ERR_CONNECTION_RESET

What is the problem? When you open the file directly from the browser, it loads and plays normally.

EDIT 1: this only happens with chrome. Firefox and IE play music from beginning to end.

+4
source share

Source: https://habr.com/ru/post/1568864/


All Articles