History: PluginMediaPlayer
Preview of version: 71
Plugin Media Player
Introduced in Tiki3, and extended in Tiki6 with JQuery#Media
This Wiki Plugins can be used in wiki pages or any other wiki-syntax enabled feature to play a FLV or MP3 file, or any other type of media file since Tiki6, like MP4, SWF, AVI, |WMV, RAM, MOV, MPEG, PDF, ... It calls on a flash based open source media player to play them or (since Tiki 12.2) one can use native HTML5 player.
Table of contents
Details
This plugin adds a simple media player in a page. The player is not required (it is called from the web if it is not available locally).
The players used can be one of the following:
http://flash-mp3-player.net (the default mp3 player)
http://flv-player.net (the default flv player)
Alternate players:
http://code.google.com/p/mp3player
http://code.google.com/p/flvplayer/
Native HTML5 Audio/Video player (e.g. to play .webm files) of your browser (since Tiki 12.2)
If you prefer the Flash player you can download the player itself (an .swf file) from http://flash-mp3-player.net or http://flv-player.net or http://code.google.com/p/mp3player or http://code.google.com/p/flvplayer/. If you do, you will need to edit the plugin (at lib/wiki-plugins/wikiplugin_mediaplayer.php) and change the default source in the plugin code or add it as a "where" parameter in that instance of the plugin.
Troubleshooting
- Make sure you have enabled jQuery Media feature if you are not using mp3 or flv file (using the src param)
- If the player still doesn't appear, you probably got one of the plugin parameters wrong.
- If the player appears but won't play, you probably got the wrong URL to the file.
If you do not use the native (HTML5) mode the mediaplayer is not responsive. So fixed width of the player even in a responsive page. You need to think about a workaround if you design for mobile aswell.
... to show a video in a different sized player e.g. 800 px width instead of default, do not use % or px ... this seems to work with pdf, but not with video
This code worked on a Tiki pre-14r trunk:
{mediaplayer flv="http://example.com/display18", type="flv" width=800, height=600}
Syntax Examples
MP3 Examples
For files in the file gallery:
{mediaplayer mp3="display10"} {mediaplayer mp3="tiki-download_file.php?fileId=389"}
Using actual file path:
{mediaplayer mp3="http://usuaris.tinet.org/mikell/EntrevistaRadio4.mp3"} {mediaplayer mp3="http://usuaris.tinet.org/mikell/EntrevistaRadio4.mp3", style="mini"} {mediaplayer mp3="/test.mp3", loop="1"}
For files uploaded to the file gallery but stored on the server, the actual file path can also be used. Tiki converts file names to hash values for storage on the server - this name can be found in the database.
FLV files
Use the flv and type parameters to show flv files as shown below:
File gallery flv file:
{mediaplayer flv="http://example.com/display10" type="flv"}
Otherwise upload the file to a directory on your server and use the direct file path. If the file has the .flv extension, then the type parameter doesn't need to be set:
{mediaplayer flv="http://flv-player.net/medias/KyodaiNoGilga.flv"}
Plugin Parameters
Besides the parameters described at http://flash-mp3-player.net and http://flv-player.net you can use the following Tiki parameters:
Param | Values | Defaults | Req ? | Explanation | Since |
---|---|---|---|---|---|
mp3 | link | y (if no flv and src) | link to the MP3 file | ||
flv | link | y (if no mp3 and src) | link to a FLV file | ||
src | link | y (if no flv or mp3) | link to aif, aiff, aac, au, bmp, gsm, mov, mid, midi, mpg, mpeg, mp4, m4a, psd, qt, qtif, qif, qti, snd, tif, tiff, wav, 3g2, 3pg, swf,asx, asf, avi, wma, wmv,ra, ram, rm, rpm, rv, smi, smil, xaml, html, pdf (see jQuery media for a complete list) | >=6.0 | |
style | string | normal | n | mini or normal or maxi or multi style | |
where (for MP3) | url | http://flash-mp3-player.net/medias/ | n | URL to SWF file of the player (ended with /) | |
where (for FLV) | url | http://flv-player.net/medias/ | n | URL to SWF file of the player (ended with /) | |
wmode | string | transparent | n | window mode of the Flash object | 5.x |
Flash MP3 Player Parameters:
Name | Description |
---|---|
mp3 | The URL of the MP3 file to be played |
autoplay | 1 to auto-play |
loop | 1 to loop |
volume | The initial volume, between 0 and 200. |
skin | The URL of the JPEG file (not progressive) to load |
showstop | 1 to show the STOP button |
showinfo | 1 to show the INFO button |
loadingcolor | The color of loading bar |
bgcolor1 | The first color of the background gradient |
bgcolor2 | The second color of the background gradient |
buttoncolor | The color of the buttons |
buttonovercolor | Hover color of buttons |
slidercolor1 | The first color of the bar gradient |
slidercolor2 | The second color of the bar gradient |
sliderovercolor | Hover color of the bar |
textcolor | The text color |
bgcolor | The background color |
byteslimit | If it is an MP3 streaming, the stream will restart at the bytes limit, to prevent overload. |
Example with the src param (jQuery Media)
It has been enhanced in Tiki6 with jQuery#Media, so that more media formats are supported once you use the param "url" in the plugin helper ("src" in the code), including pdf among others. The value in the src parameter must end with a file extension
Example:
{mediaplayer src="https://branding.tiki.org/tiki-download_wiki_attachment.php?attId=37&page=Slideshow", width=100%, height=600, type="pdf"}
would produce this PDF in the player:
Other Examples
FLV
This code:
{mediaplayer flv="http://flv-player.net/medias/KyodaiNoGilga.flv"}
would produce:
File gallery file in a blog post
An example for a successful use of the maxi Mediaplayer in a blog post looks like this (only caveat is to have access rights for the relevant user group by setting tiki_p_download_files to yes - sometimes, a restart of the browser seems to be necessary to make those rights work...)
{mediaplayer mp3="http://example.com/tiki-download_file.php?fileId=1&showstop=1&showinfo=1&showvolume=1", style="maxi"}
PDF file in a file gallery
This also works for a pdf file in a file gallery beginning in version 10:
{mediaplayer src="tiki-download_file.php?fileId=7&display=y" type="pdf"}
And it displays the PDF file with the ID 7.
Related Pages
See these pages for information that applies for all modules:
- Module — Overall introduction and overview
- Module Admin — Introduction to the module admin pages for site-wide and individual module settings
- Assigning Modules — How to select a module to configure it
- Module Settings Interface — Interface for configuring individual module settings
- Module Settings Parameters — Explanation of standard parameter settings for modules
- Creating Custom Modules — How to create user modules
- Index of Modules — Links to the documentation of individual modules
- User Modules — How (if the feature is active) users can choose and place their modules
- Mods Type Modules — Links to modules that are installed as components
- PluginBlipTV
- PluginVimeo
- PluginWatershed
- PluginYouTube