0

My problem is very strange. I've written a simple audio player application with javascript and php. I have an Audio element on JS and when i have to load a song i use the link /player.php?token... to take the song. Server side i have a simple script based on this: HTTP Range script

The problem is that chrome load correctly the song but meanwhile i cannot do any other xmlhttp request. All beacame pending request until audio request end.

enter image description here

See the picture above. For example if i seek the song to the end, chrome stop first request, all pending start and it do another reqeust for the song. If i test the same song with mac os (Safari, Chrome and Firefox) all go right. The problem appear only with windows (Chrome and Firefox). If i set audio src directly to the file mp3 all go right. Thanks all.

liuk997
  • 29
  • 3
  • 7
  • Make the request async. The problem is that while the data is not fully retrieved javascript hangs at that specific line of code and does not continue until it is done. Using async you simply make a second request. Easily achieved by using a js framework, such as jQuery. – Xorifelse Jun 21 '18 at 00:38
  • The request is already async, but i've tried with jQuery and nothing, always pending. – liuk997 Jun 21 '18 at 02:51

0 Answers0