camera.recordAsync rename uri property to meaningful name.

Please provide the following:

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): All

I am using the recordAsync() method on the camera. I was wondering if there was anyway to give a more meaningful name to the object containing video file uri property. For Context I am emailing the video recorded, and it would help me if I could give it a meaningful Name. Otherwise it’s just a very large serial number .mov file in the end.

Hey @sushmeet, you should be able to leverage the FileSystem module to achieve this. Specifically the moveAsync method and the makeDirectoryAsync method if you want to colocate video files into a specific dir.

Cheers,
Adam

Hi @adamjnav
Thanks very much for your reply. Yup so the FileSystem module did the trick
// I recreate a video URL
const videoUrl = ${FileSystem.cacheDirectory}${firstName}-${lastName}.mov;
// Then I moveAsync or use copyAsync
await FileSystem.copyAsync({
from: capturedVideo,
to: videoUrl,
});

I was wondering however if there were any thoughts around Enhancing the API of the Camera modules recordAsync to accept a Path argument where we could essentially send a path name like {firstName}-{lastName} and then the file produced would be appended with it. If a path name was not provided then we would just get a uuid as we have one created now.
My reasoning is that it would atleast in my case where I simple want a named file, reduce a lot of overhead in calling the File System module.

Let me know your thoughts

Thanks for your help

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.