0

in jPlayer, if HTML5 is not supported, it falls back to flash player, But how do i know when flash player itself is not installed on the browser when jPlayer is trying to fall back to flash. I Have this problem. My player just stops like a mute, when i dont have flash, instead of giving a nice warning to install a flash player. Now in case of norml HTML tags i know how to do this, but how to do the same for jPlayer?

footy
  • 5,803
  • 13
  • 48
  • 96
  • This thread: http://stackoverflow.com/questions/998245/how-can-i-detect-if-flash-is-installed-and-if-not-display-a-hidden-div-that-info?answertab=votes#tab-top – Joe Oct 12 '11 at 19:53
  • @IAbstract mine's diff. I want to know how to do it when there is no flash player with jPlayer. The problem is that jPlayer tries HTML5, then FLASH . Does it have a call back function if BOTH of those fails. I cannot use a simple solution like that because, IF I have my default player as FLASH player, and the browser doesn't have FLASH, it displays an error directly, BUT when it actually should have tried to go back to HTML 5. So there you go. My current problem is this in IE. I open my site-> (there is no flash player in brosere) -> no HTML5 support-> how to display error in jPlayer then? – footy Oct 13 '11 at 01:24

3 Answers3

1

This should work:

$.jPlayer.prototype._checkForFlash(10)

10 is the version. It returns true if the version is available.

You could use:

var has_flash = $.jPlayer.prototype._checkForFlash(10)
if(!has_flash && !Modernizr.video.h264 && !Modernizr.audio.mp3) {
    $('#players').html('<h2 class="noflash">Please install the <a href="http://get.adobe.com/flashplayer/">Flash Player</a>.</h2>');
}
sbaechler
  • 1,329
  • 14
  • 21
1

I used the jquery swfobject plugin when I had a similar problem with jplayer and flash not being installed.

I called $.flash.available which returns a boolean as to whether or not flash is installed in the browser. You can throw your nice warning then.

jcrain
  • 11
  • 2
0

Well, The only workaround i have found till now is that jPlayer doesnot put anything in its placeholder when both Flash and HTML5 is missing. So its just best to put a warning in your placeholder of the jPlayer.

This may not be a fool-proof solution, but this is the best i could do. Any other suggestions are welcomed

footy
  • 5,803
  • 13
  • 48
  • 96