Search code examples
javascriptjqueryformattingmp3jplayer

jPlayer "duration" calculated as 1,440 minutes on iOs (for all mp3s)


I have an home-made simple webpage for playing mp3s and viewing pdfs. I use jPlayer v 2.9.2 to play the mp3s. On PC it works fine, but on iphone jPlayer gets the wrong value for duration: all files start out with "1439:59" remaining. This effectively breaks the scrubber bar.

An example mp3 is here (it's a practise track for my choir):

https://jamtartschoir.updog.co/files/Leeds%20United%20(Amanda%20Palmer)/Leeds%20United%20Bass.mp3

On iOs, when played with jPlayer, the mp3 starts playing, and then half way through it goes back to the start. This might be another symptom of the same problem.

It occurred to me that the mp3 might need some specially formatted header, or metadata, or something, in order to play properly on iOs. Has anyone come across a problem like this before?

thanks, Max

EDIT: I think this is something specific to Dropbox, or perhaps to Updog, which is a Dropbox-based free hosting service. I found an external https-served mp3 which I tried out in my app:

https://ia802508.us.archive.org/5/items/testmp3testfile/mpthreetest.mp3

this is fine - it gets the duration ok. However, if I download this file, put it in dropbox and then access the dropbox version, I get the duration bug.

https://jamtartschoir.updog.co/files/A%20New%20England%20(Billy%20Bragg)/mpthreetest.mp3

EDIT 2: I set up a test page to illustrate this issue, using audio tags.

https://jamtartschoir.updog.co/test.html


Solution

  • Does this happen with other .mp3 files? Try http://jplayer.org/audio/m4a/Miaow-07-Bubble.m4a

    If the problem doesn't happen then check out the response headers. Try allowing range-requests in your response. I know that chrome needs this, not sure about IOS but this could be the problem.

    If this is still a problem with this .mp3 then try one of the exampels from the jPlayer.org website.

    If this still persists then it's a jPlayer bug.