0

I've tried to access and play my raw .mp4 file with Chrome and Firefox on this location:

http://localhost/myproject/myfiles/myfile.mp4

It takes more that 5 minutes to be able to play a single file. Why was this happening. (it also happens to my .mp3 files too)

This causes my javascript application seems not working though you have to wait more than 5 minutes to see it in action.

How do I speed up the process. Here's the code for playing .mp3 files:

var audio = document.createElement('audio'),
source = context.createMediaElementSource(audio);
audio.setAttribute('autoPlay','false');
audio.src = path + mp3.file;
audio.addEventListener('canplay', function(e) {
    audio.play();
    analyser.smoothingTimeConstant = 0.8;
    analyser.fftSize = 512;
    source.connect(analyser);
}, false);

Thank you,

ket
  • 945
  • 1
  • 9
  • 15
  • I would look in the browser's developer tools (Firebug or Chrome's built-in console, in the "Net" tab) what exactly takes so long. – Pekka Oct 20 '13 at 16:27
  • the problem is similar to this question: http://stackoverflow.com/questions/17502109/i-cant-play-mp3-files-on-localhost – ket Oct 20 '13 at 16:29
  • As said, more info is needed about what exactly about the request takes so long. Also what size is the file – Pekka Oct 20 '13 at 16:30
  • OK. I would look at the console. I don't quite understand about it though. – ket Oct 20 '13 at 16:34
  • Maybe this helps: http://www.softwareishard.com/blog/firebug/introduction-to-firebug-net-panel/ What's interesting in this case is the "timeline" section (search for "timeline" in the document) you can get the timeline for each file that is loaded in your document. It would be interesting to see which part of the request takes so long - "connecting", "queueing", "waiting for response", or "receiving data". Also it's absolutely essential that you tell us how large the file is. – Pekka Oct 20 '13 at 16:37
  • The .mp4 file size is 41.3 Mb. Average .mp3 files size are 5 Mb. thanks – ket Oct 20 '13 at 16:44

0 Answers0