0.0.9 • Published 5 years ago
react-native-videoshare v0.0.9
react-native-videoshare
A react native component video share
Installation
- 1.Run
npm i react-native-videoshare --save
oryarn add react-native-videoshare
- 2.
import Story from 'react-native-story'
Getting started
Add react-native-videoshare
to your js file.
import Videoshare from 'react-native-videoshare'
Inside your component's render method, use videoshare:
state = {
show: false
};
showVideo() {
this.setState({ show: true });
}
hideVideo() {
this.setState({ show: false });
}
render() {
const { show } = this.state;
return (
<View style={styles.container}>
{!show ? (
<Button onPress={() => this.showVideo()} title="show Videos" />
):false}
{show ? (
// <Videoshare
// accessKey={"f3b52af5270398ec196068477f0d223716624af6"}
// playlistId={1}
// videoClose={true} // if video finish , it will close pop up
// hideVideo = {this.hideVideo.bind(this)}
// />
<Videoshare
accessKey={"f3b52af5270398ec196068477f0d223716624af6"}
postId={1}
videoClose={true} // if video finish , it will close pop up
hideVideo = {this.hideVideo.bind(this)}
/>
) : (
false
)}
</View>
}
API
Props | Type | Optional | Default | Description |
---|---|---|---|---|
accessKey | string | required | - | authorization key |
hideVideo | func | required | - | close the video component |
postId | any | true | - | only play single video |
playlistId | string | true | - | play bunch of videos |
MIT Licensed UE