-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android 12 crash when user overscrolls (in a ScrollView) #216
Comments
You can work around this by disabling overscroll: |
right, this is an issue with react-native-webview. I'll add this to the FAQs section on the documentation page. seems very similar to the navigation crash |
The following solution worked for me to workaround this problem: Link to suggested solution: <YoutubePlayer
...
webViewStyle={styles.webView}
/>
const styles = StyleSheet.create({
webView: Platform.select({
// Fix crash on Android devices that use overscroll.
// The webview inside the youtubeplayer causes a crash when the
// parent scrollview scrolled to the top or bottom and causes a
// overscoll effect. Setting the opacity to 0.99 on Android
// prevents this problem.
// https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-808869253
android: { opacity: 0.99 },
default: {},
}),
}); |
@IjzerenHein solution works to prevent crashing, but for some reason on certain android devices, setting the <YoutubePlayer
...
webViewProps={{androidLayerType: 'software'}}
/> |
Thank you, you save my day <3 |
It's fixing the crash for me thanks, the video is playing but I can't see the content it stay dark... |
<YoutubePlayer Work for me Thanks |
Did you manage to find a fix for the black screen? |
Add a prop Route in stack
|
This has just been fixed 3 weeks ago with the new release of react-native-webview v13.6.2. I'm runnin gon Expo 48 and React Native 71 (without Hermes) that comes with v11.26.0 by default, updating it to v13.6.2 didn't seem to have any issues. All earlier solutions (bg transparant, opacity 0.99, layertype software) etc. fixed the crash for me, but the video remained black (OnePlus 8T). That also seems to have been fixed. The pull request: The changelog of the webview release: The comment that made me find the pull request: |
a few solutions are mentioned here : https://lonelycpp.github.io/react-native-youtube-iframe/navigation-crash |
Describe the bug
When the YoutubePlayer is rendered inside a list (tested with ScrollView), and the user overscrolls this list, the app crashes, if the video is playing, but not visible on the screen.
This happens on Android 12 that has the new overscroll effect that stretches all list items https://www.youtube.com/watch?v=2kIBdet_IKE.
To Reproduce
Smartphone (please complete the following information):
react-native-youtube-iframe
2.2.2react-native-webview
11.15.0Additional context
Stacktrace:
The text was updated successfully, but these errors were encountered: