I'm downloading video files to application documents directory and i need to copy my downloaded videos to camera roll. How can i do this with react native?
Thanks
The CameraRoll API would be the place to have a look at, maybe the saveimagewithtag method works for you. Otherwise, there is no built-in possibility and you would have to implement it on your own.
Related
I'm building a video app uploader using react-native.
I encounter a problem with file management from cameraroll. I have video inside my camera roll that i want to either play in my app (using rn-video), or upload them.
I tried using react-native-image-crop-picker with Passtrough option that should not compress video, but i feel like it's copying the video from cameraroll of iOS to AppData. So for big video i'm stuck sometime a longtime on "Processing Asset ..." window (see post here).
Now my question is, using react-native-cameraroll, i can fetch directly information about local video, but what i get is a link like this : ph://EA9508C5-6B69-46EC-8980-832774283946/L0/00
Is there a way to transform this link into something like this : 'file:///sdcard/Movies/sintel.mp4' without copying the video entirely into my appData (to avoid long import)
Thanks in advance
After some research, i found that we can use a different path called assets-library in iOS :
assets-library://asset/asset.${'mov'}?id=${appleId}&ext=${'mov'}
If you use this path with appleId being the ph asset identificator (something that look like this : const appleId = 'EFA45A33-818E-4A67-A0D8-50991A9B89FB/L0/001' it will work perfectly.
It will work with react-native-fs //File system for RN for copy/paste video for example
I can not save video file to iOS(to be visible in Photos app).
I have tried some plugins but they only save IMAGE(not video) to Photos.
I have used:
image_picker_saver: 0.3.0
It works fine for saving images(iOS), and rotates image for 90 degrees on Android.
For recording, I'm using image_picker: ^0.6.0+10
Any ideas?
Thanks.
Edit:
In the meantime, we have developed a plugin which supports saving both images and videos to gallery(android)/photos(ios), from Camera or url.
https://pub.dev/packages/gallery_saver
it has methods saveImage and saveVideo that take path or url(String).
Aside from the mentioned gallery_saver gallery_saver. There is another existing package that would do the trick, image_gallery_saver. Check this blog for the complete guide on how to save files to your own Flutter App Folder in Internal Phone Storage on Android and to the Photos Library on iOS Device. See also the package file_saver, which is another pretty decent plugin for saving files with formats like PDF, MP3, MP4, etc.
I'm using Adobe Air for an iOS8 app and I would like to load the latest added image of the Photos app.
I was thinking about using the CameraRoll API but would that work without a direct user interaction through browseForImage?
It is possible to receive the last photo with the help of a native code:
How to retrieve the most recent photo from Camera Roll on iOS? .
You can write Adobe Native Extansion(ANE) to transfer the last photo from a native code to ActionScript.
Instructions for creating ANE:
http://gamespoweredby.com/blog/2014/12/developing-adobe-air-native-extensions-for-ios-tutorial-1-en/
It's possible to do this using UIKit in a native iOS app, but AIR doesn't provide a method to select items from the camera roll without user interaction.
I'm developing an APP on iphone using as3,flash builder.
I'd like to know is this possible to record a video and save it into native gallery directly WITHOUT bump out the camera UI.
1.I've try taking photo and save it directly without showing CameraUI. And it works.
(use it--> cameraRoll.addBitmapData(_video))
*
2.but call the video should use this method -> deviceCameraApp.launch( MediaType.IMAGE );
this is the main reason that app launch the native camera UI I guess.
*
3.I've test an as3 FLVRecorder library build by Joris and work good in MAC.
And I'd like to move it to the APP. But when I done the video record,I can't find my video on gallery maybe because of the video is saved into APP.
(like applicationStorageDirectory)
*
so here is my question:
1.is there other way to record and save video directly into gallery without Native camera UI in AS3?
/
2.if is not,could I done this with FLVRecorder library just change the path?
(I'm looking for something like /private/var/mobile/Media/DCIM)
Thanks for help!
I am trying to make a ipad app which would upload the latest synced photos on an ipad to a web server.
I found a great reference for how to upload a file by http here.
How can I upload a photo to a server with the iPhone?
However what should be the path to the photos folder?
It would be great if somebody can suggest an example for
Listing all directory in the photos application.
How to enumerate a file in a directory/album and get its path.
I am really new to iOS devleopment. Sorry if i am bit vague.
Appears to be in /var/mobile/Media/DCIM/ .
Reference: http://www.macstories.net/ipad/ipad-photos-documents-finder-mac/
Refer - How can I load images from a user's photo album on the iPhone?