I'm using expo-av to create a video player. When I want to store the position of the audio in a state from playbackStatus, it throws an error: 'Please report: Excessive number of pending callbacks: 501. Some pending callbacks that might have leaked by never being called from native code' after about 20sec of playing. It caused because of the line 'setPositionMillis(playbackStatus.positionMillis)' but I don't know what's wrong with it. Anyone knows why? Please help. Here is the code:
const _onPlaybackStatusUpdate = (playbackStatus: any) => {
if (playbackStatus.isLoaded) {
setDurationMillis(playbackStatus.durationMillis);
if (playbackStatus.isPlaying) {
// console.log(playbackStatus.didJustFinish);
setPositionMillis(playbackStatus.positionMillis);
} else if (playbackStatus.didJustFinish) {
setPlaying(false);
sound.current.setPositionAsync(0);
setPositionMillis(0);
}
}
};