Extension:Video
|
Video Release status: beta |
|||
|---|---|---|---|
| Implementation | Special page | ||
| Description | Allows new Video namespace for embeddable media on supported sites | ||
| Author(s) | David Pean Jack Phoenix John Du Hart |
||
| Last version | 1.4 | ||
| MediaWiki | 1.18+ | ||
| License | GNU General Public License 2.0 or later | ||
| Download |
Download snapshot (Git master)
Git [?]: repo summary • tree • code changes SVN [?]: checkout-url • tree • code changes README |
||
|
|||
|
|||
|
Check usage (experimental) |
|||
Video is an extension that allows you to import videos from different video services, such as YouTube, Google Video or Metacafe. The extension adds two new special page, Special:AddVideo, which all registered users or other users with 'addvideo' permission can access to add new videos to the site and Special:NewVideos, which lists all recently added video. The extension also adds <videogallerypopulate> parser hook tag.
Video additions are logged into the video log at Special:Log/video.
This extension was originally written by David Pean for Wikia, Inc. Some code cleanup was done by Łukasz 'TOR' Garczewski and Bartek Łapiński for Wikia, Inc. and by Jack Phoenix for ShoutWiki.
This extension requires r88235 or greater version of MediaWiki for the video undeletion feature to work properly.
Contents |
[edit] Supported video providers
- DailyMotion
- Gametrailers
- Google Video
- MetaCafe
- MyVideo
- Sevenload
- South Park Studios
- Viddler
- Vimeo
- WeGame
- YouTube
[edit] To-do list/known bugs
- Make VideoPage::videoLinks() actually work (Special:WhatLinksHere support)
- Write the code for supporting 5min.com, Blip.tv, Nicovideo and Tangler.com
[edit] Installation
- Download the source code into
$IP/extensions/Video/ - Create the required two tables,
oldvideoandvideo, in the database; if you have command line access, you can do this by re-running the MediaWiki updater script,update.php - Add the following into the wiki's LocalSettings.php:
require_once("$IP/extensions/Video/Video.php");
- Installation can now be verified through Special:Version
[edit] Usage
After adding a video through Special:AddVideo, you can embed it into an article by using the syntax [[Video:Video's Name Here]] or <video name="Video's Name Here"/>.
[edit] Developer Info
Provider classes for different video hosting sites are stored in the providers directory. Writing a new provider class is easy:
- copy the example provider class into the providers directory and name it accordingly (for example,
ExampleVideo.php) - autoload the new provider class in Video.php
- add the provider to Video::$providers
- enjoy!
[edit] Example provider class
<?php class ExampleVideoProvider extends BaseVideoProvider { // Used to extract the $video_id from the URL protected $videoIdRegex = '#/watch/([a-zA-Z0-9_\-]+)/#'; // Set this to the embed, and use $width, $height and $video_id appropriately protected $embedTemplate = '<object width="$width" height="$height"><param name="movie" value="$video_id">...etc'; /** * Gives all domains that this provider should respond to * * Second level domains are preferred * * @return array */ public static function getDomains() { return array( 'example.com' ); } /** * Return the aspect ratio for the video player * * Just what the player is set to by default: Width / Height * * @return float */ protected function getRatio() { return 512 / 296; } /** * If there is more complexity to retrieving the $video_id for the embed * code than a single regular expression, override this function. * * If you make an HTTP call (eg. to an API) you MUST cache it with $wgMemc * * @param $url String URL to extract the ID from * @return bool|null|Object */ /* protected function extractVideoId( $url ) { // Check out HuluVideoProvider or Viddler for an example } */ /** * Override this function for cases where the HTML embed code is complex * and has special cases. * * @return string Raw HTML to display the video */ /* public function getEmbedCode() { return '...'; } */ }
| Social tools | |
|---|---|
| SocialProfile | Overview • UserStatus (GSoC 2011 project) • Roadmap • Developer info • Screenshots • History |
| Other social extensions | Automatic Board Welcome • BlogPage • FanBoxes • NewUsersList • PictureGame • PollNY • QuizGame • RandomFeaturedUser • RandomGameUnit • RandomUsersWithAvatars • SiteMetrics • UserWelcome |
| Semanticness | Semantic Social Profile |
| Other related extensions (which do not depend on SocialProfile) |
Comments • LinkFilter • NewSignupPage • RandomImageByCategory • Video • VoteNY • WikiTextLoggedInOut |
- Beta status extensions
- Special page extensions
- Extensions in Wikimedia version control
- Extensions which add rights
- ArticleFromTitle extensions
- CategoryPageView extensions
- ParserBeforeStrip extensions
- ParserFirstCallInit extensions
- ArticleDelete extensions
- UndeleteForm::showRevision extensions
- UndeleteForm::showHistory extensions
- UndeleteForm::undelete extensions
- All extensions
- 2012 Q1 Extension Page Review Drive
- Social tools
- Extensions by ShoutWiki
- Extensions by Wikia, Inc.
- YouTube extensions