Android Samsung video EXTRA_SIZE_LIMIT 600K Max MMS
why i can't control the size of the video in Samsung GalaxyS, it always record in hi resolution on other devices it work well
code example:
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
intent.put开发者_StackOverflow社区Extra(MediaStore.EXTRA_VIDEO_QUALITY, 0);
intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, UiConstants.MAX_MMS_SIZE);
startActivityForResult(intent, NEW_VIDEO);
overridePendingTransition(0, 0);
This will work...
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT,10); //10 sec
intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT,12582912L); //12*1024*1024=12MiB
startActivityForResult(intent, NEW_VIDEO);
overridePendingTransition(0, 0);
'L' is important.. It worked in my samsung phones
Android OEMs like Samsung can (and often do) modify the camera app to work with the cameras on their devices.
So, the most likely reason your code is not working is because Samsung's version of the default camera application either does not support low-res video capture, or it doesn't understand/process the MediaStore.EXTRA_SIZE_LIMIT correctly.
I suggest building a compatibility function that checks the final size of the video to de-rez and clip to your MMS size limit.
Edit: Just tried MediaStore.EXTRA_SIZE_LIMIT on a couple of devices (including a Samsung and Motorola OG Droid) and could not get it to work. MediaStore.EXTRA_DURATION_LIMIT worked fine, however.
intent.putExtra(MediaStore.EXTRA_SIZE_LIMIT,"1048576"); //1048576=(1*1024*1024)
I had to pass it as a string to limit image size
精彩评论