google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

StyledPlayerControlView: Constraints for minimal mode too conservative #8763

Closed fountaingeyser closed 3 years ago

fountaingeyser commented 3 years ago

With the introduction of the minimal mode the player controls become mostly unusable in many cases. When used in portrait mode on the OnePlus 7 with a 16:9 video the minimal mode is already activated. Consequently, none of the basic controls (e.g. VR or shuffle button) are reachable for users anymore.

A thorough investigation has revealed that the height of the player is considered too small to fit the default control views: https://github.com/google/ExoPlayer/blob/4364b9150f236813a2070fc79d3bcb76e11969ac/library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlViewLayoutManager.java#L565-L589

Two possible solutions are:

  1. Relax the constraints required to display the default user interface. As shown in our screenshots there is ample space to layout both the play/pause button and the bottom controls. This could be achieved by reducing padding or margins.
  2. Provide fallback for all controls in minimal mode. This could be achieved with a simple overflow button and a bottom sheet or dialog with the basic controls (as illustrated e.g. by YouTube).
Minimal mode on OnePlus 7 Default mode on OnePlus 7
image image
ojw28 commented 3 years ago

Agree there is an issue here. It looks like the padding of exo_center_controls is not being removed from the calculation, which I think it should be. There's also a problem horizontally where the edges of the far left/right icons can end up being clipped even when there is sufficient space for them to be fully rendered.

device-2021-03-30-161823