When I changed from using the Direct embedding method to SWFObject2 with 1pixelout I found that the HTML markup after the player was being altered, due to an additional </div> being added.

I was marking up the output of the Direct embedding 1pixelout player like this:
<div id="audio-player-0" class="lesson-audio-reading"><?php print $node->field_audio_reading[0]['view']; ?></div>

But in the case of SWFObject2 I had to change it to the following in order for it not to break my HTML:
<div id="audio-player-0" class="lesson-audio-reading"><?php print $node->field_audio_reading[0]['view']; ?>

This has led me to think that the SWFObject2 is adding an unnecessary </div> after the player is displayed.

I have attached 3 images from Firebug to show the difference in the HTML:

1. Without SWFTools being used on the site - HTML OK
2. Using SWF Tools Direct embedding method - HTML OK
3. Using SWF Tools with SWFObject 2 - HTML NOK

I am using 1pixelout and don't know if this effects other players.

Comments

andrewsuth’s picture

Title: SWFObject2 adds unnecessary </div>, breaking HTML markup. » SWFObject2 does not output 2 x </div>, breaking HTML markup.

I spoke too soon: the problem is that it is not adding enough </div>'s, which is breaking the HTML markup.

In order to avoid the markup issue, I need to output the following:

<div id="audio-player-0" class="lesson-audio-reading"><?php print $node->field_audio_reading[0]['view']; ?></div></div></div>
(2 additional </div>'s after the player)

This way my HTML remains intact.

Stuart Greenfield’s picture

Status: Active » Fixed

Tested on DRUPAL-6--3 and seems ok now. Tried OnePixel + SWF Object 2 and code is valid.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.