[android-developers] Re: media.oninfolistener
This worked for me when using onInfoListener.
mediaRecorder = new MediaRecorder();
... all your setup stuff ...
mediaRecorder.setOnInfoListener(new MediaRecorder.OnInfoListener(){
@Override
public void onInfo(MediaRecorder mr, int what, int extra) {
if(what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED
||
what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED)
{
... do something ...
}
}
});
For your second question you use a handler, starting it after you
start recording. See the following link for an example.
http://developer.android.com/resources/articles/timed-ui-updates.html
On Jun 17, 10:41 am, Tberry <apap...@gmail.com> wrote:
> Hey guys, I am still learning android. I was just wondering how to use
> the media oninfoListener. I am trying to show the user that thevideo
> time has finished and then stop the recording when my customvideo
> recording is finished. Here is a little of what I have below.
>
> public void OnInfo(){
> if(what==MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED)
> {
> log.v("VIDEOCAPTURE","Maximum Recordingvideoreached");
> recorder.stop();
> }
> }
> }
>
> The error I am getting is that my "what" is not being recognized as
> part of the oninfolistener class.
>
> Also is there a way on a surface view to perform and shows the amount
> of seconds being recording in avideo? Any help will be highly
> appreciated!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home