jPlayer does not work when flash is disabled

265 views
Skip to first unread message

Sidharth Kshatriya

unread,
Feb 22, 2011, 7:40:59 AM2/22/11
to jPlayer: HTML5 Audio & Video for jQuery
Dear All,

I am playing audio mp3 files from an apache server.

jPlayer 2.0.0 works fine on Firefox 3.6 (on linux & windows), Firefox
4.0 (on linux and windows) and Chrome 10 (on windows and linux) with
flash 10.1 enabled. It also works fine on iPhone which of course does
not use flash (actually there _is_ a small issue with iPhone too i.e.
the time of the mp3 does not show properly -- but more on that later)

When I disable flash on firefox or chrome, I expect jPlayer to work
properly because, after all, it works on iPhone which does not have
flash. But unfortunately, its does not work on firefox 3.6, 4.0 and
chrome at all even though these browsers support HTML5 audio/video.

So here are my issues:
1. Why does jPlayer not work when I disable flash on firefox or google
chrome (MAIN ISSUE)
2. Why does iPhone not show me the proper length of the mp3

How to repeat:
1. See any working example of jPlayer
2. Disable flash in chrome (by entereing about:plugins in address bar
and disabling flash) or in firefox in the Tools / Add-ons / Plugins
3. jPlayer does not work anymore

Thanks,

Sidharth

David Herbert

unread,
Feb 22, 2011, 8:07:17 AM2/22/11
to jpl...@googlegroups.com
Firefox doesn't have native mp3 support, only ogg, probably same issue
with Chrome but don't know. Try googling: firefox html5 mp3

On 22/02/11 12:40, Sidharth Kshatriya wrote:
> Dear All,
>
> I am playing audio mp3 files from an apache server.
>

> jPlayer 2.0.0 works fine on Firefox 3.6 (on linux& windows), Firefox

Mark Panaghiston

unread,
Feb 22, 2011, 8:10:51 AM2/22/11
to jpl...@googlegroups.com
The Firefox reason is because it needs the Flash to be able to play the MP3 format. While Firefox is an HTML5 browser, it supports the OGG format and has no native support for MP3. To use the HTML5 native support, you will need to supply the counterpart OGG format for each file. ie., A copy with a different encoding.

The Chrome problem is more surprising. My 1st thought that was the swfPath is incorrect, but since Firefox worked with Flash enabled, it would imply it is working.

I just reviewed on Chrome (win) and found no problem switching the Flash plugin off in about:plugins. Chrome can play MP3 files natively, so I used the jPlayer inspector to review which solution was being used.

iOS Safari has a problem with the media.duration being incorrect on the durationchange event when changing from 1 media to another. If I remember correctly, the 1st time it reports zero, the second time it reports the duration of the 1st song. There is a fix laid out and it will go into a patch. The solution will be along the lines of:
https://groups.google.com/d/topic/jplayer/MvPXJd0vl40/discussion

I am not sure what the problem is with Chrome.
Have you tried on an old IE6 browser to see if there are any JavaScript errors?

If you review on Opera, its Dev tools tend to be pretty good. Opera should behave the same way as Firefox btw. It needs Flash to play MP3 format. All the dev tools are getting quite good now. Even IE9 beta dev tools were a pleasant surprise when I took a look at them. I tend to use Firebug mostly though.

It's a long shot, but is the mp3 mime type audio/mpeg ?

Best regards,
Mark P.

Sidharth Kshatriya

unread,
Feb 22, 2011, 9:05:13 AM2/22/11
to jpl...@googlegroups.com
Dear Mark & David

Thanks for your replies.

1. Its true that firefox does not support the mp3 format. I saw https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements

2. [CORRECTION]  jPlayer plays an mp3 perfecly fine on Google Chrome with flash disabled. [This was earlier misreported by me and not working due to some other issue]

3. Thanks for the link regarding iOS incorrectly reporting the duration of the media. I am using playlists and as mentioned in Marks email the duration is only for the first clip. Since this is a known issue, would it be a good idea to incorporate the workaround in the jPlayer code itself?

Thanks guys, I love jPlayer!

Sidharth


--
You received this message because you are subscribed to the Google Groups "jPlayer: HTML5 Audio & Video for jQuery" 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.



--
Sidharth Kshatriya
www.sidk.info

Mark Panaghiston

unread,
Feb 22, 2011, 9:34:45 AM2/22/11
to jpl...@googlegroups.com
The choice is yours. I will be adding it to a patch in due course. The resizing patch dragged on longer than I had hoped. Patch 2.0.3 actually breaks backward compatibility slightly, but it affects the video player the most. Actually, the Audio player version should be seamless.  I'm going off on a tangent...

I planned to spend today going through the support group since I have not had the time lately. Maybe I will release a patch for this tomorrow... But I have jury service, so might not be around.

The quick fix to the duration bug is to add at the start of the _getHtmlStatus() function code:
if (media.duration) this.status.duration = media.duration;

Hmm... The if() is hardly worth it. Anywayz, that was the code suggested in the other post I'd linked to.

The other issue the link covered was the clearMedia() actions... In many ways I have considered removing the command completely. Its use must be limited... The only good example being to close a stream. Everyone else changes the media and plays it immediately making the clearMedia redundant. The command remains for now so that an attempt to cancel an in-progress download can be made either on demand or when the setMedia command occurs.  But again... I am going off on a tangent again.

Best regards,
Mark P.
Reply all
Reply to author
Forward
0 new messages