In case the browser has no flash player installed, this module outputs a "No flash detected" error message. This message is "Sorry, you need to install flash to see this content." by default.

As indicated in the module readme.txt, this module supports overriding of this message, using the 'no_flash' parameter key.
Unfortunately, overriding does not work.

It seems that the reason is that the wrong parameter is used in the theme_swfobject_api function: the default settings are used instead of the settings coming from the function parameters.

CommentFileSizeAuthor
#1 SWFObject_API-issue257043-patch1.patch455 bytesSebo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sebo’s picture

Status: Active » Needs review
FileSize
455 bytes

Here is a patch that fixes this issue.

--- swfobject_api.module	2008-05-10 23:53:50.823750000 +0200
+++ swfobject_api.module.fixed	2008-05-10 23:53:19.464375000 +0200
@@ -183,7 +183,7 @@ function theme_swfobject_api($url, $para
   $id_count ++; 
   
   // create the html output
-  $html  = "<div  id=\"$div_id\"  $class >". $base_params['no_flash'] ."</div>\n";
+  $html  = "<div  id=\"$div_id\"  $class >". $params['no_flash'] ."</div>\n";
   
   return $html;
 }
\ No newline at end of file
arthurf’s picture

Ah, I guess this one didn't make it into the 2.0 fixes. I added this and the search fix from #257076 to DRUPAL-5--2, let me know if that works for you.

arthurf’s picture

Status: Needs review » Postponed (maintainer needs more info)
Sebo’s picture

I've tried the DRUPAL-5--2 swfobject_api.module file you propose, but it seems there has been a lot of changes since the 2.0 Beta1 I am using, and I cannot see my flash app anymore...
=> good news: the error message is properly overriden (so your fix regarding this post is functional :-) )
=> bad news for me, I may need to changes other files for this new revision to work properly?

I have also tried with the DRUPAL-5 version of this file, and I have the exact same behavior...

I have 2 questions:
- I am wondering if the file version number is correct for the swfobject_api.module file:
in DRUPAL-5 version: 1.2.2.19
in DRUPAL-5--2 version: 1.2.2.8.2.1 ???? (it is a different branch?)
(I am using the last released module: 2.0 Beta 1, version: 1.2.2.9)
- Are there some other changes I need to make to use the latest CVS revision (either DRUPAL-5 or DRUPAL-5--2), compared to the Beta 1 release? (swfobject.js, ... ?)

Thanks for your help,
Seb

arthurf’s picture

Yes, DRUPAL-5--2 is a different branch- it's for swfobject api 2.0. Are you using this? Are you seeing JS errors, and if so, what are you seeing?

Sebo’s picture

Yes, I am using the 2.0 branch (I use the archive available on the module page called 2.0 Beta 1).

The problem is that with this version of swfobject_api, I do not see my flash player anymore! Instead I see the string saying that I need to install flash.

I am not used to debug JS. By running firebug, I can see an error reported in the console:
syntax error
[Break on this error] so1.write("flashcontent_mediaplayer_1"); -->

It corresponds to the code embedded where the flash player should display.

The whole code generated by swfobject_api is the following:

<div id="flashcontent_mediaplayer_1" >Pas de lecteur flash disponible! Vous pouvez en installer un sur <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">ce site.</a></div>
<script type="text/javascript" src="/og/sites/all/modules/community/swfobject_api/swfobject.js"></script><script type="text/javascript"><!-- var so1 = new SWFObject('/og/sites/all/modules/community/swfobject_api/mediaplayer.swf', 'swf_mediaplayer_1', '500', '200', '5', '#FFFFFF');
 so1.addParam('type', 'movie');
 so1.addVariable('file', "/og/files/playlists/07151fad9eff8da258e2e44d6844587d.xml");
 so1.addVariable('image', "/og/themes/garland/files/image.jpg");
 so1.addVariable('screencolor', 16746496);
 so1.addVariable('displayheight', 0);
 so1.addVariable('thumbsinplaylist', false);
 so1.addVariable('autoscroll', true);
so1.write("flashcontent_mediaplayer_1"); --></script><br/><a href="/og/node/add/audio?gids[]=38&amp;edit[field_associated_repet][0][node_name]=1er Mai et à bosser les morceaux!&amp;destination=node%2F45">&lt;&lt; Ajouter un nouveau titre &gt;&gt;</a><div class='view view-audio-by-repet'><div class='view-content view-content-audio-by-repet'><table>

(The sentence "Pas de lecteur flash..." is my replacement for "Sorry, you need to install flash to see this content.".)

Sebo’s picture

For information, I have replaced the 2.0Beta swfobject_api module by the 1.2-15 revision (last official release available in download, using swfobject 1.5), and everything works fine: my flash player displays properly. There may have been a regression in recent evolutions of the 2.0 branch?