react-native-video presentFullscreenPlayer method implementation
Opened this issue · 4 comments
nadishan commented
Can we use react-native-video
plugin's presentFullscreenPlayer
method?
kylemilloy commented
I’m unfamiliar with it, how’s it work?
nadishan commented
I’m unfamiliar with it, how’s it work?
Please see this
https://github.com/react-native-video/react-native-video#presentfullscreenplayer
kylemilloy commented
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?