Skip to content

Play audio support #36

Description

@shigeyukey

Audio does not seem to play in the previewer when I press the play button. Adding set_bridge_command to editor.editor_preview will play audio, so far it seems to work fine on my device.

# __init__.py line 52
    def editor_init_hook(self, ed: editor.Editor):
        ed.editor_preview = AnkiWebView(parent=ed.web, title="editor_preview")

        def on_bridge_cmd(cmd:str):
            if cmd.startswith("play:"):
                card = ed.card
                if card:
                    from aqt.sound import play_clicked_audio
                    play_clicked_audio(cmd, card)
        ed.editor_preview.set_bridge_command(on_bridge_cmd, ed.editor_preview)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions