This is more a notification than a help request, but since it took me
hours and hours to figure it out, I thought I'd notify all the other
jPlayer users out there.
I was having a problem with Safari displaying the duration of mp3
files to NaN:NaN. After doing some debugging, I found that my audio
tag was returning "Infinity" when checking it with the following
jQuery:
$('#jplayer_player audio').get(0).duration
Which I couldn't figure out for the life of me why this didn't occur
on the demo page at
http://www.happyworm.com/jquery/jplayer/latest/demo-01-oggSupportFalse.htm
Finally I found that the HTTP headers seem to be throwing off Safari.
The demo headers include:
Accept-Ranges:bytes
Connection:Keep-Alive
Content-Length:3350593
Content-Type:application/octet-stream
Date:Sat, 01 May 2010 04:38:53 GMT
Etag:"48319f7-332041-467a8fb0de0c0"
Keep-Alive:timeout=15, max=100
Last-Modified:Thu, 16 Apr 2009 09:49:31 GMT
Server:Apache/2.2
But my server headers (it's going through a PHP passthrough script)
are:
Cache-Control:store, no-cache, must-revalidate, post-check=0, pre-
check=0
Connection:Keep-Alive
Content-Length:3350593
Content-Type:audio/mpeg; name="01 All My Days.mp3"
Date:Sat, 01 May 2010 04:40:26 GMT
Expires:Sun, 19 Nov 1978 05:00:00 GMT
Keep-Alive:timeout=15, max=100
Last-Modified:Sat, 01 May 2010 04:40:26 GMT
Server:Apache/2.0.59 (Unix) PHP/5.2.5 DAV/2 mod_ssl/2.0.59 OpenSSL/
0.9.7l
It seems that the "Content-Type" header is responsible. When the
content type is "audio/mpeg" Safari is unable to calculate the
duration of files within audio tags. When the content type is
"application/octet-stream" (as in the demo), things work properly.
Seems mostly like a bug in Safari, but something to watch out for.
--
You received this message because you are subscribed to the Google Groups "jPlayer: the CSS styleable jQuery audio player plugin" group.
To post to this group, send email to
jpl...@googlegroups.com.
To unsubscribe from this group, send email to
jplayer+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/jplayer?hl=en.