如何使Exoplayer控件始终可见?

问题描述 投票:5回答:2

ExoPlayer开始播放几秒钟后,控件停止显示并出现黑色背景。如何确保控件始终可见?

android exoplayer
2个回答
6
投票

show_timeout属性设置为0


0
投票

如果在SimpleExoPlayerView类中看到以下方法,则需要提供负值以使控件始终可见。

/**
* Sets the playback controls timeout. The playback controls are automatically hidden after this
* duration of time has elapsed without user input and with playback 
  or buffering in progress.
* @param controllerShowTimeoutMs The timeout in milliseconds. A non-
  positive value will cause the controller to remain visible indefinitely.
*/
public void setControllerShowTimeoutMs(int controllerShowTimeoutMs) {
       Assertions.checkState(controller != null);
       this.controllerShowTimeoutMs = controllerShowTimeoutMs;
}
© www.soinside.com 2019 - 2024. All rights reserved.