I read this thread on the javascript "stop" code which will stop the 1pixelout player if another one on the same page starts to play.

I am trying to implement this on a page.tpl.php but I am stumped how to retreive the playerID.

I have the following:

print swf($node->field_audio_reading[0]['filepath'],
                 array(
                    'params' => array('width' => '400px', 'wmode' => 'transparent'),
                    'flashvars' => array('playerID' => $item->id),
                 )
            );

But I cannot work out how to call the equivalent of $item->id for access the swf object like I am.

Am I going about access the data from the swf object in the wrong way?

Comments

davebv’s picture

I think, with the latest version, if the players are in the same page, nothing has to be done but to use swfobject2 embed method. And then,, playing one of them stops the others. So no extra-code is required, just use swfobject2.

andrewsuth’s picture

You're spot on. I installed SWFObject2 and printed the swfplayer using:

print $node->field_audio_reading[0]['view'];

..and everything worked as described.

Thanks for your feedback.

davebv’s picture

you're welcome. And thanks to Stuart who ported and improved a lot the js code I proposed the first time.

ron williams’s picture

Status: Active » Closed (fixed)