I'm building a Flash video player that uses the new StageVideo API. StageVideo requires window mode (wmode) to be set to "direct". Un开发者_运维问答fortunately, setting wmode to direct prevents the express install dialog from popping up if a user has a version of Flash Player older than 10.2.
How can I set my wmode to direct to get StageVideo to work but also ensure the Express Installer pops up for users with older Flash Players?
Thanks!
Use this, works for me:
if (swfobject.hasFlashPlayerVersion("11")) {
var fn = function() {
var now = new Date().getTime();
var flashvars = {};
var params = {
menu: "false",
scale: "noScale",
allowFullscreen: "true",
allowScriptAccess: "always",
bgcolor: "#000000",
wmode:"direct"
};
var attributes = {id: "altContent", name: "altContent"};
swfobject.embedSWF("test.swf?" + now, "altContent", "100%", "100%", "11", null, flashvars, params, attributes);
};
}
else {
var fn = function() {
var att = { data:"expressInstall.swf", width:"600", height:"240" };
var par = { menu:false };
var id = "altContent";
swfobject.showExpressInstall(att, par, id, cancelFunction);
}
}
swfobject.addDomLoadEvent(fn);
I would suggest using Adobe's Flash Player Detection Kit:
http://www.adobe.com/products/flashplayer/download/detection_kit/
Implement the java script and us it to check for the version of flash you want to use and adjust what gets set accordingly. That way you could check if the user has Flash Player < 10.2 and redirect them to update their flash plugin.
精彩评论