Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide control buttons in ExoPlayer2

How to hide all controllers in ExoPlayer2 (start button, pause, and so on) that they did not exist, and the screen was always full.

I looked, there is simpleExoPlayerView.setUseController(true) method;

But it deactivate the player ...

public void setUseController (boolean useController) {     this.useController = useController; if (useController) {       controller.setPlayer(player);     } else {       controller.hide();       controller.setPlayer(null);     } } 

How to hide or delete these components?

like image 898
Nurlan Kanimetov Avatar asked Feb 16 '17 01:02

Nurlan Kanimetov


People also ask

How do I hide control keys?

The option on the far left will be used to activate the on-screen buttons, the option in the middle will disable the on-screen buttons and the option on the far right will hide the on-screen buttons and the notification bar.


2 Answers

ExoPlayer-r2.2.0 used

videoView.hideController(); videoView.setControllerVisibilityListener(new PlaybackControlView.VisibilityListener() {     @Override     public void onVisibilityChange(int visibility) {         if(visibility == View.VISIBLE) {             videoView.hideController();         }     } }); 

or

app:use_controller="false" in Layout

<...     xmlns:app="http://schemas.android.com/apk/res-auto"     ...>      <com.google.android.exoplayer2.ui.SimpleExoPlayerView         android:layout_width="match_parent"         android:layout_height="match_parent"         app:use_controller="false"/> 
like image 162
Junsu Lee Avatar answered Sep 19 '22 09:09

Junsu Lee


Simply use this

exoPlayerView.setUseController(false); 
like image 29
karthik kolanji Avatar answered Sep 19 '22 09:09

karthik kolanji