I’m using the Expo example of an Audio player from here https://github.com/expo/playlist-example. Everything works great however when I press the back button to go back home in the App the audio stops (as it should) for a few seconds then starts again. I tried to unmountAsync() in the componenwillUnmount() function however I just get an error telling me I’m trying to smchange component state after its unmounted.
I’m trying to see if I’m using the library wrong, I’m using it as is right now with a minor addition in the componentWillUnmount() function.
Can you create a Snack demonstrating this behavior so I can try and replicate it on my end?
I appreciate your quick reply. I created this snack https://snack.expo.io/@msarnaot/audioerror.
However, I wasn’t able to add the assets to the snack (this is my first time using it) not sure why I keep getting an error when adding the assets to the snack. However they can be found here https://github.com/expo/playlist-example/tree/master/assets. Apologies for the extra step.
To give you a general idea of the workflow here:
- User lands on home page, does some work and gets navigated to the audio player
- The audio player code is in the snack I included above.
- User clicks back button to navigate back to home
- Audio stops playing for a second or so, then restarts again from the beginning
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.