mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-30 17:40:53 -07:00
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:
+13
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user