refactor
This commit is contained in:
parent
63db527f64
commit
675d4423e4
@ -1,5 +1,6 @@
|
||||
package com.example.ueberwachungssystem;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.hardware.Camera;
|
||||
import android.media.CamcorderProfile;
|
||||
@ -7,6 +8,7 @@ import android.media.MediaPlayer;
|
||||
import android.media.MediaRecorder;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.VideoView;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -17,6 +19,9 @@ public class Recorder {
|
||||
private MediaRecorder mediaRecorder = null;
|
||||
private SurfaceView surfaceView;
|
||||
|
||||
private static final int SENSOR_ORIENTATION_DEFAULT_DEGREES = 90;
|
||||
private static final int SENSOR_ORIENTATION_INVERSE_DEGREES = 270;
|
||||
|
||||
public Recorder (Context context) {
|
||||
this.context = context;
|
||||
this.surfaceView = new SurfaceView(context);
|
||||
@ -50,6 +55,7 @@ public class Recorder {
|
||||
mediaRecorder.setOutputFile(context.getFilesDir() + "/video.mp4");
|
||||
|
||||
|
||||
|
||||
mediaRecorder.prepare();
|
||||
mediaRecorder.start();
|
||||
|
||||
@ -58,6 +64,7 @@ public class Recorder {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void stopRecording() {
|
||||
if (mediaRecorder != null) {
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user