本文整理匯總了Java中android.media.MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN屬性的典型用法代碼示例。如果您正苦於以下問題:Java MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN屬性的具體用法?Java MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN怎麽用?Java MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.media.MediaRecorder
的用法示例。
在下文中一共展示了MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInfo
@Override
public void onInfo(MediaRecorder mediaRecorder, int what, int extra) {
if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED || what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED || what == MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN) {
MediaRecorder tempRecorder = recorder;
recorder = null;
if (tempRecorder != null) {
tempRecorder.stop();
tempRecorder.release();
}
if (onVideoTakeCallback != null) {
final Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(recordedFile, MediaStore.Video.Thumbnails.MINI_KIND);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
if (onVideoTakeCallback != null) {
onVideoTakeCallback.onFinishVideoRecording(bitmap);
onVideoTakeCallback = null;
}
}
});
}
}
}
示例2: onInfo
@Override
public void onInfo(MediaRecorder mediaRecorder, int what, int extra) {
if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED || what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED || what == MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN) {
MediaRecorder tempRecorder = recorder;
recorder = null;
if (tempRecorder != null) {
tempRecorder.stop();
tempRecorder.release();
}
final Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(recordedFile, MediaStore.Video.Thumbnails.MINI_KIND);
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
onVideoTakeCallback.onFinishVideoRecording(bitmap);
}
});
}
}
示例3: onInfo
@Override
public void onInfo(MediaRecorder mr, int what, int extra) {
Log.d(TAG, "onInfo what:" + what + " extra:" + extra);
switch (what) {
case MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED:
Log.d(TAG, "onInfo what:MEDIA_RECORDER_INFO_MAX_DURATION_REACHED" + " extra:" + extra);
break;
case MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN:
Log.d(TAG, "onInfo what:MEDIA_RECORDER_INFO_UNKNOWN" + " extra:" + extra);
break;
}
notifyRecorderInfo(what, extra);
}
示例4: onInfo
@Override
public void onInfo(MediaRecorder mr, int what, int extra) {
switch(what) {
case MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED:
case MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED:
playAudioPresenter.setInternalPathForPlay(InternalPaths.MAX_VIDEO_RECORDED);
playAudioPresenter.start();
stopRecording();
break;
case MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN:
logi("Error in media recorder - What = " + what + " extra = " + extra);
stopRecording();
break;
}
}
示例5: onInfo
@Override
public void onInfo(MediaRecorder affectedRecorder, int what, int extra) {
if (controller == null || affectedRecorder != controller.recorder) {
Log.w(TAG, "onInfo called with wrong recorder. Ignoring.");
return;
}
switch (what) {
case MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED:
form.dispatchErrorOccurredEvent(this, "recording",
ErrorMessages.ERROR_SOUND_RECORDER_MAX_DURATION_REACHED);
break;
case MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED:
form.dispatchErrorOccurredEvent(this, "recording",
ErrorMessages.ERROR_SOUND_RECORDER_MAX_FILESIZE_REACHED);
break;
case MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN:
form.dispatchErrorOccurredEvent(this, "recording", ErrorMessages.ERROR_SOUND_RECORDER);
break;
default:
// value of `what` is not valid, probably device-specific debugging. escape early to prevent
// stoppage until we see an Android-defined error. See also:
// http://stackoverflow.com/questions/25785420/mediarecorder-oninfolistener-giving-an-895
return;
}
try {
Log.i(TAG, "Recoverable condition while recording. Will attempt to stop normally.");
controller.recorder.stop();
} catch(IllegalStateException e) {
Log.i(TAG, "SoundRecorder was not in a recording state.", e);
form.dispatchErrorOccurredEventDialog(this, "Stop",
ErrorMessages.ERROR_SOUND_RECORDER_ILLEGAL_STOP);
} finally {
controller = null;
StoppedRecording();
}
}