Widget:YouTube: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
Created page with "<noinclude> This widget allows you to add YouTube video player to your wiki page. It was created by [http://www.mediawikiwidgets.org/User:Yaron_Koren Yaron Koren]. == Using thi..."
 
No edit summary
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
This widget allows you to add YouTube video player to your wiki page.
This widget allows you to embed a YouTube video player in a wiki page.


It was created by [http://www.mediawikiwidgets.org/User:Yaron_Koren Yaron Koren].
== Usage ==
You can insert a video with the following wiki code:


== Using this widget ==
<nowiki>{{#widget:YouTube|id=DWef69ItVrU}}</nowiki>
For information on how to use this widget, see [http://www.mediawikiwidgets.org/YouTube widget description page on MediaWikiWidgets.org].


== Copy to your site ==
=== Parameters ===
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
;id
</noinclude><includeonly><object width="<!--{$width|escape:'html'|default:'425'}-->" height="<!--{$height|escape:'html'|default:355}-->"><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:'425'}-->" height="<!--{$height|escape:'html'|default:355}-->"></embed></object></includeonly>
: 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 640).
;height
: Height of the video player in pixels (default 355).
;start
: Start position of the video
For 5:4 video you will get better results by setting the size to 480×385.
 
== Example ==
{{#widget:YouTube|id=DWef69ItVrU}}
[[Category:Widget]]
[[Category:Help]]
</noinclude><includeonly><iframe width="<!--{$width|escape:'html'|default:'640'}-->" 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 isset($start)}-->?start=<!--{$start}--><!--{/if}--><!--{/if}-->" frameborder="0" allowfullscreen></iframe></includeonly>

Latest revision as of 07:25, 6 April 2019

This widget allows you to embed a YouTube video player in a wiki page.

Usage

You can insert a video with the following wiki code:

{{#widget:YouTube|id=DWef69ItVrU}}

Parameters

id
The video ID. This can be found in the YouTube video's URL, for example: http://www.youtube.com/watch?v=DWef69ItVrU
width
Width of the video player in pixels (default 640).
height
Height of the video player in pixels (default 355).
start
Start position of the video

For 5:4 video you will get better results by setting the size to 480×385.

Example