title: play video from android internal storage
body: <p>I'm trying to play video files stored in android internal memory through intent. Files exist there but when i try to play them through intent, it give me the error "Media file not supported" or "can't play video" depending on device. I couldn't find where i'm wrong. here is my code</p>
  
  <pre><code>File mydir = activity.getDir("Videos", Context.MODE_PRIVATE);
  File fileWithinMyDir = new File(mydir, filename);
  String videoResource = fileWithinMyDir.getPath();
  Uri intentUri = Uri.parse(videoResource);
  
  Intent intent = new Intent();
  intent.setAction(Intent.ACTION_VIEW);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  intent.setDataAndType(intentUri, "video/mp4");
  startActivity(intent);
  </code></pre>
  
  <p>I don't know where i'm wrong and what should i do. any help would be much appreciated. Thank you :)</p>