Template:EmbedVideo/doc: Difference between revisions

From Dolphin Emulator Wiki
Jump to navigation Jump to search
No edit summary
(Update doc for 2.x version)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The EmbedVideo Extension is a MediaWiki extension which adds parser functions called #ev and #evp for embedding video clips from popular video sharing services.
The '''EmbedVideo''' Extension is a MediaWiki extension which adds a parser function called <tt>#ev</tt> for embedding video clips from over 24 popular video sharing services in multiple languages and countries.


== Usage ==
==Usage==
=== Tags ===
The EmbedVideo parser function expects to be called in any of the following ways:
The EmbedVideo parser function expects to be called in any of the following ways:
====#ev - Classic Parser Tag====
* <code><nowiki>{{#ev:service|id}}</nowiki></code>
* <code><nowiki>{{#ev:service|id}}</nowiki></code>
* <code><nowiki>{{#ev:service|id|width}}</nowiki></code>
* <code><nowiki>{{#ev:service|id|dimensions}}</nowiki></code>
* <code><nowiki>{{#ev:service|id|width|align}}</nowiki></code>
* <code><nowiki>{{#ev:service|id|dimensions|alignment}}</nowiki></code>
* <code><nowiki>{{#ev:service|id|width|align|desc}}</nowiki></code>
* <code><nowiki>{{#ev:service|id|dimensions|alignment|description}}</nowiki></code>
* <code><nowiki>{{#evp:service|id|desc}}</nowiki></code>
* <code><nowiki>{{#ev:service|id|dimensions|alignment|description|container}}</nowiki></code>
* <code><nowiki>{{#evp:service|id|desc|align}}</nowiki></code>
* <code><nowiki>{{#ev:service|id|dimensions|alignment|description|container|urlargs}}</nowiki></code>
* <code><nowiki>{{#evp:service|id|desc|align|width}}</nowiki></code>


Where:
However, if needed optional arguments may be left blank by not putting anything between the pipes:
* <var>service</var> is the name of a video sharing service (See "service name" in the list below)
* <code><nowiki>{{#ev:service|id|||description}}</nowiki></code>
* <var>id</var> is the id of the video to include
* <var>width</var> (optional) is the width in pixels of the viewing area (height will be determined automatically)
* <var>align</var> (optional) is an alignment (float) attribute. May be "left" or "right".
* <var>desc</var> (optional) is a short description to display beneath the video when it is aligned


== Examples ==
====#evt - Parser Tag for Templates====
A video of this URL:
The <nowiki>#evt</nowiki> parser tag allows for key=value pairs which allows for easier templating and readability.


<pre>http://www.youtube.com/watch?v=R9u_BJXRyuI</pre>
<pre><nowiki>{{#evt:
service=youtube
|id=https://www.youtube.com/watch?v=pSsYTj9kCHE
|alignment=right
}}</nowiki></pre>


Would end up like this with the EmbedVideo plugin:
====<nowiki><embedvideo></nowiki> - Tag Hook====
Videos can easily be embedded with the <nowiki><embedvideo></embedvideo></nowiki> tag hook.  The ID/URL goes as the input between the tags and parameters can be added as the tag arguments.


<pre>{{#ev:youtube|R9u_BJXRyuI}}</pre>
<pre><nowiki><embedvideo service="youtube">https://www.youtube.com/watch?v=pSsYTj9kCHE</embedvideo></nowiki></pre>


It could be further modified by reducing it's size, aligning it, etc etc, as outlined above. That video at 100px wide, left alignment, and a description, would be like so:
=== Attributes for Parser Tags ===
{| class="wikitable"
|-
! Attribute
! Description
|-
| <code>service="<nowiki>(See Supported Services below.)</nowiki>"</code>
| '''Required:''' yes
:The video service to call.
|-
| <code>id="<nowiki>[id|url]</nowiki>"</code>
| '''Required:''' yes
:The raw ID of the video or URL from the player page.
|-
| <code>dimensions="<nowiki>[WIDTH|WIDTHxHEIGHT|xHEIGHT]</nowiki>"</code>
| '''Required:''' no, '''Default:''' <tt>640</tt>
:Dimensions in pixels to size the embed container.  The standard format is width x height where either can be omitted, but the <tt>x</tt> must proceed height to indicate it as the height.
:Examples: <tt>480</tt>, <tt>480x320</tt>, <tt>x320</tt>.  If the height is not provided it will be calculated automatically from the width and service default ratio.
:Some services such as ''Gfycat'' do not have standard heights and should be specified for each embed.  <tt>$wgEmbedVideoDefaultWidth</tt> can be set in <tt>LocalSettings.php</tt> to override the default width.
|-
| <code>alignment="<nowiki>[left|center|right]</nowiki>"</code>
| '''Required:''' no, '''Default:''' <tt>none</tt>
:Align the placement of the video either to the left, centered, or to the right.
|-
| <code>description="<nowiki>[wiki text]</nowiki>"</code>
| '''Required:''' no, '''Default:''' <tt>none</tt>
:Display a description under the embed container.
|-
| <code>container="<nowiki>[frame]</nowiki>"</code>
| '''Required:''' no, '''Default:''' <tt>none</tt>
:Specifies the container type to use for the embed.
::<tt>frame</tt>: Wrap the video player in a Mediawiki thumbnail box.
|-
| <code>urlargs="<nowiki>modestbranding=1&version=3</nowiki>"</code>
| '''Required:''' no, '''Default:''' <tt>none</tt>
:Allows extra URL arguments to be appended to the generated embed URL.  This is useful for obscure options only supported on one service.
|}
 
=== Examples ===
For example, a video from YouTube use the 'youtube' service selector enter either the raw ID:
<pre>{{#ev:youtube|pSsYTj9kCHE}}</pre>
Or the full URL:
<pre>{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE}}</pre>


<pre>{{#ev:youtube|R9u_BJXRyuI|100|left|super smash bros brawl in 3d dolphin emulator}}</pre>
To display the same video as a right aligned large thumbnail with a description:
<pre>{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|1000|right|Let eet GO|frame}}</pre>


== Supported Services ==
For YouTube to have the video start at a specific time code utilize the urlargs(URL arguments) parameter.  Take the rest of the URL arguments from the custom URL and place them into the urlargs.  Please note that not all video services support extra URL arguments or may have different keys for their URL arguments.
As of version 1.0, EmbedVideo supports embedding video content from the following services:
<pre>https://www.youtube.com/watch?v=pSsYTj9kCHE&start=76</pre>
<pre>{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|||||start=76}}</pre>
 
=== Supported Services ===
As of version 2.x, EmbedVideo supports embedding video content from the following services:
{| class="wikitable"
{| class="wikitable"
|-
|-
! Site  
! Site  
! Service Name
! colspan="2"|Service Name(s)
! ID Example
! URL Example(s)
|-
! [https://archive.org/details/movies Archive.org Videos]
| colspan="2"|<tt>archiveorg</tt>
| <nowiki>electricsheep-flock-244-80000-6</nowiki>
| <nowiki>https://archive.org/details/electricsheep-flock-244-80000-6</nowiki>
  <nowiki>https://archive.org/embed/electricsheep-flock-244-80000-6</nowiki>
|-
! [http://bambuser.com/ Bambuser]
| <tt>bambuser</tt> - Broadcasts
| <tt>bambuser_channel</tt> - Channels
| <nowiki>5262334</nowiki>
| <nowiki>http://bambuser.com/v/5262334</nowiki>
|-
! [https://beam.pro/ Beam]
| colspan="2"|<tt>beam</tt> - Streams
| <nowiki>RocketBear</nowiki>
| <nowiki>https://beam.pro/RocketBear</nowiki>
|-
! [http://www.bing.com/videos/ Bing]
| colspan="2"|<tt>bing</tt>
| <nowiki>31ncp9r7l</nowiki>
| <nowiki>http://www.bing.com/videos/watch/video/adorable-cats-attempt-to-eat-invisible-tuna/31ncp9r7l</nowiki>
|-
! [http://www.blip.tv/ Blip.tv]
| colspan="2"|<tt>blip</tt> - Blip requires the full URL to the video page and does not accept the raw ID.
|
|<nowiki>http://blip.tv/vinylrewind/review-6864612</nowiki>
|-
! [http://www.collegehumor.com/ CollegeHumor]
| colspan="2"|<tt>collegehumor</tt>
| <nowiki>6875289</nowiki>
| <nowiki>http://www.collegehumor.com/video/6875289/batman-says-his-goodbyes</nowiki>
|-
|-
! [http://www.dailymotion.com/ Dailymotion]  
! [http://www.dailymotion.com/ Dailymotion]  
| <samp>dailymotion</samp>
| colspan="2"|<tt>dailymotion</tt>
| <nowiki>x1adiiw_archer-waking-up-as-h-jon-benjamin_shortfilms</nowiki>
| <nowiki>http://www.dailymotion.com/video/x1adiiw_archer-waking-up-as-h-jon-benjamin_shortfilms</nowiki>
|-
! [http://tvpot.daum.net/ Daum TVPot]
| colspan="2"|<tt>tvpot</tt> - Obtain the URL or ID from the share menu URL.
| <nowiki>s9011HdLzYwpLwBodQzCHRB</nowiki>
| <nowiki>http://tvpot.daum.net/v/s9011HdLzYwpLwBodQzCHRB</nowiki>
|-
! [http://www.divshare.com Div Share]
| colspan="2"|<tt>divshare</tt>
|
|
|-
! [http://edutopia.org Edutopia]
| colspan="2"|Edutopia content moved to YouTube.  Please use the youtube service selector below.
|
|
|-
! [http://www.funnyordie.com/ FunnyOrDie]
| colspan="2"|<tt>funnyordie</tt>
| <nowiki>c61fb67ac9</nowiki>
| <nowiki>http://www.funnyordie.com/videos/c61fb67ac9/to-catch-a-predator-elastic-heart-edition</nowiki>
|-
! [http://gfycat.com/ Gfycat]
| colspan="2"|<tt>gfycat</tt>
| <nowiki>BruisedSilentAntarcticfurseal</nowiki>
| <nowiki>http://www.gfycat.com/BruisedSilentAntarcticfurseal</nowiki>
|-
! [http://www.hitbox.tv/ Hitbox]
| colspan="2"|<tt>hitbox</tt>
| <nowiki>Washuu</nowiki>
| <nowiki>http://www.hitbox.tv/Washuu</nowiki>
|-
|-
! [http://www.divshare.com/ Div Share]
! [http://www.kickstarter.com/ Kickstarter]
| <samp>divshare</samp>
| colspan="2"|<tt>kickstarter</tt>
| <nowiki>elanlee/exploding-kittens</nowiki>
| <nowiki>https://www.kickstarter.com/projects/elanlee/exploding-kittens</nowiki>
|-
|-
! [http://edutopia.org Edutopia]  
! [http://www.metacafe.com/ Metacafe]
| <samp>edutopia</samp>
| colspan="2"|<tt>metacafe</tt>
| <nowiki>11404579</nowiki>
| <nowiki>http://www.metacafe.com/watch/11404579/lan_party_far_cry_4/</nowiki>
|-
|-
! [http://www.funnyordie.com/ FunnyOrDie]  
! [http://www.nicovideo.jp/ Nico Nico Video]
| <samp>funnyordie</samp>
| colspan="2"|<tt>nico</tt>
| <nowiki>sm24394325</nowiki>
| <nowiki>http://www.nicovideo.jp/watch/sm24394325</nowiki>
|-
|-
! [http://video.google.com/ Google Video]  
! [http://rutube.ru/ RuTube]
| <samp>googlevideo</samp>
| colspan="2"|<tt>rutube</tt>
| <nowiki>b698163ccb67498db74d50cb0f22e556</nowiki>
| <nowiki>http://rutube.ru/video/b698163ccb67498db74d50cb0f22e556/</nowiki>
|-
|-
! [http://interia.pl/ Interia]  
! [http://teachertube.com TeacherTube]
| <samp>interia</samp> or <samp>interiavideo</samp>
| colspan="2"|<tt>teachertube</tt>
| <nowiki>370511</nowiki>
| <nowiki>http://www.teachertube.com/video/thats-a-noun-sing-along-hd-version-370511</nowiki>
|-
|-
! [http://revver.com/ Revver]  
! [http://www.ted.com/talks/browse/ TED Talks]
| <samp>revver</samp>
| colspan="2"|<tt>ted</tt>
| <nowiki>bruce_aylward_humanity_vs_ebola_the_winning_strategies_in_a_terrifying_war</nowiki>
| <nowiki>http://www.ted.com/talks/bruce_aylward_humanity_vs_ebola_the_winning_strategies_in_a_terrifying_war</nowiki>
|-
|-
! [http://sevenload.com/ sevenload]  
! [http://www.tudou.com/ Tudou]
| <samp>sevenload</samp>
| colspan="2"|<tt>tudou</tt>
| <nowiki>mfQXfumwiew</nowiki>
| <nowiki>http://www.tudou.com/listplay/mfQXfumwiew.html</nowiki>
|-
|-
! [http://teachertube.org TeacherTube]  
! [http://www.twitch.tv Twitch]
| <samp>teachertube</samp>
| <tt>twitch</tt> - Live Streams
| <tt>twitchvod</tt> - Archived Videos on Demand
| <nowiki>twitchplayspokemon</nowiki>
| <nowiki>http://www.twitch.tv/twitchplayspokemon</nowiki>
|-
|-
! [http://www.youtube.com/ YouTube]  
! [http://89.160.51.62/recordme/spelain.htm Videomaten]
| <samp>youtube</samp> and <samp>youtubehd</samp>
| colspan="2"|<tt>videomaten</tt>
|
|
|-
|-
! [http://www.vimeo.com Vimeo]
! [http://www.vimeo.com Vimeo]
| <samp>vimeo</samp>
| colspan="2"|<tt>vimeo</tt>
| <nowiki>105035718</nowiki>
| <nowiki>http://vimeo.com/105035718</nowiki>
|-
! [http://vine.co Vine]
| colspan="2"|<tt>vine</tt>
| <nowiki>h2B7WMtuX2t</nowiki>
| <nowiki>https://vine.co/v/h2B7WMtuX2t</nowiki>
|-
! [http://screen.yahoo.com/ Yahoo Screen]
| colspan="2"|<tt>yahoo</tt>
| <nowiki>katy-perry-dances-sharks-2015-024409668</nowiki>
| <nowiki>https://screen.yahoo.com/videos-for-you/katy-perry-dances-sharks-2015-024409668.html</nowiki>
|-
! [http://www.youtube.com/ YouTube]
| <tt>youtube</tt> - Single Videos
| <tt>youtubeplaylist</tt> - Playlists
| <nowiki>pSsYTj9kCHE</nowiki>
| <nowiki>https://www.youtube.com/watch?v=pSsYTj9kCHE</nowiki>
  <nowiki>https://www.youtube.com/watch?v=CW_PbErQ_c8&list=PL76E80C7F756A2047</nowiki>
|-
! [http://www.youku.com/ Youku]
| colspan="2"|<tt>youku</tt>
| <nowiki>XODc3NDgzMTY4</nowiki>
| <nowiki>http://v.youku.com/v_show/id_XODc3NDgzMTY4.html</nowiki>
|-
|}
|}

Latest revision as of 04:13, 27 November 2015

The EmbedVideo Extension is a MediaWiki extension which adds a parser function called #ev for embedding video clips from over 24 popular video sharing services in multiple languages and countries.

Usage

Tags

The EmbedVideo parser function expects to be called in any of the following ways:

#ev - Classic Parser Tag

  • {{#ev:service|id}}
  • {{#ev:service|id|dimensions}}
  • {{#ev:service|id|dimensions|alignment}}
  • {{#ev:service|id|dimensions|alignment|description}}
  • {{#ev:service|id|dimensions|alignment|description|container}}
  • {{#ev:service|id|dimensions|alignment|description|container|urlargs}}

However, if needed optional arguments may be left blank by not putting anything between the pipes:

  • {{#ev:service|id|||description}}

#evt - Parser Tag for Templates

The #evt parser tag allows for key=value pairs which allows for easier templating and readability.

{{#evt:
service=youtube
|id=https://www.youtube.com/watch?v=pSsYTj9kCHE
|alignment=right
}}

<embedvideo> - Tag Hook

Videos can easily be embedded with the <embedvideo></embedvideo> tag hook. The ID/URL goes as the input between the tags and parameters can be added as the tag arguments.

<embedvideo service="youtube">https://www.youtube.com/watch?v=pSsYTj9kCHE</embedvideo>

Attributes for Parser Tags

Attribute Description
service="(See Supported Services below.)" Required: yes
The video service to call.
id="[id|url]" Required: yes
The raw ID of the video or URL from the player page.
dimensions="[WIDTH|WIDTHxHEIGHT|xHEIGHT]" Required: no, Default: 640
Dimensions in pixels to size the embed container. The standard format is width x height where either can be omitted, but the x must proceed height to indicate it as the height.
Examples: 480, 480x320, x320. If the height is not provided it will be calculated automatically from the width and service default ratio.
Some services such as Gfycat do not have standard heights and should be specified for each embed. $wgEmbedVideoDefaultWidth can be set in LocalSettings.php to override the default width.
alignment="[left|center|right]" Required: no, Default: none
Align the placement of the video either to the left, centered, or to the right.
description="[wiki text]" Required: no, Default: none
Display a description under the embed container.
container="[frame]" Required: no, Default: none
Specifies the container type to use for the embed.
frame: Wrap the video player in a Mediawiki thumbnail box.
urlargs="modestbranding=1&version=3" Required: no, Default: none
Allows extra URL arguments to be appended to the generated embed URL. This is useful for obscure options only supported on one service.

Examples

For example, a video from YouTube use the 'youtube' service selector enter either the raw ID:

{{#ev:youtube|pSsYTj9kCHE}}

Or the full URL:

{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE}}

To display the same video as a right aligned large thumbnail with a description:

{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|1000|right|Let eet GO|frame}}

For YouTube to have the video start at a specific time code utilize the urlargs(URL arguments) parameter. Take the rest of the URL arguments from the custom URL and place them into the urlargs. Please note that not all video services support extra URL arguments or may have different keys for their URL arguments.

https://www.youtube.com/watch?v=pSsYTj9kCHE&start=76
{{#ev:youtube|https://www.youtube.com/watch?v=pSsYTj9kCHE|||||start=76}}

Supported Services

As of version 2.x, EmbedVideo supports embedding video content from the following services:

Site Service Name(s) ID Example URL Example(s)
Archive.org Videos archiveorg electricsheep-flock-244-80000-6 https://archive.org/details/electricsheep-flock-244-80000-6
 https://archive.org/embed/electricsheep-flock-244-80000-6
Bambuser bambuser - Broadcasts bambuser_channel - Channels 5262334 http://bambuser.com/v/5262334
Beam beam - Streams RocketBear https://beam.pro/RocketBear
Bing bing 31ncp9r7l http://www.bing.com/videos/watch/video/adorable-cats-attempt-to-eat-invisible-tuna/31ncp9r7l
Blip.tv blip - Blip requires the full URL to the video page and does not accept the raw ID. http://blip.tv/vinylrewind/review-6864612
CollegeHumor collegehumor 6875289 http://www.collegehumor.com/video/6875289/batman-says-his-goodbyes
Dailymotion dailymotion x1adiiw_archer-waking-up-as-h-jon-benjamin_shortfilms http://www.dailymotion.com/video/x1adiiw_archer-waking-up-as-h-jon-benjamin_shortfilms
Daum TVPot tvpot - Obtain the URL or ID from the share menu URL. s9011HdLzYwpLwBodQzCHRB http://tvpot.daum.net/v/s9011HdLzYwpLwBodQzCHRB
Div Share divshare
Edutopia Edutopia content moved to YouTube. Please use the youtube service selector below.
FunnyOrDie funnyordie c61fb67ac9 http://www.funnyordie.com/videos/c61fb67ac9/to-catch-a-predator-elastic-heart-edition
Gfycat gfycat BruisedSilentAntarcticfurseal http://www.gfycat.com/BruisedSilentAntarcticfurseal
Hitbox hitbox Washuu http://www.hitbox.tv/Washuu
Kickstarter kickstarter elanlee/exploding-kittens https://www.kickstarter.com/projects/elanlee/exploding-kittens
Metacafe metacafe 11404579 http://www.metacafe.com/watch/11404579/lan_party_far_cry_4/
Nico Nico Video nico sm24394325 http://www.nicovideo.jp/watch/sm24394325
RuTube rutube b698163ccb67498db74d50cb0f22e556 http://rutube.ru/video/b698163ccb67498db74d50cb0f22e556/
TeacherTube teachertube 370511 http://www.teachertube.com/video/thats-a-noun-sing-along-hd-version-370511
TED Talks ted bruce_aylward_humanity_vs_ebola_the_winning_strategies_in_a_terrifying_war http://www.ted.com/talks/bruce_aylward_humanity_vs_ebola_the_winning_strategies_in_a_terrifying_war
Tudou tudou mfQXfumwiew http://www.tudou.com/listplay/mfQXfumwiew.html
Twitch twitch - Live Streams twitchvod - Archived Videos on Demand twitchplayspokemon http://www.twitch.tv/twitchplayspokemon
Videomaten videomaten
Vimeo vimeo 105035718 http://vimeo.com/105035718
Vine vine h2B7WMtuX2t https://vine.co/v/h2B7WMtuX2t
Yahoo Screen yahoo katy-perry-dances-sharks-2015-024409668 https://screen.yahoo.com/videos-for-you/katy-perry-dances-sharks-2015-024409668.html
YouTube youtube - Single Videos youtubeplaylist - Playlists pSsYTj9kCHE https://www.youtube.com/watch?v=pSsYTj9kCHE
 https://www.youtube.com/watch?v=CW_PbErQ_c8&list=PL76E80C7F756A2047
Youku youku XODc3NDgzMTY4 http://v.youku.com/v_show/id_XODc3NDgzMTY4.html