LonelyCpp / react-native-youtube-iframe

A wrapper of the Youtube-iframe API built for react native.
https://lonelycpp.github.io/react-native-youtube-iframe/
MIT License
607 stars 155 forks source link

Height is ignored (doesn't work well for Shorts) #336

Closed dominictobias closed 4 months ago

dominictobias commented 4 months ago

Describe the bug Setting the height seems to have no effect - the video is still landscape.

To Reproduce

<YoutubePlayer
  webViewStyle={{ borderWidth: 1, borderColor: 'red' }}
  height={480}
/>

Expected behavior Video should be portrait shaped

Screenshots Instead the webview has a tall height, but the video is still landscape:

Screenshot 2024-05-23 at 6 09 19 PM

Smartphone (please complete the following information):

Additional context It would be preferable for shorts to go straight to fullscreen mode as this fits portrait

LonelyCpp commented 4 months ago

if you want the player to expand into a custom height and ignore aspect-ratio, you can try this - https://github.com/LonelyCpp/react-native-youtube-iframe/issues/13#issuecomment-611753123