mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
parent
7c18801804
commit
b86406e61d
2
min/bpx-player-adaptor.min.js
vendored
2
min/bpx-player-adaptor.min.js
vendored
@ -1 +1 @@
|
||||
(()=>(e,t)=>{const n=async()=>{const e=await SpinQuery.select(".bpx-player-container");if(!e){console.warn("[bpx player polyfill] bpxContainer not found");return}Observer.attributes(e,(()=>{const t=e.getAttribute("data-screen");document.body.classList.toggle("player-mode-webfullscreen",t==="full"||t==="web");document.body.classList.toggle("player-mode-widescreen",t==="wide")}))};const o=async()=>{const e=await SpinQuery.select((()=>unsafeWindow.$pbp));if(!e){console.warn("[bpx player polyfill] pbp not found");return}const t={aid:e.options.aid.toString(),cid:e.options.cid.toString(),bvid:e.options.bvid};if(Object.values(t).some((e=>e===""||parseInt(e)<=0))){console.warn("[bpx player polyfill] invalid pbp data")}Object.assign(unsafeWindow,t)};const i=async()=>{if(!document.URL.startsWith("https://www.bilibili.com/bangumi/play/")){return}n();o()};return{export:{bpxPlayerPolyfill:i}}})();
|
||||
(()=>(e,t)=>{const n=async()=>{const e=await SpinQuery.select(".bpx-player-container");if(!e){console.warn("[bpx player polyfill] bpxContainer not found");return}Observer.attributes(e,(()=>{const t=e.getAttribute("data-screen");document.body.classList.toggle("player-mode-webfullscreen",t==="full"||t==="web");t==="wide"?document.body.classList.add("player-mode-widescreen"):""}))};const o=async()=>{const e=await SpinQuery.select((()=>unsafeWindow.$pbp));if(!e){console.warn("[bpx player polyfill] pbp not found");return}const t={aid:e.options.aid.toString(),cid:e.options.cid.toString(),bvid:e.options.bvid};if(Object.values(t).some((e=>e===""||parseInt(e)<=0))){console.warn("[bpx player polyfill] invalid pbp data")}Object.assign(unsafeWindow,t)};const i=async()=>{if(!document.URL.startsWith("https://www.bilibili.com/bangumi/play/")){return}n();o()};return{export:{bpxPlayerPolyfill:i}}})();
|
||||
@ -8,7 +8,7 @@ const playerModePolyfill = async () => {
|
||||
Observer.attributes(bpxContainer, () => {
|
||||
const dataScreen = bpxContainer.getAttribute('data-screen')
|
||||
document.body.classList.toggle('player-mode-webfullscreen', dataScreen === 'full' || dataScreen === 'web')
|
||||
document.body.classList.toggle('player-mode-widescreen', dataScreen === 'wide')
|
||||
dataScreen === 'wide' ? document.body.classList.add('player-mode-widescreen') : ''
|
||||
})
|
||||
}
|
||||
const idPolyfill = async () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user