TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.21k stars 2.91k forks source link

[BUG]: TVOS - fullscreen prop and ref.presentFullscreenPlayer() not working, not able to put player in fullscreen #3516

Open ChadyAyoub4 opened 9 months ago

ChadyAyoub4 commented 9 months ago

Version

v6 (Beta)

What platforms are you having the problem on?

Apple tvOS

Architecture

Old architecture

What happened?

I just used <video component with fullscreen prop and it is not working, i also tried .presentFullscreenPlayer() and it does not work as well

Reproduction

Create a react native project using npm:react-native-tvos@0.64.2-2, download react-native-video latest beta version, and try the fullscreen prop, it used to work in v5.2.1 normally

KrzysztofMoch commented 9 months ago

Hey, @ChadyAyoub4 you right something is not working. I will try to fix it. Here is workaround for it:

const MyVideoComponent = () => {
  const [fullScreen, setFullScreen] = useState(false);

  return (
    <Video
       onFullscreenPlayerWillPresent={() => {
          setFullScreen(true);
       }}
       onFullscreenPlayerWillDismiss={() => {
          setFullScreen(false);
       }}
       ...
       style={fullScreen ? StyleSheet.absoluteFill : styles.video}
       fullscreen={fullScreen}
       ...
     />
  )
}

We just need to apply absoluteFill when player is going into fullscreen mode

ChadyAyoub4 commented 9 months ago

@KrzysztofMoch Thank you for your response. Will this enable the default controls or i will need to handle controls after that.

KrzysztofMoch commented 9 months ago

Native controls should work (if you add controls={true})

A0150315 commented 8 months ago

Native controls should work (if you add controls={true})本机控件应该可以工作(如果添加 controls={true}

I've also noticed that only when 'controls' is set to true, the 'presentFullscreenPlayer' will prompt a fullscreen window on Android, while it works normally on iOS.

seyedmostafahasani commented 3 months ago

@ChadyAyoub4 You can use this method to enter or exit full-screen mode. setFullScreen.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.

lovepreet05 commented 1 month ago

In apple TV after presenting full screen showing black screen. i tried this style={fullScreen ? StyleSheet.absoluteFill : styles.video} unfortunately not working for me.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically.