Hello all. Its my first time to get in here.
I hav a issue during using MediaRecorder method.
I'm testing this issue with two target devices HTC Legend(2.2) and
Nexus S(2.3.3).
The root problem is that preview doesn't work on Nexus S.
As U see below source code, I did follow the state diagram till the
prepare.
At this moment, HTC starts show preview but Nexus S.
I cannot understand that lower version works better than later one.
I hope you to know what's the problem and let me know.
Thank you.
[code]
if (mRecorder == null) {
mRecorder = new MediaRecorder();
} else {
mRecorder.reset();
}
try {
mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setVideoFrameRate(16);
mRecorder.setVideoSize(640, 480);
mRecorder.setOutputFile(path);
mRecorder.setPreviewDisplay(mHolder.getSurface());
mRecorder.prepare();
} catch (IllegalArgumentException e) {
Toast.makeText(CustomVideoRecord.this,
"IllegalArgumentException", 1).show();
} catch (IllegalStateException e) {
Toast.makeText(CustomVideoRecord.this, "IllegalStateException",
1).show();
} catch (IOException e) {
Toast.makeText(CustomVideoRecord.this, "IOException",
1).show();
}[/code]
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en