title: Code to open video in videoView from android phone storage
body: <p>I have been modifying an example video player code; the example code played the video from the program resource directory. I copied the video to the phone's /storage/emulated/0/DCIM/ directory and add three lines:</p>
  
  <p>String videoName1 = Environment.getExternalStorageDirectory().getPath()+"/DCIM/steprock";</p>
  
  <p>Uri videoUri = Uri.parse(videoName1);</p>
  
  <p>videoView.setVideoURI(videoUri);</p>
  
  <p>to replace:</p>
  
  <p>videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.steprock));</p>
  
  <p>This change causes a file not found error. The video is in the Phone storage DCIM directory. I also tried adding the .mp4 to the video name.</p>
  
  <p>In debug mode the uri appears to be the correct value: /storage/emulated/0/DCIM/steprock</p>
  
  <p>Can anyone spot the code error? A partial listing is below:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      final VideoView videoView = (VideoView) findViewById(R.id.video_view);
      String videoName1 = Environment.getExternalStorageDirectory().getPath()+"/DCIM/steprock";
      Uri videoUri = Uri.parse(videoName1);
      videoView.setVideoURI(videoUri);
      //videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.steprock));
  </code></pre>