是否可以设置为允许使用Android的意图记录的最大时间? [英] Is it possible to set a maximum time allowed for android recording using intent?
问题描述
我现在用的是 android.provider.MediaStore.ACTION_VIDEO_CAPTURE
。我在想,如果有一种方法来改变每个记录所允许的最长时间。我尝试添加
Intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT,60000); //最大值为60秒
但它仍然记录传递。先谢谢了。
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
Intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT,60000);//max of 60 seconds
but it continues recording pass that. Thanks in advance.
推荐答案
其实, MediaStore.EXTRA_DURATION_LIMIT
提供时间秒,不是以毫秒为单位!
所以,你只需要改变从60000到60你的价值;)
<一href="http://developer.android.com/reference/android/provider/MediaStore.html#EXTRA_DURATION_LIMIT">Android文档
Actually, MediaStore.EXTRA_DURATION_LIMIT
provide time in seconds, NOT in miliseconds!
So you just need to change your value from 60000 to 60 ;)
Android Documentation
这篇关于是否可以设置为允许使用Android的意图记录的最大时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!