diff --git a/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java b/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java index 3d99890b6b..5acb3bfb45 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java +++ b/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java @@ -141,6 +141,12 @@ import java.util.List; *
* All child views are optional and so can be omitted if not required, however where defined they
@@ -167,6 +173,7 @@ public final class SimpleExoPlayerView extends FrameLayout {
private final SubtitleView subtitleView;
private final PlaybackControlView controller;
private final ComponentListener componentListener;
+ private final FrameLayout overlayFrameLayout;
private SimpleExoPlayer player;
private boolean useController;
@@ -231,6 +238,9 @@ public final class SimpleExoPlayerView extends FrameLayout {
surfaceView = null;
}
+ // Overlay frame layout.
+ overlayFrameLayout = (FrameLayout) findViewById(R.id.exo_overlay);
+
// Artwork view.
artworkView = (ImageView) findViewById(R.id.exo_artwork);
this.useArtwork = useArtwork && artworkView != null;
@@ -421,15 +431,26 @@ public final class SimpleExoPlayerView extends FrameLayout {
}
/**
- * Get the view onto which video is rendered. This is either a {@link SurfaceView} (default)
+ * Gets the view onto which video is rendered. This is either a {@link SurfaceView} (default)
* or a {@link TextureView} if the {@code use_texture_view} view attribute has been set to true.
*
- * @return either a {@link SurfaceView} or a {@link TextureView}.
+ * @return Either a {@link SurfaceView} or a {@link TextureView}.
*/
public View getVideoSurfaceView() {
return surfaceView;
}
+ /**
+ * Gets the overlay {@link FrameLayout}, which can be populated with UI elements to show on top of
+ * the player.
+ *
+ * @return The overlay {@link FrameLayout}, or {@code null} if the layout has been customized and
+ * the overlay is not present.
+ */
+ public FrameLayout getOverlayFrameLayout() {
+ return overlayFrameLayout;
+ }
+
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (!useController || player == null || ev.getActionMasked() != MotionEvent.ACTION_DOWN) {
diff --git a/library/src/main/res/layout/exo_simple_player_view.xml b/library/src/main/res/layout/exo_simple_player_view.xml
index c4f34ef285..b21b0d2bd6 100644
--- a/library/src/main/res/layout/exo_simple_player_view.xml
+++ b/library/src/main/res/layout/exo_simple_player_view.xml
@@ -44,4 +44,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
+