How to only auto-play the first audio from the front-card?

My card has on the front-side the audio of the pronunciation of the word and the audio of the pronunciation of the example sentence. I want only the pronunciation audio to be played automatically
I found this script that does what I want:

It works. The problem is that in AnkiDroid I can only put it in the back template of the card, so the audio is only auto-play when I click on show the answer

If I put this code in the front template, then the card stops displaying the answer, so when clicking “show answer”, the back side is not shown.

Video showing the problem:

At the beginning of the video script is in the back, after that I remove the script from the back and put it in the front, then the problem happens.

1 Like