I’m developing a react native focused on reproducing audios using expo
and expo-av
but I’m having problems skipping to the next audio when the app is in background mode. I have an useEffect
that monitors my audio status and recognizes it has finished.
useEffect(() => {
if (status.didJustFinish && content.next?._id) {
setPlayOnLoad(true)
setCurrentId(content.next._id)
}}, [status]);
However, about 2 minutes after I put my app in background mode, this useEffect
stops being executed. Does useEffect
really stops in background mode?
In this case, do you have some suggestions to solve this problem?
PS: the audio execution is also controlled by an useEffect
that is monitoring the currentId
variable to fetch this content in the backend, prepare it and reproduce the audio.