Adobe error after first flv video

147 Views Asked by At

I'm using php, javascript, and html/css to display flv files on a tooltip. It works fine however after the first flv, the others appear to have the "This content requires the Adobe Flash Player." message.

The PHP:

$tooltip .= "
    <script type=\"text/javascript\">
        var playervars = {
            contentpath: '',
            video: \"$url\",
            preview: \"demo-preview.jpg\",
            skin: \"skin-applestyle.swf\",
            skincolor: \"0x2c8cbd\"
            // ...
            //see documentation for all the parameters
        };
        var params = { scale: \"scale\", allowfullscreen: \"true\", salign: \"tl\", bgcolor: \"#ffffff\", play: \"true\" };
        var attributes = { align: \"left\", base: \".\" };

        swfobject.embedSWF(\"../media/flvplayer/flvplayer.swf\", \"videoCanvas\", \"256\", \"210\", \"9.0.28\", \"../flvplayer/expressInstall.swf\", playervars, params, attributes);
    </script>

    <div id=\"videoCanvas\" style=\"margin:0px;visbility:visible;\">
        <p>This content requires the Adobe Flash Player.</p>
        <p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a>
        </p>
    </div>
";

The HTML:

<div class="thetooltip"><img src="/images/icon.png" alt="questions" width="12" height="12" border="0" />
    <span>
        <?php echo $tooltip; ?>
    </span>
</div>

I am using the method of pure css for tooltips, the span is the video showing on a tooltip.

As I said the first tooltip pops up and plays the video perfectly, every flv after that displays the adobe error.

1

There are 1 best solutions below

0
On

Are you still having this issue? Here's what I found.

According to some of the documentation here http://code.google.com/p/swfobject/wiki/documentation , in this line:

swfobject.embedSWF(\"../media/flvplayer/flvplayer.swf\", \"videoCanvas\", \"256\", \"210\", \"9.0.28\", \"../flvplayer/expressInstall.swf\", playervars, params, attributes);

The \"videoCanvas\" part refers to the ID of the object you want to replace with the video. When you do the first tooltip, the <div id=\"videoCanvas\" is created on the page. But, I suspect that perhaps it's not being destroyed when the tooltip goes away. So that when the next one tries to load, there is now more than one div with the id=videoCanvas in the document. The ID's need to be unique, or the div needs to be completely removed from the document after the tooltip closes.