Browse Source

refactor

bk_recording
Bastian Kohler 1 year ago
parent
commit
675d4423e4
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      app/src/main/java/com/example/ueberwachungssystem/Recorder.java

+ 7
- 0
app/src/main/java/com/example/ueberwachungssystem/Recorder.java View File

@@ -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…
Cancel
Save