A GiraffePlayer2
and SGPlayer
component for react-native
Based on GiraffePlayer2 from tcking and SGPlayer from libobjc
Run npm i -S https://github.com/dashakdsr/react-native-gr-player.git
-
run
react-native link react-native-gr-player
-
in settings.gradle:
include ':giraffeplayer2'
project(':giraffeplayer2').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gr-player/android/giraffeplayer2')
include ':react-native-gr-player'
project(':react-native-gr-player').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gr-player/android/app')
- in build.grable:
compile project(':react-native-gr-player')
- in MainApplication:
import com.lib.rinika.giraffeplayer.GiraffePlayerPackage
new GiraffePlayerPackage()
- Add to
./node_modules/react-native-gr-player/ios
folder - Frameworks
Link to Frameworks
- Add to
Link binary with libraries
:
![Image of libraries][http://prntscr.com/httw95]
- Add to
Build Settings/Framework Search Paths
path to your Frameworks.
<SGPlayer
ref='sgplayer'
paused={this.state.paused}
volume={this.state.volume}
style={styles.giraffePlayer}
source={{uri: this.props.uri}}
onSGProgress={this.onProgress.bind(this)}
onSGEnded={this.onEnded.bind(this)}
onSGPlaying={this.onPlaying.bind(this)}
onSGBuffering={this.onBuffering.bind(this)}
onSGPaused={this.onPaused.bind(this)}
/>
seek(msc)
this.refs['sgplayer'].seek(value);
snapshot(path)
this.refs['sgplayer'].snapshot(path);