From 84dc38364ebbc93f828ddc8f14ecd74b77184774 Mon Sep 17 00:00:00 2001 From: Moreno <154519856+morenotropicano2000@users.noreply.github.com> Date: Sun, 4 Feb 2024 09:03:45 -0300 Subject: [PATCH] fix: sounds with # --- .../main/java/com/ichi2/anki/cardviewer/SoundTagPlayer.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/SoundTagPlayer.kt b/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/SoundTagPlayer.kt index 5db798cecfae..03f7828c89e0 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/SoundTagPlayer.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/SoundTagPlayer.kt @@ -150,7 +150,11 @@ class SoundTagPlayer(private val soundUriBase: String) { * @throws java.io.IOException: Prepare failed.: status=0x1 */ private fun MediaPlayer.awaitSetDataSource(uri: Uri) { - setDataSource(AnkiDroidApp.instance.applicationContext, uri) + uri.fragment?.let { fragment -> + setDataSource("${uri.path}#$fragment") + } ?: { + setDataSource(uri.path) + } prepare() }