public static ArrayList<File> getFiles(File dir, String[] filter) {
        ArrayList<File> Files = new ArrayList<File>();
        if (dir.isDirectory()) {
            if (dir.listFiles() != null) {
                for (File child : dir.listFiles()) {
                    Files.addAll(getFiles(child, filter));
                }
            }
        } else if (isVideoFile(dir, filter)) {
            Files.add(dir);
        }
        return Files;
    }