From mediawiki.org
MediaWiki extensions manual
Release status: stable
Implementation Tag
Description A extension for embedding PeerTube videos in MediaWiki articles.
Author(s) Alex
Latest version 1.0.4
MediaWiki 1.27+
Database changes No
License GNU General Public License 2.0 or later
Download PeerTubeEmbed/releases
$wgPeerTubeEmbedDisableP2P $wgPeerTubeEmbedHostFilterMode $wgPeerTubeEmbedHostFilterList

The PeerTubeEmbed extension allows embedding PeerTube videos in MediaWiki articles.

Please read the entirety of this page before installing the extension.


  • Download the latest version and place the file(s) in a directory called PeerTubeEmbed in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'PeerTubeEmbed' );
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parameters[edit]

Disables P2P on all embeds if set to true. See the privacy section below.
Controls the behavior of the host filter. Accepts two values: 'allow', which only allows embeds from hosts in the host filter, and 'deny', which refuses to create embeds from hosts in the host filter. See the security section below.
An array of hosts. You can add new entries as follows:
$wgPeerTubeEmbedHostFilterList[] = 'domain.tld';
$wgPeerTubeEmbedHostFilterList[] = 'anotherdomain.online';
$wgPeerTubeEmbedHostFilterList[] = 'subdomain.yetanotherdomain.org';


Add <peertube>URL to the video</peertube> where you want the video to be embedded.

For example: <peertube>https://video.blender.org/w/s6dVWgGVCAYJQkbZZJvY1c</peertube>.


Embeds created by this extension have the PeerTubeEmbed class. You can use CSS to modify their style:

.PeerTubeEmbed {
/* Insert properties here */


TL;DR: Configure the host filter to only allow known, trusted PeerTube instances and, if possible, setup CSP on your wiki.

Unlike centralized services like YouTube, PeerTube instances may be on any valid hostname. While the extension tries its best to make sure it is only embedding something that resembles a PeerTube URL, if the host filter isn't configured, it is trivial to use this extension to embed any arbitrary content on your wiki, regardless of any checks the extension does on URLs.

You should take a look at what instances are out there, and decide which ones you're comfortable allowing on your wiki.

For example, if you only want to allow embedding videos from TILvids, the configuration may look as follows:

wfLoadExtension( 'PeerTubeEmbed' );
$wgPeerTubeEmbedHostFilterMode = 'allow'; //ONLY allow hosts in the host filter
$wgPeerTubeEmbedHostFilterList[] = 'tilvids.com';

Additionally, consider setting up a Content Security Policy. How to do this depends on what setup you have, you could set it up at the webserver level, or use the experimental $wgCSPHeader at the MediaWiki level.


One of the defining features of PeerTube is the usage of P2P technology when viewing videos. Viewers share pieces of the video with each other.

However, like BitTorrent, this means that the IP addresses of the viewers are revealed to others when watching the videos, as they need to connect with each other. If you're not comfortable with this, you can disable P2P on all embeds by adding the following to your LocalSettings.php after loading the extension:

$wgPeerTubeEmbedDisableP2P = true;

See also[edit]