TareK Khoury
TareK Khoury

Reputation: 13021

ExoPlayer auto show/hide custom player controls

Is there an option when using a custom PlaybackControlView to auto show the controls like it works when using the default ones?

On my SimpleExoPlayerView I am setting:

playerView.player = player
playerView.useController = false

On my PlaybackControlView I am setting:

playerControls.player = player
playerControls.showTimeoutMs = 5000
playerControls.show()

The behavior I am getting now is when playing the video i see the controls for 5 seconds and then they disappear. Touching the player view does nothing.

Do I need to implement the show/hide behavior? Or is there a way to set it to work like it is on the default implementation?

Note: using ExoPlayer 2.6.0

Upvotes: 1

Views: 4589

Answers (1)

gkdavid
gkdavid

Reputation: 91

good question.

The reason your controls are disappearing is because you have set playerControls.showTimeoutMs to 5000. 5000 milliseconds = 5 seconds, after which they are disappearing.

Setting playerControls.showTimeoutMs to 0 will prevent the controls from disappearing automatically.

Hope this helps!

Upvotes: 5

Related Questions