Skip to content

前后摄像头切换出现 Couldn't skip MP4 header :/ #8

@1812507678

Description

@1812507678

`public void switchCamera() throws RuntimeException, IOException {
if (Camera.getNumberOfCameras() == 1) throw new IllegalStateException("Phone only has one camera !");
boolean streaming = mStreaming;
boolean previewing = mCamera!=null && mCameraOpenedManually;

    Log.w("JCameara", "streaming:"+streaming);
    Log.w("JCameara", "previewing:"+previewing);

    mCameraId = (mCameraId == CameraInfo.CAMERA_FACING_BACK) ? CameraInfo.CAMERA_FACING_FRONT : CameraInfo.CAMERA_FACING_BACK; 
    Log.w("JCameara", "mCameraId:"+mCameraId);

    setCamera(mCameraId);
    stopPreview();
    if (previewing) startPreview();
    if (streaming) start(); 
}

`

调用这个方法,进行前后摄像头的切换,但是会出现问题,报“Couldn't skip MP4 header :/”异常,请问是什么原因,方qq联系吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions