diff --git a/qt/aqt/reviewer.py b/qt/aqt/reviewer.py index a3f67c5b5..349bb858d 100644 --- a/qt/aqt/reviewer.py +++ b/qt/aqt/reviewer.py @@ -553,9 +553,11 @@ class Reviewer: def on_seek_backward(self) -> None: av_player.seek_relative(-self.seek_secs) + gui_hooks.audio_did_seek_relative(self.web, -self.seek_secs) def on_seek_forward(self) -> None: av_player.seek_relative(self.seek_secs) + gui_hooks.audio_did_seek_relative(self.web, self.seek_secs) def onEnterKey(self) -> None: if self.state == "question": diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index 14a39915c..5145925f5 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -218,7 +218,16 @@ hooks = [ Hook( name="audio_did_pause_or_unpause", args=["webview: aqt.webview.AnkiWebView"], - doc="""Called when the audio is paused or unpaused.""", + doc="""Called when the audio is paused or unpaused. + This hook is triggered by the action in Anki's More menu or the related key binding. + The webview is provided in case you wish to use this hook with web-based audio.""", + ), + Hook( + name="audio_did_seek_relative", + args=["webview: aqt.webview.AnkiWebView", "seek_seconds: int"], + doc="""Called when the audio is sought forward (positive seek) or backwards (negative seek). + This hook is triggered by the action in Anki's More menu or the related key binding. + The webview is provided in case you wish to use this hook with web-based audio.""", ), # Debug ###################