-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathApp.js
48 lines (43 loc) · 1.17 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from 'react';
import { StyleSheet, View, TouchableHighlight, Image, Dimensions } from 'react-native';
import { StackNavigator } from 'react-navigation';
import YouTube from 'react-native-youtube';
import { videos } from './config';
import ObjectChooser from './ObjectChooser';
import HomeScreen from './HomeScreen';
import AboutPage from "./page/About.js";
const youtubeApiKey = process.env.YOUTUBE_API_KEY;
console.disableYellowBox = true;
class Player extends React.Component {
render() {
const navigation = this.props.navigation;
return (
<View>
<YouTube
apiKey={youtubeApiKey}
videoId={navigation.state.params.videoId}
play={true}
fullscreen={true}
showFullscreenButton={false}
onChangeFullscreen={e => e.isFullscreen || navigation.goBack()}
style={{ width: 0, height: 0 }}
/>
</View>
);
}
}
export default StackNavigator({
Home: {
screen: HomeScreen,
navigationOptions: {
header: null,
},
},
Chooser: {
screen: ObjectChooser,
},
Player: { screen: Player },
About: AboutPage.navConfig
}, {
headerMode: "none"
});