Widget:YouTube: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
Marcus (talk | contribs)
m Categorised
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>
This widget allows you to embed a YouTube video player in a wiki page.
This widget allows you to add a [https://developers.google.com/youtube/player_parameters YouTube video player] to your wiki page.


== Usage ==
== Using this widget ==
You can insert a video with the following wiki code:
For information on how to use this widget, see the [http://www.mediawikiwidgets.org/YouTube widget description page on MediaWikiWidgets.org].


<nowiki>{{#widget:YouTube|id=DWef69ItVrU}}</nowiki>
== Copy to your site ==
 
To use this widget on your site, just install the [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and the copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki, as an article called '''{{FULLPAGENAME}}'''.
=== Parameters ===
</noinclude><includeonly><iframe width="<!--{$width|escape:'html'|default:'425'}-->" height="<!--{$height|escape:'html'|default:355}-->" src="https://www.youtube.com/embed/<!--{if isset($playlist)}-->?listType=playlist&list=<!--{$playlist|escape:'urlpathinfo'}--><!--{else}--><!--{$id|escape:'urlpathinfo'}--><!--{/if}-->" frameborder="0" allowfullscreen></iframe></includeonly>
;id
: The video ID.  This can be found in the YouTube video's URL, for example: <code><nowiki>http://</nowiki>www.youtube.com/watch?v='''''DWef69ItVrU'''''</code>
;width
: Width of the video player in pixels (default 480).
;height
: Height of the video player in pixels (default 385).
 
For 16:9 video you will get better results by setting the size to 640×385.
 
== Example ==
{{#widget:YouTube|id=DWef69ItVrU}}
 
[[Category:Help]]
</noinclude><includeonly><object width="<!--{$width|escape:'html'|default:'480'}-->" height="<!--{$height|escape:'html'|default:385}-->"><param name="movie" value="http://www.youtube.com/v/<!--{$id|escape:'urlpathinfo'}-->"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/<!--{$id|escape:'urlpathinfo'}-->" type="application/x-shockwave-flash" wmode="transparent" width="<!--{$width|escape:'html'|default:'480'}-->" height="<!--{$height|escape:'html'|default:385}-->"></embed></object></includeonly>

Revision as of 14:23, 8 June 2014

This widget allows you to add a YouTube video player to your wiki page.

Using this widget

For information on how to use this widget, see the widget description page on MediaWikiWidgets.org.

Copy to your site

To use this widget on your site, just install the MediaWiki Widgets extension and the copy full source code of this page to your wiki, as an article called Widget:YouTube.