當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。