title: Video capturing in nougat?
body: <p><strong>I am Create Video capturing app in nougat supported but i am capturing video and that video is capture and save to default camera folder but that result code is -1. I am using following code.</strong></p>
  
  <pre><code>public void startRecordingVideo() {
      if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)) {
          Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
          File mediaFile = new File(
                  Environment.getExternalStorageDirectory().getAbsolutePath() + "/myvideo.mp4");
          videoUri = Uri.fromFile(mediaFile);
          //intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri);
          startActivityForResult(intent, VIDEO_CAPTURE);
      } else {
          Toast.makeText(this, "No camera on device", Toast.LENGTH_LONG).show();
      }
  }
  </code></pre>
  
  <p><strong>I am putting My onActivityResult code here</strong></p>
  
  <pre><code>if (requestCode == VIDEO_CAPTURE) {
              //if (resultCode == RESULT_OK) {
                  int width = 0, DisplayWidth = 0;
                  //int height = 0, DisplayHeight = 0;
                  if (new File(Constants.APP_PATH + "/myvideo1.mp4").exists()) {
                      MediaMetadataRetriever retriever = new MediaMetadataRetriever();
                      retriever.setDataSource(Constants.APP_PATH + "/myvideo1.mp4");
                      Bitmap bmp = retriever.getFrameAtTime();
                      width = bmp.getHeight();
  
                      VideoPath = Constants.APP_PATH + "/myvideo1.mp4";
                      DisplayMetrics displaymetrics = new DisplayMetrics();
                      MainActivity.this.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
                      DisplayWidth = displaymetrics.widthPixels;
                      String time = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
                      int VideoDuration = Integer.parseInt(time);
                      if (width &gt;= DisplayWidth * 1.5 &amp;&amp; VideoDuration &lt;= Constants.VIDEO_UPPER_LIMIT) {
                          new ResizeVideoTask(VideoPath).execute();
                      } else if (VideoDuration &gt; Constants.VIDEO_UPPER_LIMIT) {
                          showTimeDialog();
                      } else {
                          File afile = new File(VideoPath);
                          String path = Constants.APP_PATH + "/myvideo.mp4";
                          File destfile = new File(path);
                          if (destfile.exists()) {
                              destfile.delete();
                          }
                          copyFile(new FileInputStream(afile),new FileOutputStream(destfile));
                          Intent switchIntent = new Intent(MainActivity.this,VideoActivity.class);
                          switchIntent.putExtra("URI", Uri.fromFile(destfile).toString());
                          switchIntent.putExtra("FILE_PATH", path);
                          startActivity(switchIntent);
                      }
                      retriever.release();
                  }
              } else if (resultCode == RESULT_CANCELED) {
  
              } else {
  
              //}
          }
  </code></pre>