社区文档构建进行中,欢迎编辑。社区答疑群(非官方):717421103

全站通知:

Widget:Biliplayer

来自WIKI实验室WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

<script> (window.RLQ = window.RLQ || []).push(['jquery', () => {

   $(document).ready(function () {
       var moshi = ``;
       var ua = navigator.userAgent.toLowerCase();
       var shebei = ""
       if (/android|adr/gi.test(ua)) {
           shebei = "android"
       }
       if (/\(i[^;]+;( U;)? CPU.+Mac OS X/gi.test(ua)) {
           shebei = "ios"
       }
       if (/iPad/gi.test(ua)) {
           shebei = "ios"
       }
       if (/windows nt/.test(ua)) {
           shebei = "pc"
       }
       if (window.biliplayerWc == undefined) {
           window.biliplayerWc = 0;
       }
       if (moshi == ``) { moshi = `1`; }
       switch (moshi) {
           case `1`: {
               var element = document.querySelector(`.biliplayerW-dom#d`)
               element.setAttribute('id', `bilip${window.biliplayerWc}`);
               if (shebei == "pc") {

document.querySelector(`.biliplayerW-dom#bilip${window.biliplayerWc}`).innerHTML = `

<iframe name="video-frame" src="https://bili-proxy.biligame.com/www/blackboard/newplayer.html?bvid=&p=&autoplay=0" frameborder="no" scrolling="no" allowfullscreen="" style="width: 100%;height: 100%;"></iframe>

`

               } else {

document.querySelector(`.biliplayerW-dom#bilip${window.biliplayerWc}`).innerHTML = `

<iframe name="video-frame" src="https://www.bilibili.com/blackboard/html5mobileplayer.html?bvid=&p=&autoplay" frameborder="no" scrolling="no" allowfullscreen="" style="width: 100%;height: 100%;"></iframe>

`

               }
               break;
           }
           case `2`: {
               var Bvid = ``;
               var Pname = ``;
               biliplayerWc1 = window.biliplayerWc;
               var element = document.querySelector(`.biliplayerW-dom#d`)
               element.setAttribute('id', `bilip${window.biliplayerWc}`);
               iframevideo1(Bvid,Pname,biliplayerWc1);
               break;
           }
       }
       window.biliplayerWc = window.biliplayerWc + 1;
       function iframevideo1(b, p, i) {
           $.get(`https://api.bilibili.com/x/web-interface/view?bvid=${b}`).then(function (result) {
               var queryData = result.data.pages.filter(function (_data) {
                   return _data.part == p;
               });
               if (shebei == "pc") {

document.querySelector(`.biliplayerW-dom#bilip${i}`).innerHTML = `

<iframe name="video-frame" src="https://bili-proxy.biligame.com/www/blackboard/newplayer.html?bvid=${Bvid}&p=${queryData[0].page}&autoplay=0" frameborder="no" scrolling="no" allowfullscreen="" style="width: 100%;height: 100%;"></iframe>

`

               } else {

document.querySelector(`.biliplayerW-dom#bilip${i}`).innerHTML = `

<iframe name="video-frame" src="https://www.bilibili.com/blackboard/html5mobileplayer.html?bvid=${Bvid}&p=${queryData[0].page}&autoplay" frameborder="no" scrolling="no" allowfullscreen="" style="width: 100%;height: 100%;"></iframe>

`

               }
           });
       }
       
   })

}]); </script>