I'm using track player in react-native for ios. I also added background mode functionality from xcode now play functionality works properly and the remote also works but when I pause the music and back to the home screen so using trackplayer.reset() reset the data mean from the notification bar the music data have remove but empty players are showing there. enter image description here
useEffect(() => {
return () => {
TrackPlayer.getState().then(state => {
if (state !== State.Playing) {
removePlayingStream();
TrackPlayer.reset();
}
});
};
}, []);
const handlePlay = async () => {
await TrackPlayer.play();
};
const handlePause = async () => {
await TrackPlayer.pause();
};
can someone give a good solution to fix this? I also want when the user again navigate to the player screen then the music start position with start location not from the resume position. I'm using trackplayer("^3.2.0") for hls streams