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.
Basic Usage
You
could call the plugin as simply as:
%MEDIA{"SomeMovie.mov"}%
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:
%MEDIA{
src="SomeMovie.wmv"
width="320"
height="180"
controller="FALSE"
play="TRUE"
myparam1="3.1419"
myparam2="edinburgh"
}%
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).
Parameter |
Value |
Description |
Notes |
"" , src , data |
URI or file name |
The content to embed. Relative URIs are interpreted with respect to the codebase attribute if it is given. |
|
width |
Standard web measure (px, %, em) |
Width of box holding content |
|
height |
Standard web measure (px, %, em) |
Height of box holding content |
|
controller |
text boolean ("TRUE" or "FALSE") |
Whether to display controls |
automatically added |
play |
text boolean |
whether to auto-play the content |
Automatically added for QuickTime and Flash |
Syntax for QuickTime mov
See
Overview of Embed Tag Attributes for QuickTime.
Syntax for Flash swf
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).
More information on
Flash OBJECT and EMBED tag attributes (Adobe TechNote).
Syntax for generic objects
The attributes described at Syntax above is mostly all you need. For advanced usage see the table below.
Syntax for wmv
Sorry - I could not find any page for this.
Examples
wmv
%MEDIA{
"http://support.microsoft.com/support/mediaplayer/wmptest/samples/new/mediaexample.wmv"
height="240"
width="320"
}%
generates:
%MEDIA{
"http://support.microsoft.com/support/mediaplayer/wmptest/samples/new/mediaexample.wmv"
height="240"
width="320"
}%
mov
%MEDIA{
"%ATTACHURL%/sample.mov"
height="180"
width="320"
}%
generates:
%MEDIA{
"http://365847.689093.cn/pub/Extensions/MediaPlugin/sample.mov"
height="180"
width="320"
}%
By default the controller is shown (unless attribute
controller="false"
), and the controller height (16px) is automatically added to the movie height.
swf
%MEDIA{
"%ATTACHURL%/sample.swf"
height="180"
width="320"
}%
generates:
%MEDIA{
"http://365847.689093.cn/pub/Extensions/MediaPlugin/sample.swf"
height="180"
width="320"
}%
swf with params
These are just a number of example parameters; not all are effective in this movie.
%MEDIA{
src="%ATTACHURL%/swf/ThumbController.swf"
width="430"
height="370"
bgcolor="#ffffff"
menu="false"
base="%ATTACHURL%/swf/"
}%
generates:
%MEDIA{
src="http://365847.689093.cn/pub/Extensions/MediaPlugin/swf/ThumbController.swf"
width="430"
height="370"
bgcolor="#ffffff"
menu="false"
base="http://365847.689093.cn/pub/Extensions/MediaPlugin/swf/"
}%
Flash from other sites
Yahoo Maps in Flash
%MEDIA{
"http://developer.yahoo.com/maps/flash/V3.5/asGS.01.swf"
base="http://developer.yahoo.com/maps/flash/V3.5/"
width="600px"
height="400px"
}%
%MEDIA{
"http://developer.yahoo.com/maps/flash/V3.5/asGS.01.swf"
base="http://developer.yahoo.com/maps/flash/V3.5/"
width="600px"
height="400px"
}%
pdf
%MEDIA{
"http://www.pdf-tools.com/public/downloads/whitepapers/whitepaper-pdfprimer.pdf"
width="100%"
height="100%"
}%
generates:
%MEDIA{
"http://www.pdf-tools.com/public/downloads/whitepapers/whitepaper-pdfprimer.pdf"
width="100%"
height="100%"
}%
mp3
%MEDIA{
"%ATTACHURL%/test.mp3"
play="false"
autoplay="false"
height="20"
}%
generates:
%MEDIA{
"http://365847.689093.cn/pub/Extensions/MediaPlugin/test.mp3"
play="false"
autoplay="false"
height="20"
}%
wav
%MEDIA{
"%ATTACHURL%/test.wav"
play="false"
autoplay="false"
height="20"
}%
generates:
%MEDIA{
"http://365847.689093.cn/pub/Extensions/MediaPlugin/test.wav"
play="false"
autoplay="false"
height="20"
}%
midi
%MEDIA{
"%ATTACHURL%/test.mid"
play="false"
autoplay="false"
height="20"
}%
generates:
%MEDIA{
"http://365847.689093.cn/pub/Extensions/MediaPlugin/test.mid"
play="false"
autoplay="false"
height="20"
}%
Notes for developers
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.
The output of this plugin is partially governed by Foswiki templates. The
mov
file output is defined in
templates/objectplugin_mov.tmpl
:
%TMPL:DEF{"object"}%<object{MP_OBJECT_ATTRIBUTES}>{MP_OBJECT_PARAMS}<embed{MP_EMBED_ATTRIBUTES}/></object>%TMPL:END%
Placeholders
{MP_...}
are replaced by
%MEDIA{...}%
parameters.
To add other types add your own template using the same naming scheme (
objectplugin_ext.tmpl
).
Plugin Settings
Change default settings in
configure.
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.
Plugin Info
Plugin Authors: |
TWiki:Main.PiersGoodhew, Foswiki:Main.SvenDowideit, Foswiki:Main.ArthurClemens |
Copyright: |
© 2006 TWiki:Main.PiersGoodhew, 2008-2009 Foswiki:Main.SvenDowideit, Foswiki:Main.ArthurClemens |
License: |
GPL (Gnu General Public License) |
Version: |
12678 (2011-10-01) |
Release: |
1.3.4 |
Change History: |
|
01 Oct 2011 |
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. |
03 Mar 2009 |
ObjectPlugin renamed to MediaPlugin |
20 Feb 2009 |
Ported to Foswiki |
20 Oct 2008 |
Modernise with Foswiki:Extensions.BuildContrib, add EMBED Tag, remove WikiWord issues, templatise html output, add YouTube supprt - Foswiki:Main.SvenDowideit |
16 Oct 2006 |
Initial version |
Change History: |
|
Dependencies: |
None |
Plugin Home: |
http://foswiki.org/Extensions/MediaPlugin |
Support: |
http://foswiki.org/Support/MediaPlugin |