模板:视频:修订间差异
外观
| (未显示2个用户的12个中间版本) | |||
| 第1行: | 第1行: | ||
<div class="include-video"> | |||
{{#switch: {{#if: {{{BV|}}}|1|}}{{#if: {{{YTID|}}}|2|}} | {{#switch: {{#if: {{{BV|}}}|1|}}{{#if: {{{YTID|}}}|2|}} | ||
|12 = <!-- 同时有B站和YouTube,显示标签切换 --> | |12 = <!-- 同时有B站和YouTube,显示标签切换 --> | ||
<tabber> | <tabber> | ||
B站视频= | B站视频= | ||
<div class="bilibili-player-link">''' | <div class="bilibili-player-link">'''[https://m.bilibili.com/video/{{{BV}}}?t={{{时间|0}}}&p={{{分P|1}}} {{{标题|B站视频}}}] '''</div> | ||
<div class="iframe-container"> | <div class="iframe-container"> | ||
<htmltag tagname="iframe" class="iframe_video" src="//player.bilibili.com/player.html?bvid={{{BV}}}&p={{{分P|1}}}&autoplay=0&t={{{时间|0}}}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></htmltag> | <htmltag tagname="iframe" class="iframe_video" src="//player.bilibili.com/player.html?bvid={{{BV}}}&p={{{分P|1}}}&autoplay=0&t={{{时间|0}}}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></htmltag> | ||
| 第9行: | 第10行: | ||
|-| | |-| | ||
YouTube视频= | YouTube视频= | ||
<div class="bilibili-player-link">''' | <div class="bilibili-player-link">'''[https://www.youtube.com/watch?v={{{YTID}}}&t={{{YTStart|0}}}s&list={{{YTPlaylist|}}} {{{YT标题|YouTube视频}}}] '''</div> | ||
<div class="iframe-container"> | <div class="iframe-container"> | ||
<htmltag tagname="iframe" class="iframe_video" src="//www.youtube.com/embed/{{{YTID}}}?start={{{YTStart|0}}}&list={{{YTPlaylist|}}}&autoplay=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></htmltag> | <htmltag tagname="iframe" class="iframe_video" src="//www.youtube.com/embed/{{{YTID}}}?start={{{YTStart|0}}}&list={{{YTPlaylist|}}}&autoplay=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></htmltag> | ||
| 第16行: | 第17行: | ||
| 1 = <!-- 只有B站视频 --> | | 1 = <!-- 只有B站视频 --> | ||
<div class="bilibili-player-link">''' | <div class="bilibili-player-link">'''[https://m.bilibili.com/video/{{{BV}}}?t={{{时间|0}}}&page={{{分P|1}}} {{{标题|B站视频}}}] '''</div> | ||
<div class="iframe-container"> | <div class="iframe-container"> | ||
<htmltag tagname="iframe" class="iframe_video" src="//player.bilibili.com/player.html?bvid={{{BV}}}&p={{{分P|1}}}&autoplay=0&t={{{时间|0}}}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></htmltag> | <htmltag tagname="iframe" class="iframe_video" src="//player.bilibili.com/player.html?bvid={{{BV}}}&p={{{分P|1}}}&autoplay=0&t={{{时间|0}}}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></htmltag> | ||
| 第22行: | 第23行: | ||
| 2 = <!-- 只有YouTube视频 --> | | 2 = <!-- 只有YouTube视频 --> | ||
<div class="bilibili-player-link">''' | <div class="bilibili-player-link">'''[https://www.youtube.com/watch?v={{{YTID}}}&t={{{YTStart|0}}}s&list={{{YTPlaylist|}}} {{{标题|YouTube视频}}}] '''</div> | ||
<div class="iframe-container"> | <div class="iframe-container"> | ||
<htmltag tagname="iframe" class="iframe_video" src="//www.youtube.com/embed/{{{YTID}}}?start={{{YTStart|0}}}&list={{{YTPlaylist|}}}&autoplay=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></htmltag> | <htmltag tagname="iframe" class="iframe_video" src="//www.youtube.com/embed/{{{YTID}}}?start={{{YTStart|0}}}&list={{{YTPlaylist|}}}&autoplay=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></htmltag> | ||
| 第30行: | 第31行: | ||
<div style="color: red; text-align: center;">请填写B站BV号(BV参数)或YouTube视频ID(YTID参数)</div> | <div style="color: red; text-align: center;">请填写B站BV号(BV参数)或YouTube视频ID(YTID参数)</div> | ||
}} | }} | ||
</div> | |||
{{#css: | {{#css: | ||
.bilibili-player-link { | .bilibili-player-link { | ||
text-align: center; | text-align: center; | ||
| 第46行: | 第48行: | ||
} | } | ||
.include-video { | |||
margin: 0 auto; | |||
overflow: hidden; | |||
} | |||
.iframe-container { | .iframe-container { | ||
max-width: 75%; | |||
position: relative; | position: relative; | ||
width: 100%; | width: 100%; | ||
height: 0; | height: 0; | ||
padding-bottom: | padding-bottom: 56.25%; | ||
margin: 0 auto; | margin: 0 auto; | ||
} | } | ||
| 第62行: | 第69行: | ||
} | } | ||
@media only screen and (max-width: 767px) { | @media only screen and (max-width: 767px) { | ||
.iframe-container { | .iframe-container { | ||
padding-bottom: | padding-bottom: 56.25%; | ||
} | } | ||
} | } | ||
@media only screen and (min-width: 768px) and (max-width: 991px) { | @media only screen and (min-width: 768px) and (max-width: 991px) { | ||
.iframe-container { | .iframe-container { | ||
padding-bottom: | padding-bottom: 56.25%; | ||
} | } | ||
} | } | ||
.tabberneue > ul { | .tabberneue > ul { | ||
text-align: center; | text-align: center; | ||
| 第98行: | 第103行: | ||
color: #fff; | color: #fff; | ||
} | } | ||
.tabberneue > ul > li.tabberneue-active > a { | .tabberneue > ul > li.tabberneue-active > a { | ||
border-bottom: none; | border-bottom: none; | ||
} | } | ||
}} | }} | ||
<noinclude> | <noinclude> | ||
== 使用说明 == | == 使用说明 == | ||
1. 仅嵌入B站视频 | |||
<pre style="background: #f9f9f9; padding: 10px; border: 1px solid #ddd; border-radius: 4px;"> | |||
<nowiki> | <nowiki> | ||
{{视频 | {{视频 | ||
|BV=视频BV号(必填) | |BV=视频BV号(必填) | ||
|标题= | |标题=视频标题 | ||
|分P=分P数(可选,默认1) | |分P=分P数(可选,默认1) | ||
|时间=开始秒数(可选,默认0) | |时间=开始秒数(可选,默认0) | ||
}} | }} | ||
</nowiki> | </nowiki> | ||
</pre> | |||
2. 仅嵌入YouTube视频 | |||
<pre style="background: #f9f9f9; padding: 10px; border: 1px solid #ddd; border-radius: 4px;"> | |||
<nowiki> | <nowiki> | ||
{{视频 | {{视频 | ||
|YTID=YouTube视频ID(必填,如https://youtu.be/ABC123 中的 ABC123) | |YTID=YouTube视频ID(必填,如https://youtu.be/ABC123 中的 ABC123) | ||
| | |YT标题=视频标题 | ||
|YTStart=开始秒数(可选,默认0) | |YTStart=开始秒数(可选,默认0) | ||
|YTPlaylist=播放列表ID(可选,对应分P) | |YTPlaylist=播放列表ID(可选,对应分P) | ||
}} | }} | ||
</nowiki> | </nowiki> | ||
</pre> | |||
3. 同时嵌入B站+YouTube(自动显示切换标签) | |||
<pre style="background: #f9f9f9; padding: 10px; border: 1px solid #ddd; border-radius: 4px;"> | |||
<nowiki> | <nowiki> | ||
{{视频 | {{视频 | ||
|BV=B站BV号 | |BV=B站BV号 | ||
|YTID=YouTube视频ID | |YTID=YouTube视频ID | ||
|标题= | |标题=B站视频标题 | ||
|YT标题=Youtube视频标题 | |||
|分P=B站分P(可选) | |分P=B站分P(可选) | ||
|时间=B站开始秒数(可选) | |时间=B站开始秒数(可选) | ||
| 第138行: | 第149行: | ||
}} | }} | ||
</nowiki> | </nowiki> | ||
</pre> | |||
</noinclude> | </noinclude> | ||
2026年3月4日 (三) 09:35的版本
请填写B站BV号(BV参数)或YouTube视频ID(YTID参数)
使用说明
1. 仅嵌入B站视频
{{视频
|BV=视频BV号(必填)
|标题=视频标题
|分P=分P数(可选,默认1)
|时间=开始秒数(可选,默认0)
}}
2. 仅嵌入YouTube视频
{{视频
|YTID=YouTube视频ID(必填,如https://youtu.be/ABC123 中的 ABC123)
|YT标题=视频标题
|YTStart=开始秒数(可选,默认0)
|YTPlaylist=播放列表ID(可选,对应分P)
}}
3. 同时嵌入B站+YouTube(自动显示切换标签)
{{视频
|BV=B站BV号
|YTID=YouTube视频ID
|标题=B站视频标题
|YT标题=Youtube视频标题
|分P=B站分P(可选)
|时间=B站开始秒数(可选)
|YTStart=YouTube开始秒数(可选)
|YTPlaylist=YouTube播放列表(可选)
}}