From 72c77875e48fc46552edf3cac7f7feddc86a42dd Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 13 Apr 2021 13:38:44 +0100 Subject: [PATCH] Core/UI decoupling: Remove setUseSensorRotation from views Other properties of SphericalGLSurfaceView (e.g., setDefaultStereoMode) are not plumbed through the PlayerView components, and it doesn't scale to plumb through all properties of all of the SurfaceView types. Applications can instead do: ``` ((SphericalGLSurfaceView) playerView.getVideoSurfaceView()) .setUseSensorRotation(useSensorRotation); ``` PiperOrigin-RevId: 368196537 --- RELEASENOTES.md | 4 +++ .../android/exoplayer2/ui/PlayerView.java | 27 ------------------- .../exoplayer2/ui/StyledPlayerView.java | 27 ------------------- library/ui/src/main/res/values/attrs.xml | 3 --- 4 files changed, 4 insertions(+), 57 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4b2923c976..7646e4f42a 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -31,6 +31,10 @@ * Fix `StyledPlayerControlView` to stay in full mode (rather than minimal mode) when possible ([#8763](https://github.com/google/ExoPlayer/issues/8763)). + * Remove `setUseSensorRotation` from `PlayerView` and `StyledPlayerView`. + Instead, cast the view returned by `getVideoSurfaceView` to + `SphericalGLSurfaceView`, and then call `setUseSensorRotation` on the + `SphericalGLSurfaceView` directly. * Audio: * Report unexpected discontinuities in `AnalyticsListener.onAudioSinkError` diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java index 90f6a31d3e..0191c7c6b5 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java @@ -146,12 +146,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; *
  • Corresponding method: None *
  • Default: {@code surface_view} * - *
  • {@code use_sensor_rotation} - Whether to use the orientation sensor for rotation - * during spherical playbacks (if available). - * *
  • {@code shutter_background_color} - The background color of the {@code exo_shutter} * view. * - *
  • {@code use_sensor_rotation} - Whether to use the orientation sensor for rotation - * during spherical playbacks (if available). - * *
  • {@code shutter_background_color} - The background color of the {@code exo_shutter} * view. *