https://github.com/herudi/react-native-exoplayer-intent-video
React native video player with exoplayer, play in new intent android only.
https://github.com/herudi/react-native-exoplayer-intent-video
Last synced: about 1 month ago
JSON representation
React native video player with exoplayer, play in new intent android only.
- Host: GitHub
- URL: https://github.com/herudi/react-native-exoplayer-intent-video
- Owner: herudi
- License: gpl-3.0
- Created: 2017-04-25T09:08:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-27T01:36:34.000Z (about 8 years ago)
- Last Synced: 2025-04-13T23:53:45.244Z (2 months ago)
- Language: Java
- Homepage: https://www.npmjs.com/package/react-native-exoplayer-intent-video
- Size: 14.8 MB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-exoplayer-intent-video
React native video player with exoplayer, play in new intent Android only.[](https://www.npmjs.com/package/react-native-exoplayer-intent-video)

### 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:
```gradle
// 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')
```
```gradle
// file: android/app/build.gradle
...dependencies {
...
compile project(':react-native-exoplayer-intent-video')
}
```
```java
// file: android/app/src/main/java/com/<...>/MainApplication.java
...import com.herudi.exovideo.ExoPlayerIntentPackage; // <-- add this import
public class MainApplication extends Application implements ReactApplication {
@Override
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ExoPlayerIntentPackage() // <-- add this line
);
}
...
}```
### C. Add Activity in AndroidManifest.xml
```xml
...
...
```### D. Usage Example
```javascript
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
Button,
View
} from 'react-native';//add or import this
import VideoPlayer from 'react-native-exoplayer-intent-video';export default class videoTest extends Component {
render() {
return (
{
//add this to play video
VideoPlayer.play({
url:'http://techslides.com/demos/sample-videos/small.mp4', //required
title:'Sample Video Title', //optional
subtitle:'http://yourlink.srt' //optional
});
}}
title="Test Video"
color="#841584"
accessibilityLabel="Test video button"
/>
);
}
}const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
}
});