cordova-plugin-mediaPicker icon indicating copy to clipboard operation
cordova-plugin-mediaPicker copied to clipboard

defaultSelectedList option

Open alaanasreng opened this issue 6 years ago • 6 comments

defaultSelectedList Option

Hello Sir,

Firstly, Thanks For Great Work.

Secondly,

is defaultSelectedList option work? how use it?

Can load only media in specific directory?

Best Regards Alaa Nasr

alaanasreng avatar Sep 07 '18 05:09 alaanasreng

sorry sir, defaultSelectedList option can't support on ios.

DmcSDK avatar Sep 07 '18 07:09 DmcSDK

i don't want it for ios, but i need it for android

alaanasreng avatar Sep 07 '18 08:09 alaanasreng

After selecting the picture, if you enter the selection interface again, the LIST you passed in will be selected by default.

DmcSDK avatar Sep 07 '18 08:09 DmcSDK

thanks for replying,

i am sorry for more questions

is the LISTs can be modified? How To Manage It from JS?

Best Regards

alaanasreng avatar Sep 07 '18 08:09 alaanasreng

var args = { 'selectMode': 101, //101=picker image and video , 100=image , 102=video 'maxSelectCount': 40, //default 40 (Optional) 'maxSelectSize': 188743680, //188743680=180M (Optional) }; MediaPicker.getMedias(args, function(medias) { args.defaultSelectedList = medias; })

DmcSDK avatar Sep 07 '18 08:09 DmcSDK

Maybe we can add a getAlbumList function to return a object which has key of assetCollectionSubtype and value as localizedTitle, and then we can let the user to choose the default collection when they call getMedia. And I think the default collection should be the user's camera roll, which subtype is PHAssetCollectionSubtypeSmartAlbumUserLibrary. Because this collection has the all the medias.

This default option is related to the issue I raised yesterday about the index pointer code defect.

I will submit a PR for fixing this later :)

guoyongxin avatar Nov 13 '18 00:11 guoyongxin