Extension:WikiVid

From MediaWiki.org
Jump to: navigation, search
NOTE: This page is based off of http://wiki-tools.com/wiki/WikiVid. Please refer to the original page for copyright and other information!
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
WikiVid

Release status:Extension status experimental

ImplementationTemplate:Extension#type Link markup, Parser function, Tag, Database, Special page
DescriptionTemplate:Extension#description Allows for embeding of videos from external video services such as YouTube, or VReel.
Author(s)Template:Extension#username Dantmantalk
Latest versionTemplate:Extension#version In Development
MediaWikiTemplate:Extension#mediawiki 1.11.0 and higher
LicenseTemplate:Extension#license GPL
Download See original page for checkout and download links
ParametersTemplate:Extension#parameters

$egWikiVidServiceTags, $egWikiVidAutoplay, $egWikiVidEmbedNamespace, $egWikiVidExtensionImages

Added rightsTemplate:Extension#rights

linkvideo, linkvideo-delete

Hooks usedTemplate:Extension#hook
InternalParseBeforeLinksManual:Hooks/InternalParseBeforeLinks
ArticleFromTitleManual:Hooks/ArticleFromTitle
ArticleViewHeaderManual:Hooks/ArticleViewHeader
LanguageGetMagicManual:Hooks/LanguageGetMagic
ArticleSaveCompleteManual:Hooks/ArticleSaveComplete
ArticleDeleteManual:Hooks/ArticleDelete

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

Check usage and version matrix.

WikiVid allows you to embed videos from external video services such as YouTube, Stage6, Veoh, and Google Video. You can add videos by using Special:LinkVideo to create a title for an external video and using the [[Embed:Video Title]] syntax. Or you can directly embed videos using either the {{#wikivid:service|id}} direct embed syntax, or if enabled the <servicename>id</servicename> direct embed syntax.

In Development Screenshots[edit]

ToDo[edit]

Please remember that this extension is still being developed, here's a list of things that need to be finished before the code can be released:

  • Ability to delete linked videos
  • Debug and fix the embed tracking to make sure it works right:
    • Make sure that only editing a section doesn't end up making the embed links outside that section disappear from the database list.
      • Same thing goes for adding a new section.
    • Hook into the JobQue or something so that if a video is inside of a template the embeds will be changed when it is edited.
  • Debug the results of using [[:Embed:Video Title]].
    • Emebed: pages are not valid pages, with the setup it's unlikely that they'll show up in a list of articles that are linked to by a page. However it's undetermined if this is the result we want.
  • Add a log to track linked video additions and deletions.
    • Debug to see if things work in screwy ways when anon users add linked videos and are logged.
  • Finish adding service objects for all the other planned supported video services
  • Use an Embed: namespace instead of just a special page. (This may also fix any issues with links)
    • Will need tweaks to get things placed on the page right.

Usage[edit]

See also: /Video Syntax and /Special:LinkVideo.

Download instructions[edit]

In Development

Installation[edit]

See also: /Installation of extra Video Services.

In Development

Configuration parameters[edit]

$egWikiVidServiceTags
This setting enables or restricts the use of <servicename>id</servicename> tags. As a new tag is added for every video service the extension supports these tags can grow to a large amount depending on how many Service Classes you have installed. It's also possible for them to collide with the tags that are part of other extensions if a video service's ID is the same as the name of a tag from another extension. So use of these tags needs to be explicitly turned on.
There are 3 possible values: true, false, or an array. When true all tags will be added, when false(default) none of the tags will be added, and when set to an array only the tags which have id's inside of that array will be added.
Examples
$egWikiVidServiceTags = false; // (Default) Don't add any <servicename>id</servicename> tags.
$egWikiVidServiceTags = true;  // Add a <servicename>id</servicename> tag for each video service defined.
$egWikiVidServiceTags = array( 'youtube', 'veoh' ); // Only add <servicename>id</servicename> tags for
                                                    // youtube and veoh if those services are setup.

Tools.svg Tip for wiki admins: The function WikiVidService::getServices(); returns an array with a list of all the services setup. If you want to enable all of the tags, and instead specifically disable some, if you put a function inside of $wgExtensionFunctions then you can use that to fill $egWikiVidServiceTags with a list of all the services and then individually remove the ones you don't want.

$egWikiVidAutoplay
This setting enables or disables the ability to use the autoplay parameter inside of video embeds. As most of the time autoplay is something which is very undesired it is disabled by default, but can be enabled by setting this parameter to true. Please remember that autoplay will still only work when the video service being embedded from supports autoplay, and the service object for that service is coded for use of it.
Examples
$egWikiVidAutoplay = false; // (Default) Don't allow the use of autoplay.
$egWikiVidAutoplay = true;  // Allow users to use autoplay.
$egWikiVidEmbedNamespace
This is going to be changed when we switch to a real Embed: namespace.
This variable can be used to define what namespace number to use for the Embed: namespace. By default the extension will start at -3 and lower that number till it finds a special namespace number which is not in use. However using this you can specifically specify what special namespace number the extensions should be used.
Please take care when setting this number and make sure that the namespace number is not already in use, if you used a value such as -1 you could potentially break the use of all SpecialPages.
$egWikiVidExtensionImages
This variable can be used to define an alternate root for the local images used in the extension. This variable defaults to "{$wgScriptPath}/extensions/wiki-tools/WikiVid/images" or "{$wgScriptPath}/extensions/WikiVid/images" depending on if the wiki-tools directory is detected, however if you use some sort of rewriting or script forwarding trick to place MediaWiki in a different directory than the script path, or you want all the images to be loaded from a specific domain because you are running multiple wiki you may specify another location for the images to be served from using this variable.

User rights[edit]

linkvideo
This permission allows users to add new linked videos to the site using Special:LinkVideo.
Linking a Video is similar to Uploading, however unlike with uploads no files are added to the site, so it could be considered ok to allow anon users to link videos
linkvideo-delete

Example configruation[edit]

// Suggested configuration: Give all users video linking permissions but only sysops may delete linked videos.
$wgGroupPermissions['*'    ]['linkvideo'       ] = true;
$wgGroupPermissions['*'    ]['linkvideo-delete'] = false;
$wgGroupPermissions['sysop']['linkvideo-delete'] = true;

See also[edit]