Hi

Im trying to embed flash into drupal for the first time. I am using SQF Tools and SWF Object (5.x-1.1).

When i embed the file into a block using php:

<?php  
print swf("PCS.FLV", array("height"=>100, "width"=>400)); 
?>

I get a blank div displayed. viewing source reveals this:

<div class="swftools-wrapper generic-flv "><div id="swfobject-id-12119299241" class="swftools swfobject" swftools='{ "wmode": "opaque", "bgcolor": "#FFFFFF", "menu": "false", "play": "false", "loop": "false", "quality": "autohigh", "align": "l", "salign": "tl", "scale": "showall", "swliveconnect": "default", "version": "7", "height": 100, "width": 400, "base": "files/pcs/flash/", "src_path": "sites/all/modules/swftools/shared/generic/generic_flv.swf", "src": "http://pcs.local/sites/all/modules/swftools/shared/generic/generic_flv.swf", "flashvars": "autostart=false\x26file_url=files/pcs/flash/%252FPCS.FLV\x26width=400\x26height=100" }' >

As you can see a "%" and a "/" are added to the url. (%25 and 2F)

I tried embedding using html (with swf filter enabled) but i get "Flash is not available" displayed in my block.

Any help here would be appreciated, embedding flash is turning out to be a real headache.

Comments

UnicornSong’s picture

just something else to add (digging deeper)

i have in my settings.php:

$conf = array(
    'swftools_media_url' => 'files/pcs/flash', 
 );

if i change this value to

$conf = array(
    'swftools_media_url' => 'files/pcs', 
 );

then my url becomes file_url=files/pcs/%252Fflash/PCS.FLV

which indicates to me that something is going wrong with this code in settings.php or how it is translated somewhere along the line.

ChrisBryant’s picture

Status: Active » Closed (duplicate)

We had a similar problem and this comment should do the trick for you:

http://drupal.org/node/154364#comment-573474

Basically a small patch to the swftools.module (line 656) fixes the encoding: