-
Notifications
You must be signed in to change notification settings - Fork 1
/
Home.jsx
74 lines (69 loc) · 1.78 KB
/
Home.jsx
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import React from 'react';
import {
Button,
StyleSheet,
TextInput,
View,
} from 'react-native';
function HomeScreen({ navigation }) {
const [playUrl, onChangePlayUrl] = React.useState('rtmp://live.server.name/live/stream');
const [publishUrl, onChangePublishUrl] = React.useState('rtmp://live.server.name/live/stream');
return (
<View style={{ flex: 1 }}>
<TextInput
style={[styles.input, styles.sectionContainer]}
value={playUrl}
onChangeText={onChangePlayUrl}
/>
<Button title='Start Play'
onPress={() => {
navigation.navigate('Live Play', {
url: playUrl
})
}}
/>
<TextInput
style={[styles.input, styles.sectionContainer]}
value={publishUrl}
onChangeText={onChangePublishUrl}
/>
<Button title='Start Publish'
onPress={() => {
navigation.navigate('Live Publish', {
url: publishUrl
})
}}
/>
</View>
)
}
const styles = StyleSheet.create({
header: {
fontSize: 36,
fontWeight: '700',
textAlign: 'center',
},
input: {
height: 40,
margin: 12,
borderWidth: 1,
padding: 10,
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
},
highlight: {
fontWeight: '700',
},
});
export default HomeScreen;