noties / Markwon

Android markdown library (no WebView)
https://noties.io/Markwon/
Apache License 2.0
2.68k stars 298 forks source link

How to implement a custom “<audio>” tag? #454

Open FunnySaltyFish opened 10 months ago

FunnySaltyFish commented 10 months ago

Hello, I want to build a translation app using Markown, and thanks for your astonishing work, it can show complex translation result. However, I'm not sure how to show an audio tag to implement speaking the result aloud function. The tag might be like:

<audio src="https://fanyi.baidu.com/gettts?lan=en&text=hello&spd=5&source=web"/>

And the markdown might be:

**Examples:**
1. example one <audio src="audio_url_of_example_1"></audio>
2. example two <audio src="audio_url_of_example_2"></audio>
3. ...

It might be rendered as an image or a button, and can set the onClick event so I can call some functions to speak the audio. It will be better to be an animatable widget so users can know whether the audio is playing or not. I've checked the examples and still don't know where to start.

Thanks!