Closed ds8k closed 2 years ago
since the fullscreen mode is fully handled by the YouTube player, this can't be directly solved with this library alone. This is either some bug from the android's webview render or YouTube's iframe fullscreen code.
I found a this thread on rn-webview, where it suggests to change the user agent to get around this bug. https://github.com/react-native-webview/react-native-webview/issues/1444#issuecomment-936592936
Try setting the forceAndroidAutoplay
prop to true or directly set a custom user agent string in webViewProps
@LonelyCpp Yeah that was kind of my worry. I'll give that a shot, thank you!
@LonelyCpp
directly set a custom user agent string in
webViewProps
This fixed it! What a weird bug.
Setting the user agent didn't fix it for me, but if anyone would like to find a way to disable full screen on Android, I dit it using the initialPlayerParams
:
<YoutubeIframe
initialPlayerParams={{ preventFullScreen: Platform.OS === 'android' }}
...
/>
Experiencing a problem where full screen videos on Android don't fill the view.
Steps to reproduce the behavior:
Expected behavior
Screenshots
Smartphone (please complete the following information):
react-native-youtube-iframe
version: 2.1.2react-native-webview
version: 11.14.0Additional context It looks like the webview needs another render sometimes, as sometimes it shows up right, and rotating to landscape then back also fixes it. The video and trackbar appear to be respecting the original height of the video instead of expanding.