terikon / cordova-plugin-photo-library

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

Add getVideos function #37

Open kosssi opened 7 years ago

kosssi commented 7 years ago

In your plugin, I can search all pictures (getLibrary), save picture or video (thanks a lot for all of this).

It's possible to search videos?

viskin commented 7 years ago

Currently not. I just don't have such functionality in product that I developing photo-library for.

kosssi commented 7 years ago

I see for ios you use PHImageRequestOptions and I see PHVideoRequestOptions

viskin commented 7 years ago

What cordova plugins are exist that work with videos on device? Specifically, those that can play a video, and these that can display video thumbnails? First of all, research is needed.

On יום ג׳, 14 בפבר׳ 2017 at 10:40 Simon notifications@github.com wrote:

I see for ios you use PHImageRequestOptions https://developer.apple.com/reference/photos/phimagerequestoptions and I see PHVideoRequestOptions https://developer.apple.com/reference/photos/phvideorequestoptions

-

Add getVideos() on javascript

-

Add getVideos() on ios

-

Add getVideos() on android

-

May be refactoring getLibrary() to getImages()

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/terikon/cordova-plugin-photo-library/issues/37#issuecomment-279641835, or mute the thread https://github.com/notifications/unsubscribe-auth/AKYX9H0V_7DA6Og8ZYln_5Dm2FFt6iPQks5rcWhigaJpZM4L_SIn .

viskin commented 7 years ago

I think just retrieving the list of videos from device should be easy. The question is what can you do with them in Cordova? The idea of the plugin is to provide access to photos on device by URL, so you can use in your app any JavaScript library that presents photos. The big question is whether it's possible to do the same thing for videos. In contrast to photos, access to videos should be implemented as stream. You cannot return multimegabyte chunk of data as byte array. There's cordova-plugin-file plugin that provides access to files, I'm not sure they provide access as stream. If it is, it can be used. If not, providing streaming access to videos can be quite a big development. So the question is, is it possible at all, and how hard is this?

kosssi commented 7 years ago

List of cordova plugin:

But I can't find cordova plugin which return all videos from Library.

kosssi commented 7 years ago

I just add upload picture on new Cozy Cloud Mobile Application. But in few days I would like make the same for video. So I search the best plugin and It's not really bad idea to add it on yours, I think. ;)

viskin commented 7 years ago

Ok, there are plugins that can get a thumbnail. None of those plugins can play video in HTML though. I think video functionality should be added to the photo-library only if it's possible to play listed videos in HTML.

codebeauty commented 6 years ago

Hi. I have also the problem that photo-library getLibrary only response with images on Android. I need to get the id of the latest video to call shareAsset() by @ionic-native/instagram. It works pretty fine on iOS.

I just call the following and it work on iOS but NOT on Android: let observable = this.photoLibrary.getLibrary({itemsInChunk: 1, includeAlbumData: true}).take(1);

Are videos ignored by default on Android? Can we have a optional flag to get them?

Thank you and thanks for the work on that plugin.

viskin commented 6 years ago

@codebeauty photoLibrary is currently does not support working with videos. I can't see much use of getLibrary returns video metadata, without being able to play the video itself. Please use some other plugin for that.

codebeauty commented 6 years ago

@viskin thank you for feedback. Do you know another plugin? Do you have one in your mind for my use case? Thank you for any idea.

viskin commented 6 years ago

Sorry don't know

fega commented 4 years ago

@kosssi @codebeauty There is any solution for this? Thanks

@viskin I think this feature would be useful too. and I think is under the scope of this since you have a saveVideo method :)

fega commented 4 years ago

@viskin I just Checked in The code and saw that includeVideos was available, I used it and it worked :D

But maybe this plugin needs a documentation improvement

tamsel12 commented 4 years ago

@fega IncludeVideos not working , It is not fetching the video details

fega commented 4 years ago

@tamsel12 after some work with this plugin I can confirm that video pick works on IOS but not on Android

Cozmoz commented 2 years ago

I too would also love to see video support when using getLibrary(). The ability of getting the video as a blob as shown using cordova.plugins.photoLibrary.getPhoto on the homepage would also be very helpful as photos and video are both displayed in a phones gallery.

Would it be possible to set up a bounty for this functionality?