mediafilepicker: how to gain access to selected file

153 Views Asked by At

Hi I am new to nativescript and i am trying to select video files, i was trying to use nativescript-mediafilepicker, it successfully opens the folders but i am not sure how to select a file using the same programatically.

let mediafilepicker = new Mediafilepicker();
mediafilepicker.openImagePicker(options);
 
mediafilepicker.on("getFiles", function (res) {
    let results = res.object.get('results');
    console.dir(results);
})
 
mediafilepicker.on("error", function (res) {
    let msg = res.object.get('msg');
    console.log(msg);
});
 
mediafilepicker.on("cancel", function (res) {
    let msg = res.object.get('msg');
    console.log(msg);
});

Thanks in advance

1

There are 1 best solutions below

0
On

You won't have any control on the selection UI / videos as it will be a system or third party app that was opened through Intent, which is totally outside your app context.

If you like more control over every user action in picker UI, then you will probably have to build one yourself. There are few open source iOS / Android libraries that may probably support this feature, you can extend them to NativeScript if you are familiar with plugins architecture.