I have an android application that loads web pages in an activity with a WebView. I am using the retrieving the page manually and using WebView's loadDataWithBaseURL to display it on screen. Everything there is fine.
Now, i am trying to override the Back button press to simulate going back in the WebView history stack. I am able to override the Back button press, i can see that there is a history stack in the WebView, i can see that …
我正在尝试实现我可以多次启动和停止视频录制的功能,并将视频数据累积到File.
这就是我准备我的媒体记录器的方法:
private boolean prepareVideoRecorder(){
mMediaRecorder = new MediaRecorder();
//0 for landscape
//90 for portrait
//Check for available profile
CamcorderProfile profile = null;
if(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_480P)){
Log.d(TAG, "480p");
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
}else if(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P)){
Log.d(TAG, "720p");
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_720P);
}else{
Log.d(TAG, "LOW");
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
}
// Step 1: Unlock and set camera to MediaRecorder
mCamera.unlock();
mMediaRecorder.setCamera(mCamera);
// Step 2: Set sources
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
// Step 3: Set profile
mMediaRecorder.setProfile(profile);
// Step 4: Set output file and pass media recorder the …Run Code Online (Sandbox Code Playgroud)