(()=>(e,o)=>{const n={include:["//www.bilibili.com/video/","//www.bilibili.com/bangumi/"]};const t="showCoverBeforePlayStyle";let i;const r=()=>{if(n.include.every((e=>!document.URL.includes(e)))){return}o.applyStyle(t);const e=()=>document.body.style.removeProperty("--cover-url");const r=unsafeWindow.__ENABLE_WASM_PLAYER__||dq("bwp-video");const c=r?BwpElement.prototype:HTMLVideoElement.prototype;const l=c.play;c.play=function(...o){e();return l.call(this,...o)};const s=async()=>{const e=await SpinQuery.select((()=>unsafeWindow.aid));if(!e){console.warn("[播放前显示封面] 未找到av号");return}const{cid:n}=unsafeWindow;if(n===i||!n){return}i=n;const{VideoInfo:t}=await o.importAsync("video-info");const r=new t(e);await r.fetchInfo();document.body.style.setProperty("--cover-url",`url('${r.coverUrl}')`)};Observer.videoChange(s)};r();return{reload:()=>o.applyStyle(t),unload:()=>o.removeStyle(t)}})();