Comments (9)
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.
Oh ! Okay great i will try that then :) thanks for the info
from media.
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.
@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.
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.
- I've added functionality to give video thumbnails along with photo thumbnails via
getMedias()
-- should be released soon. - 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.
- 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.
@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.
@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.
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)
- docs(android): make it clear that file return on savePhoto is only available on Android
- App crash after downloading an image HOT 8
- App is crashed on Android due to EACCES (Permission denied) HOT 11
- Is there any method to retrieve more photos like using offset in query? HOT 1
- feat(android): add getAlbumsPath() function to get where albums are stored on filesystem
- Error: RuntimeException occurred : In SaveVideo method HOT 1
- READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are still required in Android 13 HOT 5
- RuntimeException occurred / EACCES (Permission denied) when trying to save a photo/gif/video on android < 13 HOT 12
- When wanting to save photo to Album with identifier, getting identifier doesnt exist even tho Album exist HOT 3
- feat(ios): support jpeg files instead of png HOT 3
- Camera plugin is not implement on Android (Capacitor Camera) when pairing with Capacitor-Community/Media HOT 2
- savePhoto is not working in android 8.1.0 Samsung SM-T580 tablet HOT 1
- MediaFetchOptions support individual photo for high resolution HOT 2
- feat: has access right / error codes for all errors HOT 5
- feat: Capacitor 6 Support HOT 4
- Failed to parse source map HOT 1
- Capacitor 5 - iOS savePhoto from public/images file HOT 2
- Photo Gallery Sync HOT 1
- Cache function HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media.