Video selection from gallery: Limit only videos up to 30 seconds should be selected
How can I control videos up to 30 seconds should be selected else show Toast/Popup. I can get video's path in onActivityResult and can run video but can't get duration. Any suggestion, below is my code: case Utils.REQUEST_CODE_GALLERY_VIDEO: if (resultCode == Activity.RESULT_OK) { Uri selectedVieo = data.getData(); String[] filePathColumn = { MediaStore.Video.Media.DATA }; Cursor cursor = getContentResolver().query(selectedVieo, filePathColumn, null, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); String filePath = cursor.getString(columnIndex);