Jump to content

Extension:Mp3Handler

From mediawiki.org
MediaWiki extensions manual
Mp3Handler
Release status: unmaintained
Description MP3 Handler using dewplayer.fr
Author(s) wikt:User:Conrad.Irwin
Latest version 0.1
MediaWiki
License GPL3
Download

Once you have installed this extension, you can upload Mp3 files in the same manner as images. To display them on a page, use the syntax [[File:MyFile.mp3]], just like for images.

Note: Dewplayer is not free software, though it is free of charge.

Install and configuration

[edit]
  • Download and place the file(s) in a directory called Mp3Handler in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    require_once "$IP/extensions/Mp3Handler/Mp3Handler.php";
    $wgDewplayerPath = "$wgScriptPath/extensions/Mp3Handler/dewplayer.swf"; //Path to dewplayer.swf
    $wgMp3DownloadIcon = "$wgScriptPath/extensions/Mp3Handler/download.png"; //Path to the download.png
    $wgMp3DownloadPath = "$1"; //Download path. Change this to look in a different directory (to track downloads, etc.). Set this to false to disable the download button.
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

If you want to make sure that "download" really does download instead of playing in the browser, you should configure your server to set the MIME type to application/octet-stream. Overriding $wgMp3DownloadPath can make this easier.