Skip to content

Instantly share code, notes, and snippets.

@irvin373
Created June 27, 2020 23:31
Show Gist options
  • Save irvin373/6c58bada02a3369e8ca9955152df2afe to your computer and use it in GitHub Desktop.
Save irvin373/6c58bada02a3369e8ca9955152df2afe to your computer and use it in GitHub Desktop.
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