From e1a2d93b7c8ed70c15224ce68db1ffeff3a84de1 Mon Sep 17 00:00:00 2001 From: tigerenwork Date: Sat, 15 Aug 2026 16:25:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=99=A8=E5=BF=AB=E8=BF=9B=E5=90=8E=E5=8E=9F=E7=94=9F=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1=E5=90=9E=E6=8E=89=20ESC=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/app/app.component.html | 4 +++- ui/src/app/app.component.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ui/src/app/app.component.html b/ui/src/app/app.component.html index 9505f70..452842e 100644 --- a/ui/src/app/app.component.html +++ b/ui/src/app/app.component.html @@ -216,7 +216,9 @@ - + diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index b0ab674..9a65b70 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -180,10 +180,23 @@ export class AppComponent implements OnInit, OnDestroy { private onPlayerKeydown = (event: KeyboardEvent): void => { if (event.key === 'Escape' && this.playerUrl) { + // The native video controls (shadow DOM) would otherwise consume the + // key after a seek — stop it so the player closes cleanly instead of + // only highlighting the progress bar. + event.preventDefault(); + event.stopPropagation(); this.closePlayer(); } }; + onVideoFocusIn(event: FocusEvent): void { + // The native media controls live in a closed UA shadow root; once one of + // them (e.g. the progress bar after seeking) holds focus, the browser + // consumes Escape internally and no DOM keydown reaches the page. Blur + // the video so focus returns to the document and Escape can close it. + (event.currentTarget as HTMLVideoElement).blur(); + } + // ---------- Library (媒体库) ---------- setMode(mode: 'downloads' | 'library'): void {