Widget:Bilibili
来自音MAD维基
更多语言
更多操作
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=100% height=100% src=""></iframe> <script type="text/javascript"> RLQ.push([["jquery"],function () { $("div[class=bilibili]").each( function(){
let iframe = $(this).children("iframe");
let id = $(this).attr("data-id").substring(2);
id = isNaN(id) ? "?bvid=" + id : "?aid=" + id;
let p = $(this).attr("data-p")
p = !isNaN(p) && parseInt(p) > 1 ? "&p=" + $(this).attr("data-p") : "";
let time = $(this).attr("data-t");
time = !isNaN(time) && parseInt(time) > 0 ? "&t=" + $(this).attr("data-t") : "";
let autoplay = "&autoplay=" + $(this).attr("data-autoplay");
let hclass = "bilibili-" + $(this).attr("data-class");
iframe.attr("src","//player.bilibili.com/player.html"+id+p+time+autoplay);
$(this).attr("class", hclass);
});
}]); </script>