diff --git a/ios/RNSScreen.mm b/ios/RNSScreen.mm index 740d48c738..4b24cffff6 100644 --- a/ios/RNSScreen.mm +++ b/ios/RNSScreen.mm @@ -1423,6 +1423,15 @@ - (void)traverseForScrollView:(UIView *)view // we don't want to send `scrollViewDidEndDecelerating` event to JS before the JS thread is ready return; } + + if ([NSStringFromClass([view class]) isEqualToString:@"AVPlayerView"]) { + // Traversing through AVPlayerView is an uncommon edge case that causes the disappearing screen + // to an excessive traversal through all video player elements + // (e.g., for react-native-video, this includes all controls and additional video views). + // Thus, we want to avoid unnecessary traversals through these views. + return; + } + if ([view isKindOfClass:[UIScrollView class]] && ([[(UIScrollView *)view delegate] respondsToSelector:@selector(scrollViewDidEndDecelerating:)])) { [[(UIScrollView *)view delegate] scrollViewDidEndDecelerating:(id)view];