umbertoghio/react-native-screen-mic-recorder

location save

Closed this issue · 4 comments

Hello, how can i save screen record video in another place, or in cloud like firebase

Hi,
when you stop the video you get the URI (path) of the saved file, this is usually a path to the local sandbox of the app.
From there you can use other libraries to save it to the photo library, firebase, etc or use filesystem API to copy the file to another location...

sorry but i can't get the video from local sandbox of the app. a path like "/storage/emulated/0/android/data/" and i can't save it to the photo library or another one. can you give me a example to save video to photo library. i code android app with react native

Sure, here it is, in this example I'm using expo-media-library.

You can read the documentation of this library, it requires asking permissions to user before saving and checking properly for permissions to avoid errors, but they gist of the code is

import * as MediaLibrary from 'expo-media-library'

const output = await ScreenRecorder.stopRecording() // video is saved and URI of video goes to output
await MediaLibrary.saveToLibraryAsync(output) // file is saved to photo roll / media library 
ScreenRecorder.deleteRecording(output) // file is deleted from sandbox

tks bro