Is it possible to set a maximum time allowed for android recording using intent?

前端 未结 6 750
天命终不由人
天命终不由人 2021-01-31 03:44

I am using the android.provider.MediaStore.ACTION_VIDEO_CAPTURE. I was wondering if there is a way to change the maximum time allowed per recording. I TRIED ADDING

6条回答
  •  故里飘歌
    2021-01-31 04:46

    Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
    intent.putExtra("android.intent.extra.durationLimit", 30000);
    intent.putExtra("EXTRA_VIDEO_QUALITY", 0);
    startActivityForResult(intent, ActivityRequests.REQUEST_TAKE_VIDEO);
    

    This code works well on API 2.2, but the duration limit does not work on API 2.1

    android.intent.extra.durationLimit was introduced in API Level 8, so it's not available in Eclair and earlier, unfortunately. Some device manufacturers may have a proprietary way to set the maximum duration on older devices, which explain why you have seen this working on some pre-Froyo applications.

提交回复
热议问题