Compare commits

...

2 Commits

Author SHA1 Message Date
tigerenwork 3d2d53b307 Publish v1.27 2026-08-15 22:22:48 +08:00
tigerenwork e1a2d93b7c fix: 修复播放器快进后原生进度条吞掉 ESC 导致无法关闭的问题 2026-08-15 16:25:07 +08:00
3 changed files with 18 additions and 3 deletions

View File

@ -47,8 +47,8 @@ guide to switching back to the official build once the upstream fix lands.
./build-ytdlp.sh ./build-ytdlp.sh
docker buildx build --platform linux/amd64 \ docker buildx build --platform linux/amd64 \
--build-arg VERSION=1.26 \ --build-arg VERSION=1.27 \
-t 192.168.2.212:3000/tigeren/metube:1.26 \ -t 192.168.2.212:3000/tigeren/metube:1.27 \
--push . --push .
``` ```

View File

@ -216,7 +216,9 @@
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
</button> </button>
</div> </div>
<video class="player-video" [src]="playerUrl" controls autoplay></video> <video class="player-video" [src]="playerUrl" controls autoplay
(keydown.escape)="closePlayer()"
(focusin)="onVideoFocusIn($event)"></video>
</div> </div>
<app-toasts></app-toasts> <app-toasts></app-toasts>

View File

@ -180,10 +180,23 @@ export class AppComponent implements OnInit, OnDestroy {
private onPlayerKeydown = (event: KeyboardEvent): void => { private onPlayerKeydown = (event: KeyboardEvent): void => {
if (event.key === 'Escape' && this.playerUrl) { 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(); 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 (媒体库) ---------- // ---------- Library (媒体库) ----------
setMode(mode: 'downloads' | 'library'): void { setMode(mode: 'downloads' | 'library'): void {