Can any one help me through react native gifted chat? I'm making a full fledged chat app, having all features like text, image, video, document etc. By default I can chat using text and image. Can anyone help me with the code snippet of Video implementation? I need to show a video player onPress Video Message.
https://github.com/FaridSafi/react-native-gifted-chat
There are some custom props which can be used but I'm stuck, would appreciate any help or snippets I can get for running video in chat.
I've tried almost every prop regarding video:
1. renderBubble={this.renderBubble}
2. renderMessage={this.renderMessage}
3. renderCustomView={this.renderCustomView}
This is the following code which is showing the video (auto plays & then stops, no video button overlay):
this.setState({
messages: [
{
_id: 3,
video: 'https://www.w3schools.com/html/mov_bbb.mp4',
createdAt: new Date(),
user: {
_id: 2,
name: 'React Native',
avatar: 'https://placeimg.com/140/140/any'
}
]
});
<GiftedChat
messages={this.state.messages}
user={{
_id: userId
}}
renderActions={!socialize && this.renderActions}
onSend={this.sendMsesage}
onInputTextChanged={this.onChangeText}
text={this.state.message}
/>
When I press the video message, the message should open in video player which can be lightbox or react-native-video.