Forgive me if I'm wrong, but on browsing the module's code, it seems that the flash-related html is placed straight into the page.

For various reasons, it should be embedded using javascript, are you aware of this tool?
http://www.osflash.org/swfobject (formerly FlashObject)

I've marked this as critical, because new versions of IE will not display flash by default.

CommentFileSizeAuthor
#4 flash_filter.diff3.27 KBarthurf

Comments

tomsys’s picture

Assigned: Unassigned » tomsys
Priority: Critical » Normal

Hi Sime,

I'll look into your proposal .. initially I'm was planning to live without JavaScript at all but now when MS has this click "thing" for a few month .. I'll be forced to use it anyway .. to make it look nice ..

Thank's for your valueable suggestion,
T.

owen barton’s picture

I would vote for SWFObject too. It is small (6KB) and seems very well thought out. It's also used by YouTube, which seems to be a strong indication of it's stability!
There are, of course other (more hacky) fixes like http://www.hoeben.net/node/135 - but these seem to have side affects in some cases.

sime’s picture

Yeah, it's certainly an issue I would rather didn't exist. Thanks for considering the suggestion.

arthurf’s picture

StatusFileSize
new3.27 KB

Ok, I did this with swfobject (swfobject). I added the swfobject.js file to the flash_filter module directory

at the top of flash_filter, added this:

drupal_add_js(drupal_get_path('module','flash_filter') . "/swfobject.js");

in function theme_flash_filter_as_movie changed the $html output to be this:

 $html = "<div id='flashcontent'></div>";
  $html .= "<script>var so = new SWFObject('". $file_path . "', 'movie', '". $params['width'] ."','" . $params['height'] ."','" . str_replace('.swf', '', $file_path). "'); so.write('flashcontent');</script>";

I attached a diff here as well

arthurf’s picture

Alternatively, I just created the swfobject.module. You can download it here. This allows a developer to simply do this:

print create_swfobject($url, $params);

The flash_filter module could support this simply by doing this in the theme_flash_filter_as_movie function:

    // override if swfobject exists
    if (module_exist("swfobject")) {
    	$html = create_swfobject($file_path, $params);
    }
    
    return $html;
hectorplus’s picture

I installed the FlashObject in my directory where drupal is, i added the javascript and css in the head of my page.tpl.php, then i created a page and included the script privided by FlashObject, but it doesnt show the flash file. I even added the script tag in my valid input types. No success, the FlashObject module is kinda confusing. I rather jsut install the FlashObject library. Anyone has done it?
Thanks.

sime’s picture

Status: Active » Fixed

This is "not fixed" for 4.7. The upgrade path to SWF Tools includes script replacement support.

dries’s picture

Status: Fixed » Closed (fixed)