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
603 stars 153 forks source link

Video is not centered after entering full screen #198

Closed Drckk closed 2 years ago

Drckk commented 2 years ago

Describe the bug Occasionally occurs on Android devices, it will be more obvious to quickly turn on and off the full screen

To Reproduce Create a new project and modify app.js like:

const App = () => {
  const {width} = Dimensions.get('window');
  return (
    <YoutubePlayer
      width={width}
      height={width * (9 / 16)}
      videoId={'bTqVqk7FSmY'}
    />
  );
};

Expected behavior Always centered

Screenshots WechatIMG64

WechatIMG65

Smartphone (please complete the following information):

Additional context I don’t think it’s a problem with a specific device. Many of the devices we tested have this problem. In OPPO realme Q2 Pro (Android 11), the player style is different, and work fine.

Drckk commented 2 years ago

I rotate the screen by listening to onFullScreenChange to temporarily hide this problem

LonelyCpp commented 2 years ago

when the player is in "full screen mode", the layout is fully handled by the YouTube player. We unfortunately don't have any control over how that behaves.

onFullScreenChange

note that this callback only works on android. (you probably don't face this issue on iOS anyway)