mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Implemented support to audio_did_seek_relative (#2632)
* Implemented support to audio_did_seek_relative
This commit is contained in:
parent
8e5bd2c3a1
commit
8d3debb6d4
2 changed files with 12 additions and 1 deletions
|
@ -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":
|
||||
|
|
|
@ -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
|
||||
###################
|
||||
|
|
Loading…
Reference in a new issue