Widget:YouTube: Difference between revisions
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...") |
RogueScholar (talk | contribs) (Using aforementioned cosmic powers to make this widget comply with best practices and always load via HTTPS and support the 'start' parameter for defining a timestamp to begin playing at, plus add documentation) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
This widget allows you to add YouTube video player to | This widget allows you to add a [https://developers.google.com/youtube/player_parameters YouTube video player] to wiki pages. | ||
== Using this widget == | |||
To insert this widget, use the following code: | |||
<nowiki>{{#widget:YouTube|id=DWef69ItVrU}}</nowiki> | |||
== | == Parameters == | ||
* '''{{Para|id}}''' - video ID (from the URL) | |||
</noinclude><includeonly><iframe width="<!--{$width|escape:'html'|default:'425'}-->" height="<!--{$height|escape:'html'|default:355}-->" src=" | * '''{{Para|start}}''' - timestamp of starting point within the video in seconds | ||
* '''{{Para|playlist}}''' - playlist name (starts with PL) - first clip is played ({{Para|id}} and {{Para|start}} are ignored) | |||
* '''{{Para|height}}''' and '''{{Para|width}}''' define view dimensions, 425x355 are the defaults</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 isset($start)}-->?start=<!--{$start|escape:'urlpathinfo'}--><!--{/if}--><!--{/if}-->" style="border: none" allowfullscreen></iframe></includeonly> |
Latest revision as of 06:59, 7 November 2022
This widget allows you to add a YouTube video player to wiki pages.
Using this widget
To insert this widget, use the following code:
{{#widget:YouTube|id=DWef69ItVrU}}
Parameters
|id=
- video ID (from the URL)|start=
- timestamp of starting point within the video in seconds|playlist=
- playlist name (starts with PL) - first clip is played (|id=
and|start=
are ignored)|height=
and|width=
define view dimensions, 425x355 are the defaults