Template:BilibiliVideo

From Moegirlpedia
Jump to: navigation, search
Template-info.svg Template Documentation  [View] [Edit] [History] [Refresh]
Name Bilibili Video Widget
Author 加大号的猫
Revisor Boxsnake
Re-revisor AnnAngela
Re-revisor for html5
Re-re-revisor for new html5
Mobile support XYZ指示物
Copyright Agreement MIT
Release Date

June 29, 2012, first version released.
February 6, 2015, updated.
November 29, 2016, updated with more details.
April 10, 2017 update to html5 version (many thanks for debugging_(:зゝ∠)_).
January 27, 2020, updated to the new html5 player.

Release URL https://zh.moegirl.org.cn/Widget:BilibiliVideo && https://zh.moegirl.org.cn/Template:BilibiliVideo
Notes. If you have any questions, please contact the author.
Usage: {{BilibiliVideo|id=BV177411m75s}}

{{BilibiliVideo|title=视频|id=6988716|pagename=2016WCS世界总决赛 决赛 ByuN VS Dark-1|width=47.5em|height=31.5em|max-width=47.5em|max-height=31.5em|subtitle=true|t=100}}

Example:
Wide ModeShow
Wide ModeShow

Parameters

Necessary parameter
id the avid/bvid of the video (necessary parameter) (It is not recommended to omit the beginning av or bv)
  • if the id is 【av + one to nine pure digits】 or 【one to nine pure digits】 then it is treated as avid.
  • If the id is 【bv + ten digits or letters】 or 【ten digits or letters】 then it is treated as bvid.
  • Error is reported if neither of the above is matched.
Optional parameters
  1. video title
    • title video title, optional, it will automatically get the video title by default
  2. video pages
    • page' If the video has pagination, you can specify the number of pages by this parameter, optional, defaults to 1
    • pagename' If the video has pagination, you can specify the number of pages by this parameter, optional, defaults to empty
    • subtitle' If the video has pagination, you can specify the pagination title to be displayed by setting this parameter as true, optional, defaults to false
  3. Autoplay
    • t Set the timing where the video starts to play in seconds (e.g. 01:40 is recorded as (1×60+40=)100, but it may not start at the exact set time due to the video file structure) (after setting this parameter the video will automatically play after the viewer clicks [show video], but please note that it may not automatically play the video under high version Chrome but only automatically play comments =。=)
    • autoexpand as true, the video will be auto expanded if it’s without the parameter t
  4. Sizes
    • width' video width, optional, defaults to 665px
    • height' video height, optional, defaults to 441px
    • max-width' the maximum width of the video, optional, defaults to 665px
    • max-height the maximum height of the video, optional, defaults to 441px
The above four length values are only accepted in 【positive (positive integer or positive decimal), unit being null (considered as px) or one of px, pc, pt, em, ex, ch, rem, vw, vh, vmin, vmax, cm, mm, Q, in, %

Others

Please do not add too many to a same page as the video information is obtained directly from bilibili. Otherwise, if the user doesn’t login bilibili, the information will not be available for the latter templates due to speed limitation.
To simplify, you can also use the {{bv}} template.