ExoPlayer开始播放几秒钟后,控件停止显示并出现黑色背景。如何确保控件始终可见?
将show_timeout
属性设置为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;
}