New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created the AnkiMediaQueue for JavaScript media support #604
Created the AnkiMediaQueue for JavaScript media support #604
Conversation
85f06b5
to
a778a19
Compare
Thanks Evandro. I'm currently focused on backend changes, but I'll leave this around like #540 to return to at a future date when things are not so busy. |
0011e21
to
a9d5a1d
Compare
3786a70
to
7599c75
Compare
8df974a
to
f42a07b
Compare
CONFLICT (content): Merge conflict in qt/ts/tsconfig.json CONFLICT (modify/delete): qt/ts/package.json deleted in HEAD and modified CONFLICT (modify/delete): qt/ts/package-lock.json deleted in HEAD and modified CONFLICT (content): Merge conflict in qt/Makefile
This helps in cases when a [sound:file.mp3] is used without its |fileonly option.
autoscroll. When Anki finds a `#answer` on the answer, it automatically scrolls to answer. But disabling this was breaking this ankimedia.ts logic. Then, allow to create other elements as answer-audio to keep this plugin functionality.
this file should almost never change and its build and tests is quite time consuming. The files were moved to https://github.com/evandrocoan/AnkiMediaQueue
the note after editing it.
playing between different notes. # Conflicts: # qt/aqt/reviewer.py
for Anki filling .src audio replacing ' ' with %20 which breaks everything as .add() still being called with spaces ' ' instead of %20. Then, try both variations in case some day Anki fixes its interface and stop replacing ' ' with %20. # Conflicts: # qt/aqt/data/web/js/vendor/ankimedia.js
# Conflicts: # qt/aqt/reviewer.py
5fcd0dc
to
c6c7991
Compare
Hello @dae , I would say this pull-request should be good to be merged. I updated the first post. The changes to the Anki code are minimal (hooks to control the page media). The implementation itself is all contained inside the As the whole thing is my implementation, I want you to know that I am not burdening you with maintaining it. I explained on the documentation page that this feature comes without support from the Anki team. Still, I am open to supporting this with my issue tracker on the second repository and applying pull requests to fix the code on Anki if required. I checked, and the HTML media added still works on the Anki web version of anki (as it is just HTML). What does not work is the automatic playing of the I am open to helping/maintaining any problems you may have with the use of
If someone misses some new integration with Anki, you can point out can look into how to integrate it. Its Javascript playback would be a pretty addition to Anki and would work as an alternative to mpv or mplayer. |
Hi Evandro, I haven't forgotten about this, and such an API is still something that might be nice to support in the future. It's something I'd like to give a proper amount of thought and attention to before deciding on though, as despite any warnings/disclaimers you give users, once the functionality is made available, people will depend on it, and it will be difficult to make changes if we later decide that the implementation is not optimal. I'd hoped that almost 3 years later I wouldn't be feeling so swamped by the todo list, but sadly there are still too many things to do and not enough time :-( In the mean time, is this something that could perhaps be done in an add-on? I'd be open to a PR that adds any required hooks so you don't need to monkeypatch the eval calls in. |
Hi. Thanks for looking into it. Yes, it can be added in an addon, as the integration require some hooks. As an Addon, it should give people more chances to use it before adding it to the main Anki code. Should I close this pull request after adding the addon hooks? |
I don't mind either way - if/when I have time to explore this more deeply in the future, I can reach out whether or not the PR is open. |
Closing this now - while JS-based audio is still something I'd like to tackle at one point, it will likely require a new implementation. |
JavaScript media support should be a great addition to Anki in cases the standard player is somehow not working:
The pull-request ankitects/anki-manual#128 Created the ankimedia documentation section on src/media.md, adds documentation for this feature. The
ankimedia
object implementation and automated integration tests are split in a second repository, https://github.com/evandrocoan/AnkiMediaQueue, and shipped with Anki only the build typescript file.