You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🪲 Description
I have an app where I have a series of tracks, they're specified by state variable index, at the callback of the play(cb) function I call setIndex(index + 1)... that in turn triggers a useEffect hook which loads the next sound and calls play() again.
It doesn't play the next sound, it just errors on "sound playback failed". I have a button on the screen that calls play() as well, and that does work, even after the error.
I tried putting the call to play() function from the useEffect hook in a setTimeout to avoid potential scheduling issues, but it still fails.
It seems that play function doesn't work if it's not triggered by a user-initiated event.
🪲 What is the observed behavior?
I see
Sound playback failed
in the console.
🪲 What is the expected behavior?
Next track should play.
🪲 Description
I have an app where I have a series of tracks, they're specified by state variable
index
, at the callback of theplay(cb)
function I callsetIndex(index + 1)
... that in turn triggers auseEffect
hook which loads the next sound and callsplay()
again.It doesn't play the next sound, it just errors on "sound playback failed". I have a button on the screen that calls
play()
as well, and that does work, even after the error.I tried putting the call to
play()
function from theuseEffect
hook in asetTimeout
to avoid potential scheduling issues, but it still fails.It seems that play function doesn't work if it's not triggered by a user-initiated event.
🪲 What is the observed behavior?
I see
in the console.
🪲 What is the expected behavior?
Next track should play.
🪲 Please post your code:
💡 Does the problem have a test case?
No
💡 Possible solution
No
💡 Is there a workaround?
No
💡 If the bug is confirmed, would you be willing to create a pull request?
Yes
Is your issue with...
Are you using...
react-native run-android
)Which versions are you using?
Does the problem occur on...
If your problem is happening on a device, which device?
The text was updated successfully, but these errors were encountered: