MMediaRecorder=new MediaRecorder ();
MMediaRecorder. SetVideoSource (MediaRecorder. VideoSource. SURFACE);
MMediaRecorder. SetOutputFormat (MediaRecorder. OutputFormat. THREE_GPP);
MMediaRecorder. SetOutputFile ("/sdcard/surface. 3 gp ");
MMediaRecorder. SetVideoFrameRate (30);
MMediaRecorder. SetVideoSize (352, 288);
MMediaRecorder. SetVideoEncoder (MediaRecorder. VideoEncoder. H264);
Try {
MMediaRecorder. Prepare ();
} the catch (IOException e)
{
}
Surface recorderSurface=mMediaRecorder. GetSurface ();
Perform at the end of the line of errors: E/MediaRecorder: SurfaceMediaSource could not be initialized.
Java. Lang. An IllegalStateException: failed to get surface
CodePudding user response:
Can you tell me the solution?CodePudding user response:
MMediaRecorde. SetPreviewDisplay (mSurfaceHolder. GetSurface)CodePudding user response:
With the problem, solves the pray tell ahCodePudding user response:
This problem solved?CodePudding user response:
Could you tell me how to solve your problem?CodePudding user response:
This should be a permissions problem, dynamic application {Manifest. Permission. The CAMERA, the Manifest. Permission. WRITE_EXTERNAL_STORAGE, Manifest. Permission. READ_EXTERNAL_STORAGE, Manifest. Permission. RECORD_AUDIO} these, plus in Manifes & lt; USES - feature android: name="android. Hardware. Camera"/& gt;