diff --git a/library/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java b/library/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java index 7f351afe8b..f6d8742fa5 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java +++ b/library/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java @@ -127,6 +127,13 @@ public class PlaybackControlView extends FrameLayout { updateAll(); } + /** + * Returns the player currently being controlled by this view, or null if no player is set. + */ + public ExoPlayer getPlayer() { + return player; + } + /** * Sets the {@link ExoPlayer} to control. * 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 9263918958..1aeed503ac 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 @@ -93,6 +93,13 @@ public final class SimpleExoPlayerView extends FrameLayout { layout.addView(surfaceView, 0); } + /** + * Returns the player currently set on this view, or null if no player is set. + */ + public SimpleExoPlayer getPlayer() { + return player; + } + /** * Set the {@link SimpleExoPlayer} to use. The {@link SimpleExoPlayer#setTextOutput} and * {@link SimpleExoPlayer#setVideoListener} method of the player will be called and previous