Reputation: 764
I am trying to limit video recording duration by 5 seconds. I am using default camera and this code:
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 5);
Now it works fine on Samsung S6, it stops recording after 5 seconds but I just tested on HTC older version and it just keeps recording after 5s pass. Any suggestion of how to limit the recording time for all of the phones?
Upvotes: 1
Views: 1163
Reputation: 1006819
Any suggestion of how to limit the recording time for all of the phones?
Record it yourself, using a camera API (e.g., android.hardware.Camera
) and MediaRecorder
, or a library that wraps around those.
ACTION_VIDEO_CAPTURE
invokes a third-party camera app, and there are hundreds of these. EXTRA_DURATION_LIMIT
is a request, and not all camera apps will honor it.
Upvotes: 1