Widget:YouTube: Difference between revisions

From SMO.wiki
Added optional float parameter
Attempt to have different default size for float videos
Line 9: Line 9:
== Copy to your site ==
== Copy to your site ==
To use this widget on your site, just install the [https://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}}'''.
To use this widget on your site, just install the [https://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}}'''.
</noinclude><includeonly><iframe width="<!--{$width|escape:'html'|default:'600'}-->" style="aspect-ratio: <!--{$aspect|escape:'html'|default:16/9}-->;<!--{if isset($float)}--> float: right; margin-bottom: 0.5em; margin-left: 1em;<!--{/if}-->" 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>
</noinclude><includeonly><iframe width="<!--{$width|escape:'html'|default:'<!--{if isset($float)}-->600<!--{else}-->400<!--{/if}-->'}-->" style="aspect-ratio: <!--{$aspect|escape:'html'|default:16/9}-->;<!--{if isset($float)}--> float: right; margin-bottom: 0.5em; margin-left: 1em;<!--{/if}-->" 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>

Revision as of 04:03, 22 January 2023

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

Created by Yaron Koren and extended by Karsten Hoffmeyer.

Using this widget

For information on how to use this widget, see the widget description page on MediaWikiWidgets.org. Note that the height parameter is replaced with aspect (for aspect ratio).

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.