fix snapshot orientation when device orientation is locked (#232)

* use device orientation on android only with auto orientation

* guard against missing playSoundOnCapture and quality props in options

* add video orientation support

* use device orientation on ios only with auto orientation
This commit is contained in:
Radu-Marius Popovici
2016-05-10 11:05:03 -07:00
committed by Zack Story
parent f9137824a0
commit 0c3dba1ff6
5 changed files with 83 additions and 38 deletions
@@ -9,6 +9,7 @@ import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.view.Surface;
import com.facebook.react.bridge.ReactApplicationContext;
@@ -51,13 +52,13 @@ public class RCTSensorOrientationChecker {
float y = event.values[1];
if (x<5 && x>-5 && y > 5)
mOrientation = 0;
mOrientation = Surface.ROTATION_0; // portrait
else if (x<-5 && y<5 && y>-5)
mOrientation = 3;
mOrientation = Surface.ROTATION_270; // right
else if (x<5 && x>-5 && y<-5)
mOrientation = 2;
mOrientation = Surface.ROTATION_180; // upside down
else if (x>5 && y<5 && y>-5)
mOrientation = 1;
mOrientation = Surface.ROTATION_90; // left
if (mListener != null) {
mListener.orientationEvent();