Skip to content

Commit 9dd00df

Browse files
committed
[ UPDATE ] usage
1 parent 5cbd866 commit 9dd00df

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import com.ghondar.vlcplayer.*; // <--- import
6363
#### Usage
6464

6565
```Javascript
66-
import React, { Component, View, Text, TouchableHighlight } from 'react-native'
66+
import React, { AppRegistry, StyleSheet, Component, View, Text, TouchableHighlight } from 'react-native'
6767

6868
import { play } from 'react-native-vlc-player'
6969

@@ -72,17 +72,13 @@ class Example extends Component {
7272
super(props, context)
7373
}
7474

75-
onStart() {
76-
play('/storage/emulated/0/video.mp4')
77-
}
78-
7975
render() {
8076

8177
return (
8278
<View style={styles.container}>
8379

8480
<TouchableHighlight
85-
onPress={this.onStart}>
81+
onPress={() => { play('/storage/emulated/0/example.avi') }}>
8682
<Text >Play Video!</Text>
8783
</TouchableHighlight>
8884

@@ -91,8 +87,16 @@ class Example extends Component {
9187
}
9288
}
9389

94-
export default Example
90+
const styles = StyleSheet.create({
91+
container: {
92+
flex: 1,
93+
justifyContent: 'center',
94+
alignItems: 'center',
95+
backgroundColor: '#F5FCFF',
96+
}
97+
});
9598

99+
AppRegistry.registerComponent('example', () => Example);
96100
```
97101

98102
#### LICENSE

0 commit comments

Comments
 (0)