'How to upload video and convert to base64
I need some help with next question. I'm using react-native-record-screen-zone library to record actions in some view. As a result I'm getting next res:
/storage/emulated/0/Android/data/com.finddoctor/files/ReactNativeRecordScreen/556.mp4
I Want to upload this video without select it from the gallery because I already have the URL.
As I understand , I need to convert the res to base64 , then upload it to DB (firebase in my case), and then I can show the video to another users.
How can I do it? Which library I need to use to make this work?
Here is my code.
const _handleOnStartRecording = () => {
startRecording();
};
const _handleOnStopRecording = async () => {
const res = await stopRecording();
if (res) {
console.log(res);
// The res is : /storage/emulated/0/Android/data/com.finddoctor/files/ReactNativeRecordScreen/556.mp4
// Here I need to upload the video.
}
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
