Difference between revisions of "Template:Bilibili"

From Team Fortress Wiki
Jump to: navigation, search
m
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="youtubebox ratio-{{{ratio|16x9}}} widths-{{{width|512}}}" style="margin:0.75em 0em;"><div class="embedvideo autoResize">{{#if: {{{align|}}}|<div class="embedvideowrap bilibili-video" data-vbvid="{{{1|}}}" data-vdanmaku="{{{danmaku|0}}}" data-vwidth="{{{width|640}}}" data-vheight="{{{height|360}}}" style="text-align: {{{align|}}}"></div>|<div class="embedvideowrap bilibili-video" data-vbvid="{{{1|}}}" data-vdanmaku="{{{danmaku|0}}}" data-vwidth="{{{width|640}}}" data-vheight="{{{height|360}}}"></div>}}</div>{{#if:{{{2|<noinclude>yes</noinclude>}}}| <br /><div>{{hatnote|1={{{2|Caption here.}}}}}}}</div><noinclude>
+
<div class="youtubebox ratio-{{{ratio|16x9}}} widths-{{{width|512}}}" style="margin:0.75em 0em;"><div class="embedvideo autoResize">{{#if: {{{align|}}}|<div class="embedvideowrap bilibili-video" data-vaid="{{#expr:{{{1|294688464}}}}}" data-vdanmaku="{{#expr:{{{danmaku|0}}}}}" data-vpage="{{#expr:{{{page|1}}}}}" data-vwidth="{{#expr:{{{width|640}}}}}" data-vheight="{{#expr:{{{height|360}}}}}" style="text-align: {{{align|left}}}"></div>|<div class="embedvideowrap bilibili-video" data-vaid="{{#expr:{{{1|294688464}}}}}" data-vdanmaku="{{#expr:{{{danmaku|0}}}}}" data-vpage="{{#expr:{{{page|1}}}}}" data-vwidth="{{#expr:{{{width|640}}}}}" data-vheight="{{#expr:{{{height|360}}}}}"></div>}}</div>{{#if:{{{2|<noinclude>yes</noinclude>}}}| <br /><div>{{hatnote|1={{{2|Caption here.}}}}}}}</div><noinclude>
 
{{Doc begin}}
 
{{Doc begin}}
 
This template will embed a Bilibili video inside an article.
 
This template will embed a Bilibili video inside an article.
  
 
=== Usage ===
 
=== Usage ===
* <code><nowiki>{{bilibili|Bilibili bvid}}</nowiki></code> produces: {{bilibili|bv1mQ4y1M7Cn}}
+
* <code><nowiki>{{bilibili|710126347}}</nowiki></code> produces: {{bilibili|710126347}}
* <code><nowiki>{{bilibili|Bilibili bvid|Caption here.|width=value|height=value|align=alignment}}</nowiki></code> produces: {{bilibili|BV15W411T7En|Ready Up: Competitive Team Fortress 2 Documentary|width=512|height=320|align=center}}
+
* <code><nowiki>{{bilibili|21525619|Ready Up: Competitive Team Fortress 2 Documentary|width=512|height=320|align=center}}</nowiki></code> produces: {{bilibili|21525619|Ready Up: Competitive Team Fortress 2 Documentary|width=512|height=320|align=center}}
* <code><nowiki>{{bilibili|Bilibili bvid|danmaku=1}}</nowiki></code> produces: {{bilibili|BV1bE411V7UT|danmaku=1}}
+
* <code><nowiki>{{bilibili|96157214|danmaku=1}}</nowiki></code> produces: {{bilibili|96157214|danmaku=1}}
 +
* <code><nowiki>{{bilibili|710381282|page=6}}</nowiki></code> produces: {{bilibili|710381282|page=6}}
  
 
=== Parameters ===
 
=== Parameters ===
; Bilibili bvid (required): The Bilibili video id of the video to include.
+
; Bilibili aid (<span style="color: red">required</span>): This is the Bilibili video ID of the video you want to display.
; {{code|Caption}}: Custom caption to include.
+
:: You can find this information by [https://i.imgur.com/A4KY931.png copying the iframe code] and searching for the "aid" parameter or though the [https://api.bilibili.com/x/web-interface/view?bvid= Web Interface] ("bvid" can be found in the URL: <nowiki>https://www.bilibili.com/video/</nowiki><span style="color: red">BV1mQ4y1M7Cn</span>).
; {{code|width}}: Width of the video, in pixels. Default is 640px.
+
; Caption: Custom caption to include.
; {{code|height}}: Height of the video, in pixels. Default is 360px.
+
; {{code|width}}: Width of the video, in pixels. Default is '''640'''.
; {{code|align}}: Horizontal alignment of video. Default is left.
+
; {{code|height}}: Height of the video, in pixels. Default is '''360'''.
; {{code|danmaku}}: Bullet screen/danmaku subtitles. Default is 0 (disabled).
+
; {{code|align}}: Horizontal alignment of video. Default is '''left'''.
 +
; {{code|danmaku}}: Bullet screen/danmaku subtitles. Default is '''0''' (disabled).
 +
; {{code|page}}: Videos uploaded in a playlist format share the same ID, you can use this parameter to specify which video to display. Default is '''1''' (first video).
  
 
=== See also ===
 
=== See also ===

Latest revision as of 00:53, 13 July 2023


Caption here.

Documentation for Bilibili

This template will embed a Bilibili video inside an article.

Usage

  • {{bilibili|710126347}} produces:
  • {{bilibili|21525619|Ready Up: Competitive Team Fortress 2 Documentary|width=512|height=320|align=center}} produces:

    Ready Up: Competitive Team Fortress 2 Documentary
  • {{bilibili|96157214|danmaku=1}} produces:
  • {{bilibili|710381282|page=6}} produces:

Parameters

Bilibili aid (required)
This is the Bilibili video ID of the video you want to display.
You can find this information by copying the iframe code and searching for the "aid" parameter or though the Web Interface ("bvid" can be found in the URL: https://www.bilibili.com/video/BV1mQ4y1M7Cn).
Caption
Custom caption to include.
width
Width of the video, in pixels. Default is 640.
height
Height of the video, in pixels. Default is 360.
align
Horizontal alignment of video. Default is left.
danmaku
Bullet screen/danmaku subtitles. Default is 0 (disabled).
page
Videos uploaded in a playlist format share the same ID, you can use this parameter to specify which video to display. Default is 1 (first video).

See also