Posted by theoldfather on June 3, 2008 at 6:14pm
| Project: | SWFObject API |
| Version: | 5.x-2.0-beta1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Issue Summary
Had problems with flash not showing up in IE6 & IE7 so I patched the code per the instruction on Google API (http://code.google.com/p/swfobject/wiki/documentation)
Find line:
// create the html output
$html = "<div id=\"$div_id\" $class >". $base_params['no_flash'] ."</div>\n";Replace with:
// Build Object
$html = "\n\t<div".$class.">\n";
$html .="\t\t<object id='".$div_id."' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='".$params['width']."' height='".$params['height']."'>\n";
$html .="\t\t\t<param name='movie' value='".$url."' />\n";
$html .="\t\t\t<!--[if !IE]>-->\n";
$html .="\t\t\t<object type='application/x-shockwave-flash' data='".$url."' width='".$params['width']."' height='".$params['height']."'>\n";
$html .="\t\t\t\t<!--<![endif]-->\n";
$html .="\t\t\t\t<p>". $base_params['no_flash'] ."</p>\n";
$html .="\t\t\t\t<!--[if !IE]>-->\n";
$html .="\t\t\t</object>\n\t";
$html .="\t\t<!--<![endif]-->\n";
$html .="\t\t</object>\n";
$html .="\t</div>\n";
Comments
#1
Changed to patch needs review status
#2
..and here is the patch file.
#3
The patch doesn't specify a file to patch properly, but if you simply tell it explicitly to patch swfobject_api.module it applies fine. I can confirm both the bug and that this patch fixes it.
Have I mentioned that this is a cool module? :-)
#4
I'm a little confused about this patch. If you look at step 3 in the wiki page referenced, you see that the swfobject.js file is actually doing the html replacement that is described above. The point of swfobject (at least, as far as I understand it) is to render the swf object after the page is loaded so that the page loads cleanly. The patch goes in the opposite direction hard coding the object into the page.
The point of the module is that it does a few things:
1) it let's you dynamically build the flash code with a simple theme function, basically mimicking:
<script type="text/javascript">swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
</script>
2) it includes the script call to the js library in the body of the page rather than the head to prevent issues with caching
So basically, it's just a compatibility layer for drupal.
Can i get some more information why you think this patch is needed? It could be that the base params isn't working right and that breaks in IE, but I don't think this fix is a good one.
#5
confirming this solved my issue with the flash not showing up on IE but it removed my flashvars
[edit]
upgrading to latest swfobject library worked better
[/edit]