Widget

Video: Difference between revisions

(try with parameters)
(add documentation on how to center the div)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<iframe width="560" height="315" src="https://www.youtube.com/embed/<!--{$videoID|default:D46KCQNDMaM}-->" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<div style="text-align:center">
<iframe width="560" height="315" align="middle" src="https://www.youtube.com/embed/<!--{$videoID|default:D46KCQNDMaM}-->" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div>


<noinclude>
<noinclude>
<iframe id="ytplayer" type="text/html" width="640" height="360"
  src="https://www.youtube.com/embed/D46KCQNDMaM7"
  frameborder="0"></iframe>
<iframe id="ytplayer" type="text/html" width="640" height="360"
  src="https://www.youtube.com/embed/<!--{$videoId|default:D46KCQNDMaM7}-->?autoplay=1&origin=https://graphit.ur.de"
  frameborder="0"></iframe>


= Usage =
= Usage =
Embed a YouTube Video using a iframe
Embed a YouTube Video using a iframe
* '''videoId:''' The video id of a youtube link (e.g. for: https://www.youtube.com/watch?v=D46KCQNDMaM7 its 'D46KCQNDMaM7')
* '''videoId:''' The video Id of a youtube link (e.g. for: https://www.youtube.com/watch?v=D46KCQNDMaM7 its 'D46KCQNDMaM7')
 


<pre style="background-color:#F5F5F5">
<pre style="background-color:#F5F5F5">
{{#widget:Video|videoId=D46KCQNDMaM7}}
{{#widget:Video|videoId=D46KCQNDMaM7}}
</pre>
</pre>
Notes:
* see also: [https://developers.google.com/youtube/player_parameters?hl=de IFrame Player API]
* to generate a similiar snippet as above, go to the share button and click embed (you can remove the ''si=xyz'' stuff)
* if you want to '''center the video''' you can wrap the wrap the widget in a div, like: <pre><div style:"text-align:center"> {{#widget}} </div> </pre>
</noinclude>
</noinclude>

Latest revision as of 14:54, 17 November 2025

<iframe width="560" height="315" align="middle" src="https://www.youtube.com/embed/" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>


Usage

Embed a YouTube Video using a iframe


{{#widget:Video|videoId=D46KCQNDMaM7}}


Notes:

  • see also: IFrame Player API
  • to generate a similiar snippet as above, go to the share button and click embed (you can remove the si=xyz stuff)
  • if you want to center the video you can wrap the wrap the widget in a div, like:
    <div style:"text-align:center"> {{#widget}} </div>