哔哩哔哩动画
# 介绍
可以插入 bilibili 视频
# 使用
<Bilibili bvid="BV1zt411t79A" />
1
# 参数
以下为默认参数,默认参数可省略
<Bilibili
bvid="BV1zt411t79A"
:page="1"
:danmaku="true"
:sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts allow-popups"
:allowfullscreen="allowfullscreen"
width="100%"
:height="[9 / 16, 70]"
/>
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
height 为播放器高度,对应 css 高度计算为: width * height[0] + height[1]
# 配置
主题下插件配置为默认配置,每个 <Bilibili />
标签下的设置会覆盖默认配置。
module.exports = {
plugins: [
[
"smplayer",
{
bilibili: {
page: 1,
danmaku: !0,
allowfullscreen: "allowfullscreen",
sandbox:
"allow-top-navigation allow-same-origin allow-forms allow-scripts allow-popups",
width: "100%",
height: [9 / 16, 70],
},
},
],
],
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
或
module.exports = {
plugins: {
smplayer: {
bilibili: {
page: 1,
danmaku: !0,
allowfullscreen: "allowfullscreen",
sandbox:
"allow-top-navigation allow-same-origin allow-forms allow-scripts allow-popups",
width: "100%",
height: [9 / 16, 70],
},
},
},
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 高清
如需嵌入高清视频,可使用第三方视频解析,例如 https://busiyi.notion.site/B-1080P-Notion-88315db1b76f4e72a610e4e692cd8f96
<ClientOnly>
<DPlayer :src="dplayerDan" />
</ClientOnly>
<script>
export default {
data() {
return {
dplayerDan: {
video: {
url: "https://video-direct-link.vercel.app/bili.mp4?aid=810872&bvid=BV1Js411o76u&cid=1176840",
},
danmaku: {
addition: [
"https://danmu.u2sb.com/api/dplayer/v3/bilibili/av810872",
],
},
},
};
},
};
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
上次更新: 10/4/2022, 11:21:17 PM