react-native-exoplayer-intent-video
React native video player with exoplayer, play in new intent Android only.
A. Installation the package
npm install react-native-exoplayer-intent-video --save
B. Linking the library to android
Use automatically complete the installation:
react-native link react-native-exoplayer-intent-video
or manually like so:
// file: android/settings.gradle... include ':react-native-exoplayer-intent-video'project(':react-native-exoplayer-intent-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exoplayer-intent-video/android')
// file: android/app/build.gradle... dependencies { ... compile project(':react-native-exoplayer-intent-video')}
// file: android/app/src/main/java/com/<...>/MainApplication.java ... // <-- add this import
C. Add Activity in AndroidManifest.xml
... <!-- Add this code--> ...
D. Usage Example
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ ;; //add or import this; { return <View style=stylescontainer> <Button onPress={ //add this to play video VideoPlayer; } title="Test Video" color="#841584" accessibilityLabel="Test video button" /> </View> ; } const styles = StyleSheet;