本文最后更新于 666 天前,其中的信息可能已经有所发展或是发生改变。
接入B站iframe视频
在 WordPress 文章中添加一个自定义 html 区块,复制粘贴下列代码并修改与视频对应 BV 号即可(写在代码中的 bvid=
后)。
<iframe id="bilibili_player" src="//player.bilibili.com/player.html?bvid=要播放的视频BV号&&page=1&as_wide=1&high_quality=1&danmaku=0" allowfullscreen="allowfullscreen" width="100%" height="500" scrolling="no" frameborder="0" sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts">
<span data-mce-type="bookmark" style="display: inline-block; width: 0px;
overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>
</iframe>
<script type="text/javascript"> document.getElementById("bilibili_player").style.height=document.getElementById("bilibili_player").scrollWidth*0.76+"px"; </script>
效果如下所示: