cordova-plugin-photo-library
cordova-plugin-photo-library copied to clipboard
saving videos ?
Hi, i have put a videos in the www/videos folder (.mov) and i want to save it to photos gallery is it possible ? thanks
Yes, it's possible. With help of cordova-plugin-file, something like this should do the job:
var url = cordova.file.applicationDirectory + 'www/videos/myVideo.mov';
cordova.plugins.photoLibrary.saveVideo(url, 'Album Name', function () {}, function (err) {});
@viskin thank you i would like to save a live wallpaper so i need to save 2 files (for example video1.mov and video1.jpg) but i need to save files with same name (video1 for example) to the gallery photos is it possible ?
@viskin any ideas please? thanks in advance
@viskin http://stackoverflow.com/questions/17807507/save-photo-to-camera-roll-with-specific-filename maybe can help
Are we talking about iOS? The plugin on iOS uses
ALAssetsLibrary.writeImageData(toSavedPhotosAlbum: sourceData, metadata: nil)
to save image, and
ALAssetsLibrary.writeVideoAtPath(toSavedPhotosAlbum: videoURL)
to save video. I don't know about possibility for these APIs to specify file name in the library. If there is, it shouldn't be complex to add this functionality to the plugin.
@viskin yes for ios it will be perfect if you can add it i try to do it but not done
@viskin i did search and try thing but did not work at all your help will be much appreciated
I don't see iOS supports this functionality. Sorry. If it is, tell me how to do it, and I'll check if it possible to integrate it into the plugin.
@viskin i find this link may can help http://ootips.org/yonat/how-to-set-the-image-name-when-saving-to-the-camera-roll/
I'm getting an error when trying to save to video to photos app. Here is error output. Any suggestions? [Generic] Failed to load image data for asset <PHAsset: 0x101a1bcc0> AB67DE41-8F4F-4272-A112-792C6A2CB4E0/L0/001 mediaType=1/0, sourceType=1, (3000x3000), creationDate=2013-09-18 16:25:13 +0000, location=0, hidden=0, favorite=0 with format 9999