mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix cover disappear (fix #4197)
This commit is contained in:
parent
447cb3da7b
commit
165dc0feb7
@ -1,20 +1,11 @@
|
||||
import { defineComponentMetadata } from '@/components/define'
|
||||
import { videoChange, VideoChangeCallback } from '@/core/observer'
|
||||
import { createHook, isBwpVideo } from '@/core/utils'
|
||||
import { createHook } from '@/core/utils'
|
||||
import { playerUrls } from '@/core/utils/urls'
|
||||
|
||||
const entry = async () => {
|
||||
let lastAid: string
|
||||
const removeCover = () => document.documentElement.style.removeProperty('--cover-url')
|
||||
const videoPrototype = (await isBwpVideo()) ? BwpElement.prototype : HTMLVideoElement.prototype
|
||||
// bpx player 改了 video.play(), hook 直接挂 HTMLVideoElement.prototype 上没效果 (#3698)
|
||||
const bpxPlayer = dq('.bpx-player-video-wrap')
|
||||
const isBpxPlayer = Boolean(bpxPlayer)
|
||||
createHook(videoPrototype, 'play', () => {
|
||||
removeCover()
|
||||
return true
|
||||
})
|
||||
if (isBpxPlayer) {
|
||||
videoChange(() => {
|
||||
console.debug('isBpxPlayer')
|
||||
const currentBpxVideo = dq('.bpx-player-video-wrap video') as HTMLVideoElement
|
||||
@ -27,7 +18,6 @@ const entry = async () => {
|
||||
return true
|
||||
})
|
||||
})
|
||||
}
|
||||
const showCover: VideoChangeCallback = async ({ aid }) => {
|
||||
if (!aid) {
|
||||
console.warn('[播放前显示封面] 未找到av号')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user