1

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

Max Williams
  • 32,435
  • 31
  • 130
  • 197

2 Answers2

1

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.

Martin Dawson
  • 7,455
  • 6
  • 49
  • 92
  • it won't play that m4a at all, but that might be because it's an m4a and i need to do some extra config to play the different format or it might be because i'm on an https page and it's not happy with an http asset (mixed content warning, in other words). I'm looking around for some other public mp3s but can't actually find any https ones. – Max Williams Mar 31 '17 at 14:51
  • @MaxWilliams You need. Supplied: 'mp4' – Martin Dawson Mar 31 '17 at 16:02
  • I'm not sure what you mean, sorry: is that something I need to set on the actual file itself? I have no control over how it's served from within Dropbox. BTW I found this test mp3, which works fine: https://ia802508.us.archive.org/5/items/testmp3testfile/mpthreetest.mp3 – Max Williams Mar 31 '17 at 16:18
  • Oh sorry, you're talking about an option to jplayer aren't you... I'm already passing `supplied: "mp3",` - why would i need to set it to "mp4" for an mp3 file? Thanks for the help btw :) – Max Williams Mar 31 '17 at 16:19
  • @MaxWilliams Sorry, I meant M4a if you want to play the one I linked. My bad. `Supplied: M4a`. – Martin Dawson Mar 31 '17 at 16:23
  • @MaxWilliams The fact that you found another `.mp3` file which works confirms that it's how you are serving your own `.mp3` files which is wrong from the server side – Martin Dawson Mar 31 '17 at 16:24
  • Yeah - see the edit to my question. It's something to do with how the files are served, which unfortunately I don't think I have any control over. Looking at other discussions eg http://stackoverflow.com/questions/9629223/audio-duration-returns-infinity-on-safari-when-mp3-is-served-from-php I think you might be right about the range request. Do you know how I might test it? Curl perhaps? – Max Williams Mar 31 '17 at 16:30
  • @MaxWilliams If you have no control over the headers in the response then their isn't much that can be done I don't think but that's another question for server-side experts which I am not. This isn't jPlayer specific. You should get the same problem with a normal `audio` tag – Martin Dawson Mar 31 '17 at 17:02
  • I do indeed - thanks. (with an audio tag it's labelled as a "Live Broadcast" in safari on ios. I'll contact Updog who run the serving. Thanks for all your help, this is definitely the problem. – Max Williams Apr 03 '17 at 09:25
0

Answering this in case anyone else has the same issue with files served from Dropbox: adding ?dl=1 to the end of the mp3 src urls fixed this.

Max Williams
  • 32,435
  • 31
  • 130
  • 197