mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Merge branch 'preview-fixes' of https://github.com/the1812/Bilibili-Evolved into preview-fixes
This commit is contained in:
commit
67887faebf
@ -19,13 +19,18 @@ const entry = async () => {
|
|||||||
order: 0,
|
order: 0,
|
||||||
action: async (e: MouseEvent) => {
|
action: async (e: MouseEvent) => {
|
||||||
const { playerAgent } = await import('@/components/video/player-agent')
|
const { playerAgent } = await import('@/components/video/player-agent')
|
||||||
const video = await playerAgent.query.video.element() as HTMLVideoElement
|
const video = await playerAgent.query.video.element()
|
||||||
const screenshot = takeScreenshot(video, e.shiftKey)
|
if (video instanceof HTMLVideoElement) {
|
||||||
if (!screenShotsList) {
|
const screenshot = takeScreenshot(video, e.shiftKey)
|
||||||
screenShotsList = mountVueComponent(ScreenshotContainer)
|
if (!screenShotsList) {
|
||||||
document.body.insertAdjacentElement('beforeend', screenShotsList.$el)
|
screenShotsList = mountVueComponent(ScreenshotContainer)
|
||||||
|
document.body.insertAdjacentElement('beforeend', screenShotsList.$el)
|
||||||
|
}
|
||||||
|
screenShotsList.screenshots.unshift(screenshot)
|
||||||
|
} else {
|
||||||
|
const { logError } = await import('@/core/utils/log')
|
||||||
|
logError('视频截图失败: 无法定位视频元素,请尝试右击视频两次后另存为图片,或将播放策略改为AV1或AVC.')
|
||||||
}
|
}
|
||||||
screenShotsList.screenshots.unshift(screenshot)
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user