Giter VIP home page Giter VIP logo

Comments (9)

nkalupahana avatar nkalupahana commented on July 3, 2024

Hi! Unfortunately, this is not currently supported through the plugin -- but that's because you don't need a third party plugin to get images on Android! When you call getAlbums() on Android, you'll get a file path to the album (the identifier). You can then use the built-in Capacitor Filesystem plugin to get the images out of the album (folder).

from media.

maximilien0405 avatar maximilien0405 commented on July 3, 2024

Oh ! Okay great i will try that then :) thanks for the info

from media.

maximilien0405 avatar maximilien0405 commented on July 3, 2024

Hi, i'm working on that feature right now. However the capacitor Filesystem plugin only allows me to get a directory if i provide the path. I saw that there is a getAlbumPath() function on this plugin, but it's not avaiable on IOS. Is there another way to get the path on IOS ? I don't want to use the getMedias() function for IOS because i need the videos too.. :p @nkalupahana

Thanks for your help btw, i'm completely lost in all of that since it's my first app :)

from media.

nkalupahana avatar nkalupahana commented on July 3, 2024

@maximilien0405 images aren't stored at a path on iOS, which is why that function isn't available on iOS. Let me see if we can change getMedias to return videos.

from media.

maximilien0405 avatar maximilien0405 commented on July 3, 2024

Okay thanks ! It would be cool ! Also i just saw the documentation, it would be also great to have a way to get images from an X index to X other index ? Because as i understand, right now there is only a "quantity" option settings, but if i'm trying to get the first 100 images, then the next 100 ones to avoid loading them all, then it's not possible :/
Basically i'm trying to recreate the same modal to pick images/videos as the Discord one one mobile @nkalupahana

from media.

nkalupahana avatar nkalupahana commented on July 3, 2024
  1. I've added functionality to give video thumbnails along with photo thumbnails via getMedias() -- should be released soon.
  2. Just increase the quantity from 100 to 200 to paginate -- the OS should cache the first 100, so there shouldn't be too much of a performance hit, and you can just display images 100 - 200.
  3. Unfortunately, I don't currently have the time to implement something that can get a full-sized image or video from the photo library. I would recommend using a Capacitor image/video picker plugin that already exists: for example, https://github.com/capawesome-team/capacitor-plugins/tree/main/packages/file-picker. If anyone wants to implement this, I think the best thing to do would be to create a function on iOS that takes the media identifier and returns a filesystem URL, so it can be manipulated the same way as the Android media identifiers.

from media.

maximilien0405 avatar maximilien0405 commented on July 3, 2024

@nkalupahana Oh great ! Thanks for making the changes :)
Yeah, unfortunatly i didn't find anything anywere in a Capacitor plugin to get an full asset by it's identifier, and i don't know how to implement that since i dont code with swift, but i did look into it, and found this in the apple documentation : https://developer.apple.com/documentation/photokit/phasset/1624732-fetchassets maybe this is a lead ?

from media.

maximilien0405 avatar maximilien0405 commented on July 3, 2024

@nkalupahana Hi, just wanted to tell you i oppened a pull request and tried to implement a function to get the path of a media in IOS, it's right there -> #88

from media.

nkalupahana avatar nkalupahana commented on July 3, 2024

I've added a getMediaByIdentifier function to v6.0.0. Let me know how it works for you. A sample implementation of it is in the example app.

from media.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.