Hi, I apologize if this is documented somewhere, but I couldn't find it.

How does one enable the use of the flash filter?

I copied the code on http://emspace.com.au/demo/swftools for various configurations, using all three different input types, and tried adding <swf> and <swflist> to the tags for filtered html. Am I missing something obvious?

All the php snippets worked fine that I tried.

Comments

DonTino’s picture

Haviong the exact same problem here

oxullo’s picture

Title: How to Configure Flash Filter? » input formats!

Did you checked the "SWF Tools Filter" option in your preferred input format?
Go to admin/settings/filters, choose, for example, "Filtered HTML" clicking on "Configure", then check it. In this way filter hook of the module will be fed of node contents and swf nodes will be interpolated.

BrianKlinger’s picture

I opened an issue very similar to this one and found out about this issue after the fact. My issue is still there but has a reference to this one.

Some things I've discovered after trying oxullo's suggestion:

A) Everything suddenly worked. The setting was already set, but for some reason it wasn't saving.
B) I realized after everything magically working that I'd ALSO changed my theme to a more basic one. Upon returning to my ORIGINAL theme (MyDrupal_Impact) everything broke again. Things also broke in niftyCorners. Not sure which other themes might be causing others problems.
C) I wanted to investigate, so I played with some settings, changed themes, and eventually got to a point where the filter broke in EVERY theme. This caused me to panic and search everywhere for what I'd done.
D) After lots of testing, I have not gotten to the bottom of the problem, but I know that after playing with my local cache (wiping it out, etc.), checking and unchecking the embedding settings -> Javascript Embedding 'All pages' box (sometimes things worked with it checked, sometimes it worked when it was unchecked), and setting the filter to allow tags, I can get everything working again. Something to do with certain combinations causes some things to work and other things not to work, and it never appeared to be consistent.

One thing I've noticed is that so far it appears that if you can get the right combination to make it work, then as long as you don't do any updating on that particular node or set it to a problematic theme, it continues to work.

And just so you know, I have only one line on my node... (I've also gotten it to work with , and even got it to work with two lines, one for the .swf and one for the .flv).

Hopefully that will help anyone else having trouble, and give some direction to anyone trying to fix the issue.

BrianKlinger’s picture

Sorry, I will use preview from now on... I wasn't thinking.

Originally my post above said...

...and setting the filter to allow <swf>tags, I can get everything working again....

and

...And just so you know, I have only one line on my node... <swf file="somefile.flv"> (I've also gotten it to work with <swf file="otherfile.swf">, and even got it to work with two lines, one for the .swf and one for the .flv).

Sorry for the silly newbie mistake.

sime’s picture

I am sorry I missed this thread.

I am not very good with filters, so this is an area of swftools that I must improve - and I will have to read up on debugging filters to do it properly. Here are the best tips I can offer for now:

  1. EITHER: order flash filter before the html filter, and allowing the object/emded/param tags as appropriate. (Works for me)
  2. OR. Allow the "swf" and "swflist" tags in the html filter and run swftools filter second. (I've had problems with this)
  3. When testing your filters, you should select "normal embedding" because it's confusing when you have javascript conflicts with other scripts (especially non jQuery scripts).
  4. Also, a filtered node body is cached. So to truly test each change, you should literally change something (add a space to the end of the body).

Hope this helps, I will keep an eye on the issue better from now.

devendra.ishaya’s picture

Category: task » bug

I'm impressed with the potential of this module, but I haven't been able to get it to work--even with all my input filters disabled.

What I'm noticing in the resulting page code is that the :// is getting escaped somehow. In the code snippet below, notice that

soundFile=http%3A/%252F

should be

soundFile=http://

<div class="swftools-wrapper onepixelout"><embed wmode="opaque" bgcolor="#FFFFFF" menu="false" play="true" loop="false" quality="autohigh" salign="tl" scale="showall" swliveconnect="default" version="7" base="http://localhost:8080/site.org/files" src_path="sites/all/modules/swftools/shared/1pixelout/player.swf" src="http://localhost:8080/site.org/sites/all/modules/swftools/shared/1pixelout/player.swf" flashvars="autostart=no&amp;loop=no&amp;soundFile=http%3A/%252Fwww.linux-foundation.org/gallery/modules/core/data/g2-unpossible.mp3" align="l" height="24" width="290"></div>

To prove that SWF Tools does actually work on my machine, I'll make the change by hand, save it as a .html file, and then it works as it should.

But for the life of me I can't figure out what I'm doing that it's replacing :// with %3A/%252F even though all my other filters have been disabled... So all of the suggestions about ordering filters or adding allowed tags isn't applicable in this case. And I've used the "normal embedding" with no help too.

Thanks for a great module, but do you have any more ideas?

behindthepage’s picture

I am having the same problem with embedding one pixel out as #6 however when I have unclean urls it works and the code is

soundFile=http%3A//

When I have clean urls it doesn't work and the code is

soundFile=http%3A/%252F

Hopefully this may shed some light on the source of the problem. Thanks for this excellent group of modules

Regards
gpdinoz

behindthepage’s picture

Adding
$encoded = str_replace('%252F', '/', $encoded);
to

function _swftools_get_flashvars_string(&$flashvars) {

  foreach ($flashvars AS $var => $value) {
    $flashvars[$var] = str_replace(array('&', '=', '?'), array('%26', '%3D', '%3F'), $value);
  }
  $encoded = drupal_query_string_encode($flashvars);

  // '#' seems to encode as %2523, reverse this, using a more robust hex prefix..
  $encoded = str_replace('%2523', '0x', $encoded);

  // '/' seems to encode as %252F, reverse this back to '/'
  $encoded = str_replace('%252F', '/', $encoded);

  return $encoded;

fixes this problem.

Now one pixel out works with both clean and unclean urls

Regards
gpdinoz

robloach’s picture

Status: Active » Needs review

Could this go into the CVS? It apparently fixes this issue too.

oxullo’s picture

JFYI, this problem has been propagated from this: http://cvs.drupal.org/viewvc.py/drupal/drupal/includes/common.inc?r1=1.6...
(updating drupal from 5.1 to 5.2 reveals the situation)

behindthepage’s picture

Thanks for that link, very interesting. I don't understand all the ramifications though. Is this something that needs to be fixed? Should it be fixed in core or in the swf module?

davea’s picture

Similar bug- same fix- in audio module

http://drupal.org/node/179439

hurben’s picture

I have also come across this problem, and while I could find and edit the source code for the audio module, I cannot find the code to change to get the 'onepixelout' player to work with 'swftools'. I have searched absolutely everywhere.. online and through all my files for an answer to this problem.

As above, I am receiving the error, 'Error opening file' - and the source reads: File=http%3A/%252F

Please tell me the file I need to edit. Post #8 above omits this necessary information.
Thankyou.

hurben’s picture

Ok. I found it.

The file is named 'swftools.module' and it's located in 'yoursite/modules/swftools/'

The edit is on line 656 for me.

headkit’s picture

this worked for me, too. thanx!

BUT
I also have a string "\x26" where a "&" should be placed in

...."flashvars": "backcolor=0x2C8DC9\x26frontcolor=0xffffff\x26lightcolor=0xCDE3F1....

and

  // '&' seems to encode as \x26, reverse this back to '&'
  #$encoded = str_replace('\x26', '&', $encoded);

is not working - why?

Leeteq’s picture

To BrianJubal in comment #3:

This is a very practical scenario to be aware of in several situations. Thanks so much for sharing it so elaboratively :-)

goose2000’s picture

Can someone send a complete .module for this. I can not get any of this to work. I did the hack, and now my file var look clean but nothing will play. Yes the is in place, besides SWFtools checks that as well.

using the .dev version on drupal 5.5

thanks for help...

8(

EDIT

here is what happens to my file var - all other charcters seems to be fine:

file=http%3A//111.1.11.11%3A8080/files/dean.flv

So, for me only the colon part is not correct. I tried str_replace hack but it is not making any difference like im not getting a match.

ie - $encoded = str_replace('%3A', ':', $encoded);

DonTino’s picture

Status: Needs review » Active

same problem here as goose 2000

ChrisBryant’s picture

@#8: It was recommended by omo on a comment (http://drupal.org/node/181998#comment-882293) to use this for the patch instead:

"You better add a more generic fix; This solves the issue even if 'swftools_media_url' is set in settings.php:"

  $encoded = str_replace('%3A', ':', $encoded);
  $encoded = str_replace('%252F', '/', $encoded);
Stuart Greenfield’s picture

Status: Active » Needs review

Fixes for the above issues are built in to a new 5.x-1.x-dev release and is ready for testing. The new package will be available when the packaging scripts next run.

The encoding error is fixed, which should help with player modules.

This thread actually started with reports of issues getting the <swf > filter to work. The new dev package has been modified so the filter should be much easier to configure. Just activate it, and make sure it is weighted heavier than any HTML filters. It shouldn't be necessary to allow the <swf > tag in other filters, or to have to permit object or embed.

Stuart Greenfield’s picture

Status: Needs review » Fixed

Setting to fixed as new releases of SWF Tools 5.x-2.0 and SWF Tools 6.x-1.1 are now available which address this issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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