diff --git a/min/no-live-autoplay.min.js b/min/no-live-autoplay.min.js index 779afa8c9..94a4f7580 100644 --- a/min/no-live-autoplay.min.js +++ b/min/no-live-autoplay.min.js @@ -1 +1 @@ -(()=>(e,i)=>{(async()=>{const e=document.URL.replace(window.location.search,"");if(e!=="https://live.bilibili.com/"&&e!=="https://live.bilibili.com/index.html"){return}SpinQuery.condition((()=>document.querySelector(".component-ctnr video,.bilibili-live-player-video video")),(e=>e&&!e.paused),(()=>{const e=dq(".live-web-player-controller .left-area > :first-child");e===null||e===void 0?void 0:e.click()}));const i="hide-home-live-style";addSettingsListener("hideHomeLive",(e=>{if(e===true){const e=document.createElement("style");e.innerText=`.player-area-ctnr,#player-header { display: none !important }`;e.id=i;document.body.append(e)}else{const e=document.getElementById(i);e&&e.remove()}}),true)})()})(); \ No newline at end of file +(()=>(e,t)=>{(async()=>{const e=document.URL.replace(window.location.search,"");if(e!=="https://live.bilibili.com/"&&e!=="https://live.bilibili.com/index.html"){return}SpinQuery.select("video").then((e=>e.pause()));const t="hide-home-live-style";addSettingsListener("hideHomeLive",(e=>{if(e===true){const e=document.createElement("style");e.innerText=`.player-area-ctnr,#player-header { display: none !important }`;e.id=t;document.body.append(e)}else{const e=document.getElementById(t);e&&e.remove()}}),true)})()})(); \ No newline at end of file diff --git a/src/live/no-live-autoplay.ts b/src/live/no-live-autoplay.ts index 42cab9a7e..c128812bb 100644 --- a/src/live/no-live-autoplay.ts +++ b/src/live/no-live-autoplay.ts @@ -3,14 +3,15 @@ if (url !== 'https://live.bilibili.com/' && url !== 'https://live.bilibili.com/index.html') { return } - SpinQuery.condition( - () => document.querySelector('.component-ctnr video,.bilibili-live-player-video video'), - (video: HTMLVideoElement) => video && !video.paused, - () => { - const button = dq('.live-web-player-controller .left-area > :first-child') as HTMLElement - button?.click() - } - ) + // SpinQuery.condition( + // () => document.querySelector('.component-ctnr video,.bilibili-live-player-video video'), + // (video: HTMLVideoElement) => video && !video.paused, + // () => { + // const button = dq('.live-web-player-controller .left-area > :first-child') as HTMLElement + // button?.click() + // } + // ) + SpinQuery.select('video').then((video: HTMLVideoElement) => video.pause()) const styleID = 'hide-home-live-style' addSettingsListener('hideHomeLive', value => { if (value === true) {