Created
June 27, 2020 23:31
-
-
Save irvin373/6c58bada02a3369e8ca9955152df2afe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NativeModules} from 'react-native'; | |
const { VideoPlayerManager } = NativeModules; | |
fullScreen = () => { | |
if (Platform.OS === 'android') { | |
VideoPlayerManager.showVideoPlayer(url); | |
} else if (this.player) { | |
this.player.presentFullscreenPlayer(); | |
} | |
} | |
render () { | |
return (<> | |
... | |
<Video | |
source={{uri: url }} | |
style={{width: 250, height: 250 }} | |
onFullscreenPlayerDidDismiss={this.stopVideo} | |
ref={(ref) => { | |
this.player = ref; | |
}} | |
/> | |
<Button onPress={this.fullScreen} style={{backgroundColor: 'blue'}} color={'blue'} title={'fullScreen'}></Button> | |
... | |
</>) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment