How to know the Video duration from files

I want in my application to upload a video but I want to determine the duration cannot raise the video when exceeded

You can do this

It’s hard to understand what you’re saying please describe your problem properly and if you can give the screenshot of your problem then you get help fast.

I think he means that when the user chooses a video from his gallery, if that video exceeds a certain duration e.g. 1 minute, then he won’t be able to upload it to the app.

Ok now I get it . can you please show us what you have used so far or what you are using to upload the video?