我在我的视频录制应用中设置了mEdiaRecorder.setMaxDuration(60 * 1000);
(60秒),我希望在录制时间到期时触发方法。帮我找到一种方法。
谢谢。
答案 0 :(得分:1)
mMediaRecorder.setOnInfoListener(new medialistener());
class medialistener implements MediaRecorder.OnInfoListener {
public void onInfo(MediaRecorder recorder, int what, int extra)
{
if(what==MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED)
{
// Do what you want to do...
}
// Log.i("video test", "Video Info: "+what+", "+extra);
}
}