Extension:Html5mediator

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
Html5mediator

Release status:Extension status unmaintained

ImplementationTemplate:Extension#type Hook, Media, Tag
DescriptionTemplate:Extension#description Allows to embed HTML5 audio and video files on wiki pages
Author(s)Template:Extension#username Seung Park (lightbindertalk)
Latest versionTemplate:Extension#version 0.3.2 (2013-09-12)
MediaWikiTemplate:Extension#mediawiki 1.20+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
Readme
Changelog
TagsTemplate:Extension#tags
<html5media>
Hooks usedTemplate:Extension#hook
ParserFirstCallInitManual:Hooks/ParserFirstCallInit

Translate the Html5mediator extension if it is available at translatewiki.net

Check usage and version matrix.

The Html5mediator extension provides a simple way to embed video and audio on a wiki page. It creates a new tag (<html5media>) to allow playback of video and audio files, referenced either as full URLs (e.g. http://hailhln.com/mensbeam.mp4)or as MediaWiki file tags (e.g. File:MensBeam.mp4).

Installation[edit]

  • Download and place the file(s) in a directory called Html5mediator in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/Html5mediator/Html5mediator.php";
    
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration[edit]

There are no configuration parameters, although you should make sure to register the file types you want to be able to embed in your wiki in LocalSettings.php. For instance, if you wanted to be able to play MP3 audio files and MP4 video files, you would need to insert the following at the bottom of LocalSettings.php:

$wgFileExtensions[] = 'mp3';
$wgFileExtensions[] = 'mp4';

Usage[edit]

Html5mediator can be used in the following ways:

Media file as external URL[edit]

<html5media height="720" width="1280">http://yoursite.com/example.mp4</html5media>

Media file previously uploaded to wiki[edit]

<html5media height="720" width="1280">File:Example.mp4</html5media>

YouTube[edit]

<html5media height="720" width="1280">http://www.youtube.com/watch?v=MGt25mv4-2Q</html5media>

Html5mediator automatically figures out whether your file is an audio file or a video file based on the extension, so there is no need to specify the nature of your file a priori. The height and width parameters are optional -- you can have both, one or the other, or nothing at all. If there's enough demand for it, embedding from other major video sharing sites will also be considered.

Compatibility[edit]

File Types[edit]

  • Audio:
    • .mp3
    • .ogg
  • Video:
    • .mp4 (H.264)
    • .webm (VP8)
    • .mov (H.264 only)
    • .ogv

Web Browsers[edit]

The following web browsers feature full support for the HTML5 <audio> and <video> tags, and work best with this extension:

  • Internet Explorer 9+
  • Mozilla Firefox (reasonably recent)
  • Google Chrome (reasonably recent)
  • Opera (reasonably recent)

For older versions of web browsers that do not support the HTML5 <audio> and <video> tags, Html5mediator falls back gracefully on FlowPlayer, a Flash-based media player. This has been tested and confirmed on Firefox 3.0 and Internet Explorer 8.

MediaWiki[edit]

Html5mediator should work gracefully with a wide range of MediaWiki versions, although all development and testing was done on MediaWiki 1.21.1. As (or if) users report their success (or lack thereof) with older and newer MediaWiki versions, the compatibility list here will be updated.

Known Working[edit]

  • 1.19.11
  • 1.20.2
  • 1.21.1, 1.21.2
  • 1.22RC3
  • 1.27.1

Acknowledgments[edit]

This extension is based on the parser_hook example extension, and shamelessly borrows MediawikiPlayer's MediaWiki File: → fully-qualified URL conversion code. It utilizes html5media for its audiovisual processing and display.

See Also[edit]