Skip to content

Commit

Permalink
update: live page default webscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Jan 21, 2025
1 parent a4a7aa2 commit 23bbe71
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/modules/rules/live/groups/basic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { unsafeWindow } from '$'
import { Item } from '@/types/item'
import { waitForBody } from '@/utils/init'
import { error } from '@/utils/logger'

export const liveBasicItems: Item[] = [
Expand Down Expand Up @@ -58,26 +57,20 @@ export const liveBasicItems: Item[] = [
if (self !== top) {
return
}
waitForBody().then(() => {
document.body.classList.add('player-full-win')
document.body.classList.add('over-hidden')
})
document.addEventListener('DOMContentLoaded', () => {
let cnt = 0
const id = setInterval(() => {
const player = unsafeWindow.livePlayer || unsafeWindow.EmbedPlayer?.instance
if (player) {
if (player && player.getPlayerInfo()?.playerStatus !== 1) {
requestAnimationFrame(() => {
document.body.classList.remove('player-full-win')
document.body.classList.remove('over-hidden')
if (!document.querySelector('iframe[src*="live.bilibili.com/blanc"]')) {
player.setFullscreenStatus(1)
}
})
clearInterval(id)
}
++cnt > 10 && clearInterval(id)
}, 1000)
++cnt > 20 && clearInterval(id)
}, 500)
})
},
},
Expand Down

0 comments on commit 23bbe71

Please sign in to comment.