Extension talk:Flash swf

From MediaWiki.org
Jump to: navigation, search

Contents

[edit] SWFObject?

It might be a little more complicated to install, but why not make a version that uses SWFObject? It's by far the best way to embed SWFs these days and it gets around the EOLAS click to activate problem in IE. The code is also W3C.org compliant and works well in every browser I've tested it in.

[edit] problem

I've got the Extension Flash swf working but for some reason I can't get the height and width arguments to work. No matter what the size of my swf is it always appears at 550 x 400.

Any idea why?

[edit] not working

I get this all the time "No path for internal Media"

try the patch for Mediawiki 1.11 below, I had the same problem 130.83.196.179 11:48, 15 January 2008 (UTC)

how do you set up wiki to allow uploads of swf in nice way.

[edit] Repeating

Is there a way to get the swf file to automatically repeat?

[edit] Good News works in v1.15!

I was really pleased that this works well in my new installation. But I have a small problem and cannot find a solution anywhere! I want to place a sample.swf in the sidebar. I can get an animated gif to work but not the swf. The string that gets the .gif to work is

{{filepath:sample.gif}}

but when I use

{{filepath:<swf width="155" height="150">Slide.swf</swf>}}

it does not work. It seems I am forced to use the filepath command. Please help!

[edit] Patch for Mediawiki 1.11

In order for this extension to work with Mediawiki 1.11.0, I had to change the following lines:

OLD:

$img->load();
if ( ! $img->imagePath ) return "No path for internal Media:$input";
$dir = dirname($_SERVER['SCRIPT_FILENAME']);
$url = str_replace($dir, $wgScriptPath, $img->imagePath );

NEW:

$img->load();
if ( ! $img->getUrl() ) return "No path for internal Media:$input";
$dir = dirname($_SERVER['SCRIPT_FILENAME']);
$url = str_replace($dir, $wgScriptPath, $img->getUrl() );

[edit] Patch for Mediawiki 1.7.1

if ( ! $img->getUrl() ) return "No path for internal Media:$input";
$url = $img->getViewURL(false);

[edit] Patch for extra Flash parameters

This code allows you to specify extra parameters to the Flash player, for example "base" or "flashVars" (used by Camtasia).

 *** /home/wiki/backup/FlashSwf.php      2008-12-28 17:23:46.000000000 +0100
 --- FlashSwf.php        2008-12-28 17:23:51.000000000 +0100
 ***************
 *** 81,86 ****
 --- 81,95 ----
                 $divHeight= "height:$height"."px";
         }
 
 +       $paramKeys = array_diff(array_keys($argv),array('width','height'));
 +       $paramLine = "";
 +       $paramInline = "";
 +       foreach ($paramKeys as $key) {
 +               $paramLine .= '<param name="'.trim($key).'" value="'.$argv[$key].'" />';
 +               $paramInline .= " ".$key.'="'.$argv[$key].'"';
 +       }
 + 
         $id = basename($input, ".swf");
         $output  .=<<<EOM
   <!-- display a swf -->
 ***************
 *** 94,102 ****
 --- 103,113 ----
   <param name="movie" value="$url" />
   <param name="quality" value="high" />
   <param name="bgcolor" value="#ffffff" />
 + $paramLine
   <embed src="$url" quality="high" bgcolor="#ffffff"
            width="$width" height="$height"
            name="$id" align="middle" allowScriptAccess="sameDomain"
 +          $paramInline
            type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
   </object>
   </div>

[edit] Repeating video

Using my patch, just add "loop=true" parameter

Ivan Pepelnjak 16:41, 28 December 2008 (UTC)

[edit] Patch: trimming the URL

If you use multi-line SWF tag, you might get extra whitespace in front of the Flash movie URL. The code recognizing internal/external SWF file is pretty simplistic and expects "http" at the beginning of the string; whitespace breaks that. This patch fixes the problem by adding an extra trim call.

 ***************
 *** 40,46 ****
 
         #parse fields in flashow-section
         $fields = explode("|",$input);
 !       $input = $fields[0];
 
         //added functionality for parameters passed within the tag's body
         //<swf>movie.swf|width=200|height=300|loop=false</swf>
 --- 40,46 ----
 
         #parse fields in flashow-section
         $fields = explode("|",$input);
 !       $input = trim($fields[0]);
 
         //added functionality for parameters passed within the tag's body
         //<swf>movie.swf|width=200|height=300|loop=false</swf>

Ivan Pepelnjak 16:40, 28 December 2008 (UTC)

[edit] View source does not work

We're using this in a 1.11.1 MediaWiki install. The Flash .swf file displays fine, but if it contains source, this extension does not handle it correctly. We get <mediawikiurl>/Srcview/index.html which MediaWiki interprets as a page request. In this case, the .swf was accessed by a full URL (it was not uploaded into MediaWiki), i.e.

<swf>http://..../chart.swf</swf>

Are there options to enable source to work correctly? --DavidBiesack 19:49, 23 February 2009 (UTC)

[edit] Fullscreen

Works fine but it does not do full screen

You will have to edit the php file and add these two param tags:
<param name="menu" value="true" />
<param name="allowFullScreen" value="true" />
--Michael Alabastro
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox