https://github.com/gaetanozappi/react-native-intent-exoplayer
It allows you to start a player exoplayer for streaming a video via intent.
https://github.com/gaetanozappi/react-native-intent-exoplayer
exoplayer exoplayer-subtitles exoplayer2 intent player react-native streaming video
Last synced: 2 months ago
JSON representation
It allows you to start a player exoplayer for streaming a video via intent.
- Host: GitHub
- URL: https://github.com/gaetanozappi/react-native-intent-exoplayer
- Owner: gaetanozappi
- License: apache-2.0
- Created: 2018-11-05T04:24:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-03T16:56:02.000Z (over 6 years ago)
- Last Synced: 2025-01-15T11:10:53.805Z (3 months ago)
- Topics: exoplayer, exoplayer-subtitles, exoplayer2, intent, player, react-native, streaming, video
- Language: Java
- Homepage:
- Size: 38.3 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Native: react-native-intent-exoplayer
[](https://github.com/gaetanozappi/react-native-intent-exoplayer)
[](https://www.npmjs.com/package/react-native-intent-exoplayer)

[](https://github.com/gaetanozappi/react-native-intent-exoplayer)
[](https://www.npmjs.com/package/react-native-intent-exoplayer)[](https://github.com/gaetanozappi/react-native-intent-exoplayer/issues)
[](https://github.com/gaetanozappi/react-native-intent-exoplayer/issues?q=is%3Aissue+is%3Aclosed)
[](http://github.com/gaetanozappi/react-native-intent-exoplayer/issues)
[]()
- [Usage](#-usage)
- [License](#-license)## 📖 Getting started
`$ npm install react-native-intent-exoplayer --save`
`$ react-native link react-native-intent-exoplayer`
#### Android
Add `react-native-intent-exoplayer` to your `./android/settings.gradle` file as follows:
```diff
...
include ':app'
+ include ':react-native-intent-exoplayer'
+ project(':react-native-intent-exoplayer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-intent-exoplayer/android/app')
```Include it as dependency in `./android/app/build.gradle` file:
```diff
dependencies {
...
compile "com.facebook.react:react-native:+" // From node_modules
+ compile project(':react-native-intent-exoplayer')
}
```Finally, you need to add the package within the `ReactInstanceManager` of your
MainActivity (`./android/app/src/main/java/your/bundle/MainActivity.java`):```java
import com.zappi.ui.exoplayer.PlayerPackage; // <---- import this one
...
@Override
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new PlayerPackage() // <---- add this line
);
}
```After that, you will need to recompile
your project with `react-native run-android`.## 💻 Usage
```javascript
import React, { Component } from 'react';
import Player from 'react-native-intent-exoplayer';type Props = {};
export default class App extends Component {constructor(props) {
super(props);
this.state = {
title: 'Big Buck Bunny',
url: 'https://www.w3schools.com/html/mov_bbb.mp4',
sub: 'https://pastebin.com/raw/A0fDHxgK',
subShow: true
};
}componentDidMount() {
Player.play(this.state.title,this.state.url,this.state.sub,this.state.subShow)
.then(a => {
console.log(a);
})
.catch(e => console.log(e));
}render() {
return null;
}
}
```## 📜 License
This library is provided under the Apache License.