0

哔哩哔哩小窗

 2 years ago
source link: https://paugram.com/help/bili
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

使用方法:

在你的网页上插入 iframe 标签,并将本 API 的地址 https://api.paugram.com/bili/?av=视频 AV 号 填写在 src 属性里即可食用。

如果您已开始使用本 API 服务,则默认视为遵守 本约定

参数 要求 描述 av 二选一 有效的 AV 号 可以在 B 站上正常打开访问的视频 bv 二选一 有效的 BV 号 可以在 B 站上正常打开访问的视频 style white gray black 指定展示内容的风格和样式
参数名称 描述 {默认} 不填写本参数,默认为透明背景 white 白色背景,搭配灰色背景的网页 gray 浅灰色背景,搭配白色背景的网页 black 深黑色背景,搭配深色系(包括夜间模式)的网页

获得视频 av39027441 的结果,并且改为灰色背景样式

<iframe src="https://api.paugram.com/bili?av=39027441&style=gray" style="height: 10em; width: 100%"></iframe>

得到的结果效果如下:

获得视频 av69269716 的结果,并且改为黑色背景样式

<iframe src="https://api.paugram.com/bili?av=69269716&style=black" style="height: 10em; width: 100%"></iframe>

得到的结果效果如下:

获得视频 BV19f4y1k7eN 的结果,并且改为白色背景样式

<iframe src="https://api.paugram.com/bili?bv=BV19f4y1k7eN&style=white" style="height: 10em; width: 100%"></iframe>

得到的结果效果如下:

常见问题:

为什么我用以上代码,插入进网页会出现滚动条?

答:因为页面设计使用的是相对单位,默认以 16px 为基准,将上方的 height: 10em 替换成 height: 160px 就可以解决这个问题了。

BiliBili


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK