Template:YouTube: Difference between revisions
No edit summary |
No edit summary |
||
| (22 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><div style="width | <includeonly><div style="float:{{{3|left}}};" itemprop="video" itemtype="https://schema.org/VideoObject" itemscope> | ||
{{#ask: [[YouTube video ID::{{{1}}}]] | {{#widget:YouTube|id={{{1}}}|width={{#switch:{{{2}}}|small=356|medium=560|big=640|large=854|100%}}}} | ||
{{#get_web_data:url=https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&id={{{1}}}&key=AIzaSyC-zQp-SoOYbKh64GrNhBK5D3g7H9oX7Zs|format=json}} | |||
<!-- mandatory properties for google rich snippets --> | |||
<meta itemprop="name" content="{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{1}}}]] |link=none |default={{#external_value:title}} }}"/> | |||
<meta itemprop="description" content="{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{1}}}]] |link=none |default={{#external_value:title}} }} on YouTube." /> | |||
<meta itemprop="thumbnailUrl" content="https://i.ytimg.com/vi/{{{1}}}/maxresdefault.jpg" /> | |||
<meta itemprop="uploadDate" content="{{#external_value:publishedat}}" /> | |||
<meta itemprop="embedUrl" content="https://www.youtube.com/embed/{{{1}}}?controls=2&modestbranding=1&rel=0" /> | |||
<!-- non-mandatory properties for google rich snippets --> | |||
<meta itemprop="duration" content="{{#external_value:duration}}" /> | |||
</div>{{#if: {{{4|}}} | | <br style="clear:{{{3|left}}};" /> }}{{#ifeq: | |||
{{#ask: [[Category:YouTube videos]] [[YouTube video ID::{{{1}}}]] | |||
|?YouTube video ID= | |?YouTube video ID= | ||
| headers=hide | | headers=hide | ||