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.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
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 DocumentationThis code works well on API 2.2, but the duration limit does not work on API 2.1
android.intent.extra.durationLimit
was introduced inAPI 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.Use this,here 60 is second Code: intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 60);
Here's a Kotlin update to launch
ACTION_VIDEO_CAPTURE
Intent withEXTRA_DURATION_LIMIT
set to 60 seconds. As forputExtra(MediaStore.EXTRA_DURATION_LIMIT, 60)
is taking in seconds as the value for the duration limit.Use
MediaRecorder
}
For 30 seconds time, try this code.