Help:Inhoud
Uit Krimpenerwaard Wiki
Video toevoegen
The EmbedVideo Extension is a MediaWiki extension which adds a parser function called #ev for embedding video clips from popular video sharing services.
- Project Homepage
- EmbedVideo Extension - Jimbojw.com
- Source Code
- EmbedVideo.php
- Licensing
- EmbedVideo is released under The MIT License.
Installation
- Download EmbedVideo, and be sure to rename the downloaded file to EmbedVideo.php.
- Drop this script in $IP/extensions
- Note: $IP is your MediaWiki install directory.
- Enable the extension by adding this line to the bottom of your LocalSettings.php:
<source lang="php">require_once('extensions/EmbedVideo.php');</source>
Usage
The EmbedVideo parser function expects to be called in either of the following ways:
- {{#ev:service|id}} -or-
- {{#ev:service|id|width}}
Where:
- service is the name of a video sharing service.
- id is the id of the video to include
- width (optional) is the width in pixels of the viewing area (height will be determined automatically)
For example, to include the famous "evolution of dance" YouTube video, you'd enter:
{{#ev:youtube|dMH0bHeiRNg}}
And if you wanted scaled down to thumbnail size, you could use:
{{#ev:youtube|dMH0bHeiRNg|100}}
Note: See the Project Homepage for more examples.
Supported Services
As of version 0.1, EmbedVideo supports embedding video content from the following services:
Developer Notes
The major benefit of using a parser function as the injection mechanism for video clips (as opposed to an extension tag) is that parser functions can utilize template parameters (of the form {{{1}}}).
For example, say you found yourself making a lot of YouTube videos in thumbnail size, right-aligned like an image. You might make a template called Template:Youtube_tn which could contain this:
<div class="thumb tright">
{{#ev:youtube|{{{1}}}|{{{2|100}}}}}
</div>
And then call it like this:
{{youtube tn|someYoutubeId}}
Weblinks
