|
|
@ -22,6 +22,8 @@ import android.widget.FrameLayout; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
import static com.flurgle.camerakit.CameraKit.Constants.FACING_BACK; |
|
|
|
import static com.flurgle.camerakit.CameraKit.Constants.FACING_BACK; |
|
|
|
import static com.flurgle.camerakit.CameraKit.Constants.FACING_FRONT; |
|
|
|
import static com.flurgle.camerakit.CameraKit.Constants.FACING_FRONT; |
|
|
@ -342,10 +344,14 @@ public class CameraView extends FrameLayout { |
|
|
|
context = ((ContextWrapper) context).getBaseContext(); |
|
|
|
context = ((ContextWrapper) context).getBaseContext(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> permissions = new ArrayList<>(); |
|
|
|
|
|
|
|
if (requestCamera) permissions.add(Manifest.permission.CAMERA); |
|
|
|
|
|
|
|
if (requestAudio) permissions.add(Manifest.permission.RECORD_AUDIO); |
|
|
|
|
|
|
|
|
|
|
|
if (activity != null) { |
|
|
|
if (activity != null) { |
|
|
|
ActivityCompat.requestPermissions( |
|
|
|
ActivityCompat.requestPermissions( |
|
|
|
activity, |
|
|
|
activity, |
|
|
|
new String[]{Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO}, |
|
|
|
permissions.toArray(new String[permissions.size()]), |
|
|
|
CameraKit.Constants.PERMISSION_REQUEST_CAMERA); |
|
|
|
CameraKit.Constants.PERMISSION_REQUEST_CAMERA); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|