mirror of
https://github.com/status-im/react-native-camera.git
synced 2026-08-31 13:41:08 +00:00
Expose the react application context as a singleton.
This commit is contained in:
@@ -79,7 +79,7 @@ public class RCTCameraModule extends ReactContextBaseJavaModule
|
||||
public static final int MEDIA_TYPE_IMAGE = 1;
|
||||
public static final int MEDIA_TYPE_VIDEO = 2;
|
||||
|
||||
private final ReactApplicationContext _reactContext;
|
||||
private static ReactApplicationContext _reactContext;
|
||||
private RCTSensorOrientationChecker _sensorOrientationChecker;
|
||||
|
||||
private MediaRecorder mMediaRecorder = new MediaRecorder();
|
||||
@@ -96,6 +96,10 @@ public class RCTCameraModule extends ReactContextBaseJavaModule
|
||||
_reactContext.addLifecycleEventListener(this);
|
||||
}
|
||||
|
||||
public static ReactApplicationContext getReactContextSingleton() {
|
||||
return _reactContext;
|
||||
}
|
||||
|
||||
public void onInfo(MediaRecorder mr, int what, int extra) {
|
||||
if ( what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED ||
|
||||
what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED) {
|
||||
|
||||
Reference in New Issue
Block a user