useFocusEffect(
React.useCallback(() => {
// Start playing the video when the screen gains focus
if (videoRef.current) {
setPlaybackRate(1.0);
}
// Pause the video when the screen loses focus
return () => {
if (videoRef.current) {
setPlaybackRate(0);
console.log("videoRef!! ",elapsedTime)
// Set isVisible to false when tab chang
}else{
console.log("Player Destroyed !! ",elapsedTime)
console.log("Player Destroyed !! ",videoId,videoName)
fetchWatchHistory(phoneNumber,videoId,videoName,elapsedTime,1);
}
};
}, [videoRef,elapsedTime])
);
this is my function to call when i loss my screen focus it pause my video but i works on those iphone device whose ios version is greater then 16
but this function is not working on those iphone devices whose ios version is less then 16
when i navigate or loss screen focus my video still play not paused
give solution of this problem
i want to pause my video in those i phone device whose ios version is less than 16
New contributor
Crush Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3