diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 1249be7acba..dd26b721c67 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -31,6 +31,8 @@ ([#4348](https://github.com/google/ExoPlayer/issues/4348)). * Fix issue when switching track selection from an embedded track to a primary track in DASH ([#4477](https://github.com/google/ExoPlayer/issues/4477)). +* Add `PlayerView.isControllerVisible` + ([#4385](https://github.com/google/ExoPlayer/issues/4385)). ### 2.8.2 ### diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java index a7aa48c0dbc..a7688bc5406 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java @@ -696,6 +696,11 @@ public boolean dispatchMediaKeyEvent(KeyEvent event) { return useController && controller.dispatchMediaKeyEvent(event); } + /** Returns whether the controller is currently visible. */ + public boolean isControllerVisible() { + return controller != null && controller.isVisible(); + } + /** * Shows the playback controls. Does nothing if playback controls are disabled. *