mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fall back to TYPE_ROTATION_VECTOR if TYPE_GAME_ROTATION_VECTOR unavailable
Issue: #5119 PiperOrigin-RevId: 222978448
This commit is contained in:
parent
38c53298b0
commit
017923ed81
2 changed files with 15 additions and 6 deletions
|
|
@ -9,6 +9,9 @@
|
||||||
([#5063](https://github.com/google/ExoPlayer/issues/5063)).
|
([#5063](https://github.com/google/ExoPlayer/issues/5063)).
|
||||||
* MP4: Support Opus and FLAC in the MP4 container, and in DASH
|
* MP4: Support Opus and FLAC in the MP4 container, and in DASH
|
||||||
([#4883](https://github.com/google/ExoPlayer/issues/4883)).
|
([#4883](https://github.com/google/ExoPlayer/issues/4883)).
|
||||||
|
* Spherical video: Fall back to `TYPE_ROTATION_VECTOR` if
|
||||||
|
`TYPE_GAME_ROTATION_VECTOR` is unavailable
|
||||||
|
([#5119](https://github.com/google/ExoPlayer/issues/5119)).
|
||||||
* Support seeking for a wider range of MPEG-TS streams
|
* Support seeking for a wider range of MPEG-TS streams
|
||||||
([#5097](https://github.com/google/ExoPlayer/issues/5097)).
|
([#5097](https://github.com/google/ExoPlayer/issues/5097)).
|
||||||
* DASH: Fix detecting the end of live events
|
* DASH: Fix detecting the end of live events
|
||||||
|
|
|
||||||
|
|
@ -104,12 +104,18 @@ public final class SphericalSurfaceView extends GLSurfaceView {
|
||||||
// Configure sensors and touch.
|
// Configure sensors and touch.
|
||||||
sensorManager =
|
sensorManager =
|
||||||
(SensorManager) Assertions.checkNotNull(context.getSystemService(Context.SENSOR_SERVICE));
|
(SensorManager) Assertions.checkNotNull(context.getSystemService(Context.SENSOR_SERVICE));
|
||||||
// TYPE_GAME_ROTATION_VECTOR is the easiest sensor since it handles all the complex math for
|
Sensor orientationSensor = null;
|
||||||
// fusion. It's used instead of TYPE_ROTATION_VECTOR since the latter uses the magnetometer on
|
if (Util.SDK_INT >= 18) {
|
||||||
// devices. When used indoors, the magnetometer can take some time to settle depending on the
|
// TYPE_GAME_ROTATION_VECTOR is the easiest sensor since it handles all the complex math for
|
||||||
// device and amount of metal in the environment.
|
// fusion. It's used instead of TYPE_ROTATION_VECTOR since the latter uses the magnetometer on
|
||||||
int type = Util.SDK_INT >= 18 ? Sensor.TYPE_GAME_ROTATION_VECTOR : Sensor.TYPE_ROTATION_VECTOR;
|
// devices. When used indoors, the magnetometer can take some time to settle depending on the
|
||||||
orientationSensor = sensorManager.getDefaultSensor(type);
|
// device and amount of metal in the environment.
|
||||||
|
orientationSensor = sensorManager.getDefaultSensor(Sensor.TYPE_GAME_ROTATION_VECTOR);
|
||||||
|
}
|
||||||
|
if (orientationSensor == null) {
|
||||||
|
orientationSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR);
|
||||||
|
}
|
||||||
|
this.orientationSensor = orientationSensor;
|
||||||
|
|
||||||
scene = new SceneRenderer();
|
scene = new SceneRenderer();
|
||||||
renderer = new Renderer(scene);
|
renderer = new Renderer(scene);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue