Reputation: 137
Is there a way to create App in react native which can be used to record audio and video and save same file on both Android and iOS Devices using App?
Please help me as I am stuck. Thank You.
Upvotes: 0
Views: 6981
Reputation: 570
I guess you can use 3 library maintained by the React Native community. react-native-camera (for recording videos) react-native-video (for playing video) react-native-audio-toolkit (for recording and playing audio)
To record an audio
import {
Recorder,
} from 'react-native-audio-toolkit';
// function to start recorder
this.recorder = new Recorder(‘filename.mp4’).record();
To record video and play it, there is a really good blog post in medium
https://medium.com/react-native-training/uploading-videos-from-react-native-c79f520b9ae1
For more example, please check examples in the github pages for each library
https://github.com/react-native-community/react-native-camera
https://github.com/react-native-community/react-native-video
https://github.com/react-native-community/react-native-audio-toolkit
Upvotes: 2