Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getVideos function #37

Open
kosssi opened this issue Feb 13, 2017 · 16 comments
Open

Add getVideos function #37

kosssi opened this issue Feb 13, 2017 · 16 comments

Comments

@kosssi
Copy link
Contributor

kosssi commented Feb 13, 2017

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
Copy link
Member

viskin commented Feb 13, 2017

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

@kosssi
Copy link
Contributor Author

kosssi commented Feb 14, 2017

I see for ios you use PHImageRequestOptions and I see PHVideoRequestOptions

  • Add getVideos() on javascript
  • Add getVideos() on ios
  • Add getVideos() on android
  • May be refactoring getLibrary() to getImages()

@viskin
Copy link
Member

viskin commented Feb 14, 2017 via email

@viskin
Copy link
Member

viskin commented Feb 14, 2017

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
Copy link
Contributor Author

kosssi commented Feb 14, 2017

List of cordova plugin:

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

@kosssi
Copy link
Contributor Author

kosssi commented Feb 14, 2017

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
Copy link
Member

viskin commented Feb 14, 2017

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
Copy link

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
Copy link
Member

viskin commented Jun 25, 2017

@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
Copy link

@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
Copy link
Member

viskin commented Aug 18, 2017

Sorry don't know

@fega
Copy link

fega commented Jun 30, 2019

@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
Copy link

fega commented Jun 30, 2019

@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
Copy link

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

@fega
Copy link

fega commented Jan 17, 2020

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

@Cozmoz
Copy link

Cozmoz commented Sep 22, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants