DmcSDK / cordova-plugin-mediaPicker

cordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
MIT License
138 stars 92 forks source link

You can use on ionic 3 #116

Open vijay471 opened 3 years ago

vijay471 commented 3 years ago

You can use on ionic 3

ionic cordova plugin add https://github.com/DmcSDK/cordova-plugin-mediaPicker.git --variable IOS_PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"

let args = {
        "selectMode": 100, //101=picker image and video , 100=image , 102=video
        "maxSelectCount": 5,
        "maxSelectSize": 21000000 // 20mb
};

(window as any).MediaPicker.getMedias(args, (medias: any[]) => {
        console.log(medias);
}, (err: any) => {
        console.log(err)
});

Originally posted by @secretmoo35 in https://github.com/DmcSDK/cordova-plugin-mediaPicker/issues/105#issuecomment-611934047

Not working😞

Error MediaPicker not function

secretmoo35 commented 3 years ago

Platform you are using?

dmlwls95 commented 2 years ago

Hi, I solve this problem. use like this

`
import ~~~
declare var MediaPicker;
@component({})

yourMethod(){
let args = {
        "selectMode": 100, //101=picker image and video , 100=image , 102=video
        "maxSelectCount": 5,
        "maxSelectSize": 21000000 // 20mb
};
MediaPicker.getMedias(args, (medias: any[]) => {
        console.log(medias);
}, (err: any) => {
        console.log(err)
});
}
`