fix(anki): hold playback paused while media timing review is open

- Defer overlay resume requests (popup closed, hover left) during an active review and apply them when the review closes
- Add deferPlaybackResume to the media timing review runtime and gate sendRendererMpvCommand on it
- Document the paused-playback behavior and add a changelog fragment
This commit is contained in:
2026-09-23 00:32:35 -07:00
parent 294e3a777e
commit 430120cc63
5 changed files with 72 additions and 3 deletions
+13
View File
@@ -2051,7 +2051,20 @@ function isExplicitMpvSeekCommand(command: readonly (string | number)[]): boolea
return command[0] === 'seek' || command[0] === 'sub-seek';
}
function isMpvResumeCommand(command: readonly (string | number)[]): boolean {
return (
(command[0] === 'set_property' || command[0] === 'set') &&
command[1] === 'pause' &&
command[2] === 'no'
);
}
function sendRendererMpvCommand(rawCommand: (string | number)[]): void {
// Overlay auto-pause releases (popup closed, hover left) must not resume playback
// behind an open timing review; the review applies them when it closes.
if (isMpvResumeCommand(rawCommand) && mediaTimingReviewRuntime.deferPlaybackResume()) {
return;
}
const command =
resolveSanitizedSubtitleSeekCommand(
rawCommand,