Embed multimedia objects such as Flash or QuickTime in topics.
Uses the OBJECT html tag to embed arbitrary content into a page, with a particular bent towards media: common media formats are detected and some "agnostic best-guess" html is used (derived from that recommended by
the plugin providers).
However, any content can be embedded using the object tag: java, pdf, other html, svg, even images (although for the latter is of course no real reason to do so this way).
The plugin uses generic syntax when it cannot detect the type of file being embedded.
The plugin stores a range of default values (defined here on this page)
which allow you to specify a bare minimum of info in your markup and still
get acceptable results (see Basic Usage below).
These defaults can of course be overridden on a use-by-use basis.
This will detect that the embedded file is a QuickTime and use "media-like" syntax (and pass the correct classid to IE - why it can't work out which plugin to use is a little beyond me). However, unlike an IMG tag, plugins do not autosize to their content, and the movie would display at the default size. You could use media of only one size site-wide and specify the dimensions as defaults, but realistically the minimum markup you need to embed things into your wiki pages is:
%MEDIA{"SomeMovie.swf" width="320" height="180"}%
Advanced Usage
A call to the MediaPlugin could get as complicated as:
See for possible attributes below.
Note that MediaPlugin figures out the correct mime type parameter so that the correct plugin will be called to deal with that content.
Syntax
MediaPlugin supports arbitrary parameters. If you pass it cowtype="Jersey", it will passed on to the browser.
A few parameters are defined and get handled a little differently (they may be "translated" to a particular browser plugins syntax).
Pass Flash movie attributes within the %MEDIA{...}% accolades (all values within quotes). When a particular parameter is not specified, the default value will be used (see table below).
Filepath of the movie; should have suffix .swf ("src=" can be omitted)
mypath/flashmovie.swf
General attributes
width
Width of Flash movie in pixels, or a percentage. 100% means one hundred percent of the available width on the page.
"50%" or "500px"
height
Height of Flash movie in pixels, or a percentage. 100% means one hundred percent of the available height on the page.
"50%" or "500px"
bgcolor
Background color of Flash movie in hex string. When omitted, no background color will be specified and the background color of the Flash movie will be used.
"#cccccc"
Advanced attributes
align
Default centers the movie in the browser window and crops edges if the browser window is smaller than the movie. l (left), r (right), t (top), and b (bottom) align the movie along the corresponding edge of the browser window and crop the remaining three sides as needed.
"l", "r", "t", "b"
salign
l, r, t, and b align the movie along the left, right, top or bottom edge, respectively, of the browser window and crop the remaining three sides as needed. tl and tr align the movie to the top left and top right corner, respectively, of the browser window and crop the bottom and remaining right or left side as needed. bl and br align the movie to the bottom left and bottom right corner, respectively, of the browser window and crop the top and remaining right or left side as needed.
Should right-click on Flash movie show a (default) menu? Note that with the Flash 7 player the menu cannot be removed.
"true" or "false"
id
ID of Flash movie; should be the same value as name (specify both)
"movie2"
wmode
Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. window - movie plays in its own rectangular window on a web page. opaque - the movie hides everything on the page behind it. transparent - the background of the HTML page shows through all transparent portions of the movie, this may slow animation performance.
"window", "opaque" or "transparent"
play
Specifies whether the movie begins playing immediately on loading in the browser.
"true" or "false"
loop
Specifies whether the movie repeats indefinitely or stops when it reaches the last frame.
"true" or "false"
allowscriptaccess
Controls the ability to perform outbound scripting from within a Flash SWF. When allowScriptAccess is never, outbound scripting always fails. When allowScriptAccess is always, outbound scripting always succeeds. If allowScriptAccess is sameDomain (it is supported in SWFs from Flash Player 8), outbound scripting is allowed only if the SWF file resides in the same domain as the hosting web page.
"sameDomain", "always" or "never"
fullscreen
Enabled scriptable fullscreen mode. An overlay dialog box will appear when the movie enters full-screen mode, instructing the user how to exit and return to normal mode. The dialog box appears for a few seconds and then fades out.
"true" or "false"
base
Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files.
any directory URL, or empty string ""
swliveconnect
Specifies whether the browser should start Java when loading the Flash Player for the first time.
"true" or "false"
flashvars
Variables to be passed to the Flash movie. Multiple variables are separated by &.
generates:
By default the controller is shown (unless attribute controller="false"), and the controller height (16px) is automatically added to the movie height.
Detection of media type / recommended plugin syntax
The plugin detects most media types and uses a hybrid of the html markup
recommended by the browser plugin makers - in the hope of providing maximum compatibility.
This is done simply by checking the extension of the filename. Or, if the filename contains youtube.com it will automatically use Flash.
Originally, the plugin used (almost) the exact recommended HTML on a type-by-type basis, but I've abandoned this in favor of "one markup fits all" because you don't know which plugin will be handling what - the various ISO formats (MPEG1,2,4, MP3) will be taken by whatever plugin was installed last, and QuickTime now handles Windows Media on Macintosh systems (at Microsoft's recommendation!).
While most of the HTML is as generic as possible, the classid value and some
other mime-type information is unique to a particular file-type, and for Flash,
QuickTime and Windows Media the Microsoft-sanctioned values are sent.
I understand MSIE has to have this info or it totally burns ...
I haven't bothered with Real. If there's huge demand, it wouldn't be hard to add - but it may also be handled quite well by the generic media syntax already.
Defining additional file formats
The output of this plugin is partially governed by Foswiki templates. The mov file output is defined in templates/objectplugin_mov.tmpl:
Placeholders {MP_...} are replaced by %MEDIA{...}% parameters.
To add other types add your own template using the same naming scheme (objectplugin_ext.tmpl).
Switch that defines if the media is played automatically
1
{Debug}
If set to 1, writes debugging info to data/debug.txt
0
Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
1.3.4 Arthur Clemens: Fixed an issue where the filetype was not read if it was appended with a query string. Fixes a bug where default attributes read from the tmpl could not be overridden. Added audio examples.
13 Sep 2009
1.3.3 Arthur Clemens: small refactoring; moved default settings to Configure.
22 Jun 2009
1.3.2 Arthur Clemens: Fixed call to unreleased internal function openAttachment.
20 Jun 2009
1.3.1: Arthur Clemens: Fixes media type lookup. For performance, plugin settings must now be done in SitePreferences.
08 Mar 2009
1.3: Mime types are now automatically added, so it is easier to get the browser call the right browser plugin.
08 Mar 2009
1.2: Integrated EmbedFlashPlugin; major code refactoring.