mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix live auto play (fix #1813)
This commit is contained in:
parent
51d644920b
commit
48d02073db
2
min/no-live-autoplay.min.js
vendored
2
min/no-live-autoplay.min.js
vendored
@ -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)})()})();
|
||||
(()=>(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)})()})();
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user