实际效果:

实现方法:

示例代码:

<iframe src="//player.bilibili.com/player.html?aid=89080096&bvid=BV197411g746&cid=161365497&page=1&danmaku=0" allowfullscreen="allowfullscreen" width="100%" height="500" scrolling="no" frameborder="0" sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts"></iframe>

使用方法:

将 aid 属性 bvid 属性 cid 属性的值替换为相应视频的值

如何获取相应视频 aid bvid cid 属性的值?

可以使用 BiliBili 官方提供的 iframe 代码获取
在网页端打开相应视频,找到分享按钮,复制嵌入代码,这里面就有视频的 aid bvid cid 属性值,将其替换到代码块中即可
[alt type="warning"]注意:代码不能有换行,否则代码将失效[/alt]

最后修改:2024 年 01 月 19 日
如果觉得我的文章对你有用,请随意赞赏