title: MediaExtractor, MediaMetadataRetriever with Raw/Asset File
body: <p>I try to read a video file inside either raw/assets folder, I have tried the following approaches but none of them works. I am testing on API 16. Each approach, I try with and without mp4 extension. I really appreciate that somebody can help me with it </p>
  
  <p>All approaches will not crash, <code>MediaMetadataRetriever</code> can set data source, but cannot get width, height and screenshot. <code>VideoExtractor</code> always return</p>
  
  <pre><code>06-04 16:44:10.519: E/FileSource(8695): Failed to open file FILE_PATH. (No such file or directory)
  06-04 16:44:10.519: E/DecodeActivity(8695): Can't find video info!
  </code></pre>
  
  <p><strong>Approach 1:android.resource</strong></p>
  
  <pre><code>String filePath = "android.resource://" + this.activity.getPackageName() + "/raw/green_backhand_slice";
  videoExtractor.setDataSource(activity.getApplicationContext(), Uri.parse(filePath), null);
  metaRetriever.setDataSource(act.getApplication(), Uri.parse(filePath));
  </code></pre>
  
  <p><strong>Approach 2: android_asset</strong></p>
  
  <pre><code>this.filePath = "file:///android_asset/green_backhand_slice";
  videoExtractor.setDataSource(activity.getApplicationContext(), Uri.parse(this.filePath), null);
  metaRetriever.setDataSource(act.getApplication(), Uri.parse(filePath));
  </code></pre>
  
  <p><strong>Approach 3: asset file descriptor</strong></p>
  
  <pre><code>AssetFileDescriptor assetFD = null;
  try {
      assetFD = getAssets().openFd("green_backhand_slice.mp4");
  } catch (IOException e) {
      e.printStackTrace();
  }
  
  metaRetriever.setDataSource(assetFD.getFileDescriptor());
  </code></pre>