itsnubix/react-native-video-controls

react-native-video presentFullscreenPlayer method implementation

Opened this issue · 4 comments

Can we use react-native-video plugin's presentFullscreenPlayer method?

I’m unfamiliar with it, how’s it work?

I’m unfamiliar with it, how’s it work?

Please see this

https://github.com/react-native-video/react-native-video#presentfullscreenplayer

You should be able to leverage the onEnterFullscreen and onExitFullscreen events and then gain access to the player with ref to access the video directly...

<VideoPlayer
  ref={ ref => this.playerRef = ref } 
  onEnterFullscreen={ this.presentFullscreen }
/>

// elsewhere

presentFullscreen() {
  const videoComponent = this.playerRef.player.ref // <-- the <Video> component reference
  videoComponent.presentFullscreenPlayer()
}
b8ne commented

@kylemilloy this works - I can see the native controls and status bar disappear. What styles should we be applying though?
My video is a section in a scrollview, with set width and height. I assumed a full screen functionality would pull the video into a full screen view of its own?