drupal: inserting flash content (youtube videos) fails to display in IE

One of the drupal web sites I work on had a problem where any youtube video that was posted to the site failed to display on internet explorer. Any other browser worked fine.

The code we were trying to insert was this:

<object height="350" width="425" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
<param name="src" value="http://www.youtube.com/v/l0aVaRrBYQE" />
<embed height="350" width="425" src="http://www.youtube.com/v/l0aVaRrBYQE" type="application/x-shockwave-flash">

One of the mystifying parts of it all was that if you just used that code in a HTML page all by itself, IE could display the youtube video fine. So drupal was doing something mysterious that changed things.

It turns out that for *some reason*, drupal’s default HTML filter, even when configured to allow object and param tags would munge the classid attribute slightly, changing it from




After many fruitless attempts at stopping this behaviour (hacking tinymce javascript, the tinymce module, the input filter module, etc etc) I fell back on the tried and true behaviour of just working around the problem, which came to:

  1. install wysiwyg filter module
  2. disable the built in html filter and turn on the new wysiwyg filter
  3. configure new filter to remove the classid attribute from object tags entirely. Something like this in the ‘allowed tags’ textarea: “object[codebase|width|height]”. Apparantly IE doesn’t even need it.

Leave a Reply

Your email address will not be published.