footy
footy

Reputation: 5911

how to detect if flash player is not there when using jPlayer to play sound

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?

Upvotes: 0

Views: 1083

Answers (3)

sbaechler
sbaechler

Reputation: 1429

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>');
}

Upvotes: 1

jcrain
jcrain

Reputation: 11

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.

Upvotes: 1

footy
footy

Reputation: 5911

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

Upvotes: 0

Related Questions