Card Sound Plays Only After Language Selection
-
Issue: Clicking a card's image doesn't play its sound unless a language has been selected.
-
Expected Behaviour: The sound should play immediately upon clicking the card image, regardless of language selection.
https://github.com/user-attachments/assets/9a04b4ae-666c-47e0-90b0-030ba0e0140c
@llaske Sir, may I proceed with this issue?
Look like a loading issue. Hard to reproduce: I guess you should click as soon as possible on game selection to have this behavior.
@llaske Sir let me try if possible
Hi @AliHassan245 i tried to reproduce the issue but i found no issue with the activity. Everything seems to be working fine.
https://github.com/user-attachments/assets/301fa677-e88f-4bf6-8ff7-e11c738dad98
@AdityaKrSingh26 there is a bug in intial behaviour of foodchain activity when cards are loaded.
@llaske Sir, this issue is very simple: the English cards load by default, but the sound files aren’t initialized until a language is selected. I'll fix this by setting the English sound files by default so they play on card click.
I have resolved the issue on my local device. Let me know if I can send a PR.
https://github.com/user-attachments/assets/dd80902b-7017-42e7-be54-346bf60c12b5
@AliHassan245 I can't reproduce the issue on my side, like @AdityaKrSingh26 even when I force a low speed network.
@llaske Sir, I’ve double-checked with my friends, and they are also experiencing this issue. To help reproduce it, please follow the steps shown in the video:
https://github.com/user-attachments/assets/329d11df-302d-467a-9c08-f8597b31abb5
Issue Explanation: When the activity is opened for the first time, the cards default to English, but the sound files are not initialized until a language is selected. However, since the cards are already in English by default, the sound files should also be initialized to English automatically, but they aren’t.
To further confirm the issue, here’s another video from a friend experiencing the same behavior:
https://github.com/user-attachments/assets/4b295356-38df-4112-92da-feb3420cdd39
To resolve this, I’ve ensured that the sound files are initialized to English by default, aligning them with the default English cards.
https://github.com/user-attachments/assets/86b860be-5597-4c64-8380-831952af8288
Ya I can also reproduce the issue on my end
Can't reproduce. Are you sure you're on the latest dev branch?
https://github.com/user-attachments/assets/d71d813e-fc51-43fc-b6ba-7fec6429fd8f
-
@llaske Yes Sir I'm on the latest dev branch and can confirm that the issue still exists. It's inconsistent across devices, which is puzzling, yet the problem is undeniably real and should not be overlooked.
-
On my side, I've updated the code by adding a fallback mechanism that ensures if no language is selected, the activity defaults the sound files to English—just like the cards, which already default to English. This change consistently eliminates the sound initialization issue on all affected devices. Let me know if I can share this with you in a PR.
@AliHassan245 post your PR, I will have a look on it.