Closed GoogleCodeExporter closed 9 years ago
Sorry for entering this as a defect instead of an enhancement. Sadly, the new
issue form did not allow me to choose an issue type.
Original comment by bdw4...@gmail.com
on 16 Jun 2011 at 8:58
I understand your request, but this functionality is already possible with the
existing SWFObject codebase.
You can use createSWF instead of embedSWF to perform more targeted embeds. If
you don't care about version targeting and want SWFObject to ALWAYS embed the
SWF, regardless of version found (even if Flash Player isn't installed), you
can simply use swfobject.createSWF. You can also use embedSWF but specify "0"
for required Flash Player version; SWFObject will write the <object> to the
page, and you'll have to depend on your browser's native functionality to
handle the rest.
On a similar note, if you use static publishing and don't care about version
targeting, you can simply omit swfobject.registerSWF and let the browser handle
the visitor's lack of Flash Player. (I see Kyle covered this in his email on
the SWFObject Google Group thread)
There are many ways to handle this task, and the current SWFObject library
should meet your needs. It really depends on how you use it. Also, if you're
using a jQuery plugin that harnesses SWFObject, that's out of our hands. Please
see the plugin creator about modifications.
Thanks for the input.
Original comment by platelu...@gmail.com
on 16 Jun 2011 at 10:00
Thanks for the additional information. It seems your work arounds all involve
not needing version targeting and/or using static publishing.
Is the desired outcome still available if I am using dynamic publishing AND
need to target a specific version of Flash?
Original comment by bdw4...@gmail.com
on 16 Jun 2011 at 10:09
Yes, but with one huge caveat: each browser behaves differently, and if the
browser doesn't support installing the plugin, the fallback (aka "alternate")
content WILL NOT BE VISIBLE.
Here's an example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simple dynamic publishing</title>
<!-- Loading SWFObject from the Google repository; only works if you have an
internet connection! -->
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
var target_version = "10";
var flashvars = {};
var params = {};
var attributes = {};
var playerVersion = swfobject.getFlashPlayerVersion();
//If no Flash Player, (or Flash Player is so outdated it doesn't support
ExpressInstall),
//embed using codebase and pluginurl options
if(playerVersion.major === 0 || playerVersion.major === 6 &&
playerVersion.minor === 0 && playerVersion.release < 65){
alert("You don't have Flash. Let's get the browser to prompt you to install the plugin.");
target_version = "0";
if(swfobject.ua.ie){
//For Internet Explorer
attributes.codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";
} else {
//For all other browsers
params.pluginurl = "http://www.adobe.com/go/getflashplayer";
}
} else {
alert("You have Flash. We'll let SWFObject handle version checking. ExpressInstall will prompt you to upgrade if you have an outdated version of Flash Player.");
}
swfobject.embedSWF("swfobject.swf", "flashcontent", "550", "400",
target_version, "path/to/expressinstall.swf", flashvars, params, attributes);
</script>
</head>
<body>
<div id="flashcontent">This fallback content will only be seen by visitors who
have JavaScript disabled.</div>
</body>
</html>
Original comment by platelu...@gmail.com
on 17 Jun 2011 at 4:14
Original issue reported on code.google.com by
bdw4...@gmail.com
on 16 Jun 2011 at 8:56