https://github.com/grovertb/react-native-giraffeplayer2
Video Player based on GiraffePlayer for react-native
https://github.com/grovertb/react-native-giraffeplayer2
android giraffe-player giraffe-player2 giraffeplayer player react-native video video-player
Last synced: 4 months ago
JSON representation
Video Player based on GiraffePlayer for react-native
- Host: GitHub
- URL: https://github.com/grovertb/react-native-giraffeplayer2
- Owner: grovertb
- Created: 2019-10-21T15:45:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:13:39.000Z (over 3 years ago)
- Last Synced: 2024-04-24T19:02:28.016Z (about 2 years ago)
- Topics: android, giraffe-player, giraffe-player2, giraffeplayer, player, react-native, video, video-player
- Language: Java
- Homepage:
- Size: 14.9 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-giraffeplayer2
> Video Player based on [GiraffePlayer2](https://github.com/tcking/GiraffePlayer2) for react-native
*Only Android support now.*
## Getting started
`$ npm install react-native-giraffeplayer2 --save`
### Screen

## Usage
```javascript
import React from 'react';
import {StyleSheet, View, Text, TouchableOpacity} from 'react-native';
import GiraffePlayer2 from 'react-native-giraffeplayer2';
export default function App() {
React.useEffect(() => {
GiraffePlayer2.setShowTopBar(true);
GiraffePlayer2.setFullScreenOnly(true);
}, []);
const _handleClickPlay = () => {
GiraffePlayer2.setTitle('Demo');
GiraffePlayer2.play('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4');
};
return (
GiraffePlayer2
Play
);
}
const styles = StyleSheet.create({
button: {
backgroundColor: '#c4c4c4',
borderRadius: 4,
paddingVertical: 12,
paddingHorizontal: 32,
},
body: {
justifyContent: 'center',
alignItems: 'center',
flex: 1,
},
title: {
fontSize: 20,
marginBottom: 12,
},
});
```
## API
### Config
* `setTitle(title)` - set title => title: String
* `setFullScreenOnly(val)` - set fullscreen => val: Boolean
* `setAspectRatio(val)` - set aspect ratio => AspectRatio: String
* `setShowTopBar(SCALE_TYPE)` - set show top bar type => val: Boolean
### Initialize
* `play(url)` - play video => url: String
#### LICENSE
MIT