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.setUseCon
Solution 1:
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.SimpleExoPlayerViewandroid:layout_width="match_parent"android:layout_height="match_parent"app:use_controller="false"/>
Solution 2:
Simply use this
exoPlayerView.setUseController(false);
Solution 3:
Kotlin:
exoPlayerView.useController = false
Java:
exoPlayerView.setUseController(false);
XML:
app:use_controller="false"
Documentation: https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/ui/PlayerView.html#setUseController-boolean-
Solution 4:
exoPlayerView.setUseController(false);
Solution 5:
PlayerView has a hideController method. you can call it like this:
mPlayerView.hideController();
Post a Comment for "How To Hide Control Buttons In Exoplayer2"