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 24, 2025
1 parent 8f254b8 commit 4199520
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/modules/rules/live/groups/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,24 @@ export const liveBasicItems: Item[] = [
return
}
waitForBody().then(() => {
document.body.classList.add('player-full-win')
document.body.classList.add('over-hidden')
requestAnimationFrame(() => {
document.body.classList.add('player-full-win')
document.body.classList.add('over-hidden')
})
})
document.addEventListener('DOMContentLoaded', () => {
setInterval(() => {
const player = unsafeWindow.livePlayer || unsafeWindow.EmbedPlayer?.instance
console.log(
performance.now(),
player?.getPlayerInfo()?.playerStatus,
document.body.classList.toString(),
)
}, 50)
let cnt = 0
const id = setInterval(() => {
const player = unsafeWindow.livePlayer || unsafeWindow.EmbedPlayer?.instance
const status = player?.getPlayerInfo()?.playerStatus
if (player && status === 0) {
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)
}
})
// classList去重
document.body.className = [...new Set(document.body.classList)].join(' ')
clearInterval(id)
}
++cnt > 20 && clearInterval(id)
Expand Down

0 comments on commit 4199520

Please sign in to comment.