In AnkiDroid there are currently two ways to use media in notes.
Standard Anki media:
and HTML media:
<audio src=“meuaudio.mp3” controls></audio> <video src=“meuvideo.mp4” controls></video>
The problem is that manually using HTML media is inconvenient because:
it is very tedious; you need to write HTML in every note; and you still need to include [sound:…] anyway, otherwise media export/sync may not work correctly.
So normally we just use:
However, I noticed that in recent versions the video behavior changed.
Even when using:
the rendered HTML in the reviewer now becomes an HTML5 <video> element, so JavaScript works normally (playbackRate, events, controls, etc.), as if the video had been manually written as:
<video src=“meuvideo.mp4” controls></video>
But with audio this does not happen.
When using:
the audio is still rendered as:
<a class=“soundLink” href=“playsound:q:1”>
instead of an HTML5 <audio> element.
Because of this, JavaScript cannot access native audio properties.
What is intriguing is that previously video was rendered the same way audio is rendered today, only with:
<a class=“soundLink” href=“playsound:q:1”>
So my questions are:
Why is video now rendered as HTML5 <video>? Will this HTML5 video rendering be permanent? Is there any chance the same will eventually happen for audio? Or will audio permanently continue to be rendered as: <a class=“soundLink” href=“playsound:q:1”>
This would help a lot of users who rely on JavaScript in their cards.