当前位置: 首页>>代码示例>>Java>>正文


Java MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN属性代码示例

本文整理汇总了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;
                    }
                }
            });
        }
    }
}
 
开发者ID:chengzichen,项目名称:KrGallery,代码行数:23,代码来源:CameraController.java

示例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);
            }
        });
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:18,代码来源:CameraController.java

示例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);
}
 
开发者ID:LeonHover,项目名称:MediaCodecRecorder,代码行数:13,代码来源:AndroidRecorder.java

示例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;
    }
}
 
开发者ID:Samsung,项目名称:microbit,代码行数:15,代码来源:CameraActivity_OldAPI.java

示例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();
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:36,代码来源:SoundRecorder.java


注:本文中的android.media.MediaRecorder.MEDIA_RECORDER_INFO_UNKNOWN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。