terikon / cordova-plugin-photo-library

Maintainer needed. Please contact if you're using this library in your project
MIT License
149 stars 298 forks source link

saveVideo not working #114

Open yanglongji opened 6 years ago

yanglongji commented 6 years ago

I got this error when I used saveVideo to save video to album:

[Generic] Video /static/video/5_seconds.mp4 cannot be saved to the photo library: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo={NSUnderlyingError=0x1c465f020 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}, NSErrorFailingURLStringKey=file:///static/video/5_seconds.mp4, NSErrorFailingURLKey=file:///static/video/5_seconds.mp4, NSURL=file:///static/video/5_seconds.mp4, NSLocalizedDescription=The requested URL was not found on this server.}

the video url I used is : http://www.sqbapp.com/static/video/5_seconds.mp4

dagobit commented 6 years ago

Same Problem here

[console] try to download:http://techslides.com/demos/sample-videos/small.mp4

[Generic] Video /demos/sample-videos/small.mp4 cannot be saved to the photo library: Error Domain=NSURLErrorDomain Code=-1100 "Die angeforderte URL wurde auf diesem Server nicht gefunden." UserInfo={NSUnderlyingError=0x1c0652240 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}, NSErrorFailingURLStringKey=file:///demos/sample-videos/small.mp4, NSErrorFailingURLKey=file:///demos/sample-videos/small.mp4, NSURL=file:///demos/sample-videos/small.mp4, NSLocalizedDescription=Die angeforderte URL wurde auf diesem Server nicht gefunden.} 2018-04-03 22:14:22.562794+0200 Maybe related to the force install, in case of file plugin dependency. Here is my full cordova plugin ls

com.synconset.imagepicker 2.1.10 "ImagePicker" cordova-plugin-add-swift-support 1.6.0 "AddSwiftSupport" cordova-plugin-app-version 0.1.9 "AppVersion" cordova-plugin-device 2.0.1 "Device" cordova-plugin-file 6.0.1 "File" cordova-plugin-file-opener2 2.0.19 "File Opener2" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-inappbrowser 2.0.2 "InAppBrowser" cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview" cordova-plugin-media-capture 3.0.1 "Capture" cordova-plugin-photo-library 2.1.0 "Photo Library" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-statusbar 2.4.1 "StatusBar" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-sqlite-storage 2.2.1 "Cordova sqlite storage plugin"

Target iOS: 11.2.5

dagobit commented 6 years ago

After some research, seems iOS blocks the download of Vidz not having the right content type. There is also an ToDo in the Repo with mentioned this stackoverflow to convert the vidz first.

https://stackoverflow.com/questions/20282672/record-save-and-or-convert-video-in-mp4-format/39329155#39329155

dagobit commented 6 years ago

found a workaround for this issue. @yanglongji fyi you can use the filetransfer to download the vid to a temp-Folder and then use the plugin to "download" (in this case it's more a local copy/move) it to the photo library.