Skip to content

StyledPlayerControlView: Constraints for minimal mode too conservative #8763

Closed
@fountaingeyser

Description

@fountaingeyser

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:

private boolean useMinimalMode() {
int width =
styledPlayerControlView.getWidth()
- styledPlayerControlView.getPaddingLeft()
- styledPlayerControlView.getPaddingRight();
int height =
styledPlayerControlView.getHeight()
- styledPlayerControlView.getPaddingBottom()
- styledPlayerControlView.getPaddingTop();
int centerControlWidth =
getWidthWithMargins(centerControls)
- (centerControls != null
? (centerControls.getPaddingLeft() + centerControls.getPaddingRight())
: 0);
int defaultModeMinimumWidth =
Math.max(
centerControlWidth,
getWidthWithMargins(timeView) + getWidthWithMargins(overflowShowButton));
int defaultModeMinimumHeight =
getHeightWithMargins(centerControls) + 2 * getHeightWithMargins(bottomBar);
return width <= defaultModeMinimumWidth || height <= defaultModeMinimumHeight;
}

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
  • ExoPlayer version number: 2.13.2
  • Android version: Android 10
  • Android device: OnePlus 7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions