Mobile Safari & Chrome (ios) Osx Safari waits for canplaythrough()

213 views
Skip to first unread message

Matthew Paradis

unread,
May 15, 2014, 6:26:48 AM5/15/14
to jpl...@googlegroups.com
Apologies if this question has been answered already, but I am struggling to find information.

On every browser I have tested (apart from Mobile Safari & Chrome (ios) Osx Safari).  An audio file will start playing once enough has loaded for it to start resulting in a quick response time between pressing play and hearing the audio.

However on Mobile Safari & Chrome (ios) Osx Safari I find that the audio does not start to play until the canplaythrough event is fired. 

I have tested this using the jplayer audio demos as well as my own code.

This is a problem if (as I wish to do) you are playing long mp3 files as it can take a very long time to start playing.

I'm sure that there must be a solution for this, but I'm really struggling to find it.  Any information would be much appreciated.

Best

Matt

Mark Panaghiston

unread,
May 21, 2014, 5:23:26 AM5/21/14
to jpl...@googlegroups.com
The mp3 files should start within a second or so unless you are on a slow network. EG., worse than 3G.

My thinking is that your MP3 files are encoded incorrectly. We recommend using CBR, 44.1kHz sample rate and a bitrate of 128kbs. The VBR used to do odd stuff like that, but since I never use them any more, I cannot say what the latest iOS does with VBR these days. The duration is not possible to calculate until the entire VBR is download, which might be the root of the problem with the long mp3 files. With CBR mp3 files, the duration is a snip to calculate using the content length and bitrate... The browser does that. jPlayer has no control over any of that.
Reply all
Reply to author
Forward
0 new messages