code: protected boolean isMultimedia(File file) {
          //noinspection SimplifiableIfStatement
          if (isDir(file)) {
              return false;
          }
  
          String path = file.getPath().toLowerCase();
          for (String ext : MULTIMEDIA_EXTENSIONS) {
              if (path.endsWith(ext)) {
                  return true;
              }
          }
  
          return false;
      }
docs: An extremely simple method for identifying multimedia. This
  could be improved, but it's good enough for this example.
  
  @param file which could be an image or a video
  @return true if the file can be previewed, false otherwise