This is an old revision of the document!
Table of Contents
mp3play plugin
Compatible with DokuWiki
Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons
Description
This plugin is a DokuWiki port of the Wordpress Audio Player Plugin. It allows you to play mp3 files1) on your wiki page.
Installation
Download the archive and unpack it into <dokuwiki>/lib/plugins
.
- .zip Plugin Manager
The plugin is also available via git.
% cd <dokuwiki>/lib/plugins % git clone git://github.com/michitux/dokuwiki-plugin-mp3play.git mp3play
Configuration
You can change the colors of the flash player by editing the <dokuwiki>lib/plugins/mp3play/colors.conf
provided by the plugin. The file is pretty self explaining.
Syntax
The syntax is as follows, you can use the plugin multiple times on a single wiki page.
{{mp3play>namespace:audiofile.mp3}}
The plugin has two options loop
and autostart
. If loop
is set the playback will start again at the beginning when the player reached the end. When autostart
is set, the player will immediately start playing the mp3 when you visit the wiki page. The syntax is as follows:
{{mp3play>namespace:audiofile.mp3?autostart}} {{mp3play>namespace:audiofile.mp3?loop}} {{mp3play>namespace:audiofile.mp3?autostart&loop}} {{mp3play>namespace:audiofile.mp3?loop&autostart}}
Demo
An example can be found here.
Changelog
- 2013-04-20: use jQuery instead of the deprecated old JavaScript library, this makes the plugin compatible with Weatherwax. Note that the plugin is still rather outdated and using a solution which doesn't require flash would be better.
A complete changelog is available here.
- Merge pull request #5 from splitbrain-forks/php7-signature (2016-02-27 18:30)
- Adjust method signatures to match parent (2016-02-02 16:11)
- New version 2013-04-20 (2013-04-20 11:52)
- Merge pull request #1 from michitux/patch-1 (2013-04-16 21:40)
- Fix JavaScript for DokuWiki Weatherwax (2013-04-16 21:40)
- release preparations (2010-05-31 16:38)
- updated to new player version closes #2 (2010-05-31 16:34)
- release preparations (2009-09-12 13:48)
- fixed stop all function - using only javascript now issue/1 (2009-09-12 13:47)
- release preparations (2009-05-21 14:49)
Bugs / Feature Requests
Please report bugs and feature requests at the bug tracker.
Discussion
- Hello, the DEMO page link seems to have gone sadly awol — jw/2010-05-27
- I use the mp3 plugin on the following site - feel free to watch it in action :)
file not found
- I think I'm doing something wrong. I insert
{{mp3play>:Giga.mp3}}
but when I try to play it shows a “file not found”. Where the mp3 file should be?
- Dokuwiki use lowcase names only!
Where to put files
I've tried many directories but all say file not found
Is Chinese NS supported?
* I insert
{{mp3play>:我的花园:中文名.mp3}}
but when I try to play it shows a “file not found”. * I insert
{{mp3play>:my_garden:a_song.mp3}}
It plays OK.
Chinese NS and Chinese filename are not supported?
Seems that any unicode characters in filenames are not supported?.. When I insert
{{mp3play>mp3:эдуард_хиль_-_журавлёнок.mp3}}
I get “file not found” error too.
I get file not found also, tried different namespace, in lower case and .mp3 files to no avail. Bat 05/04/2013 12:30:31
<Solution>Replace the line in syntax.php
$renderer->doc .= ' <param name="FlashVars" value="' . $params . 'soundFile=' . DOKU_URL . 'lib/exe/fetch.php?media=' . $data['mp3'] . '" />' . DOKU_LF;
with
$renderer->doc .= ' <param name="FlashVars" value="' . $params . 'soundFile=' . DOKU_URL . 'lib/exe/fetch.php?media=' . urlencode(urlencode ($data['mp3'])) . '" />' . DOKU_LF;
With this double encode trick, you will be able to play files with UTF8 file name and/or namespace.
11/3/2014
Where to put the mp3 files (Solution)
It is not indicated anywhere above, but the mp3 files must me located in the /data/media/ directory. Otherwise you will get the 'File not found' error. And when you invoke it should be this way:
{{mp3play>xxxxx.mp3}}
do not specify the media as in
{{mp3play>media:xxxxx.mp3}}
Bat 07/04/2013
hello! I put .mp3 in /data/media/ but it's not working: file not found!
Is it the good syntax?
:my_song_20_septembre_2014.mp3
Issues with iPad/iPhone Users
I have a couple of people report they don't see the play & speaker symbols when they access the site from iPad/iPhone. No error message, just nothing to “click to play” - java issues? — charles.minto 2014/03/23 20:11