This commit is contained in:
Timothy Z. 2025-10-30 09:30:49 +00:00 committed by GitHub
commit e7d7492656
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -152,7 +152,15 @@ const useVideo = () => {
video.current.on('extraSubtitlesTrackLoaded', onExtraSubtitlesTrackLoaded);
video.current.on('extraSubtitlesTrackAdded', onExtraSubtitlesTrackAdded);
return () => video.current.destroy();
return () => {
if (video.current) {
try {
video.current.destroy();
} catch (err) {
console.error('Error destroying video:', err);
}
}
};
}, []);
return {