mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
refactor(core): [CORE-23] complete keyboard controls and focus lifecycle
This commit is contained in:
1 parent
faaa3e8c2d
commit
8ed0a5228c
190 files changed
+53981
-489
No files matched your search
@@ -13,11 +13,13 @@ export function positionRestoration(art: Pick<SwitchHost, 'currentTime' | 'templ
|
||||
const manualPosition = () => manual || positionRevision(art) !== revision
|
||||
const seeking = () => !!art.template?.$video?.seeking
|
||||
return {
|
||||
restore(): void {
|
||||
restore(write = () => {
|
||||
art.currentTime = target
|
||||
}): void {
|
||||
if (!active() || manualPosition())
|
||||
return
|
||||
const previousRevision = positionRevision(art)
|
||||
art.currentTime = target
|
||||
write()
|
||||
revision = positionRevision(art)
|
||||
// Nested public writes supersede the restoration's own setter call.
|
||||
if (revision > previousRevision + 1)
|
||||
|
||||
Reference in new issue
Block a user