Add convenience getPlayer methods to UI components

Issue: #1895

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135211179
This commit is contained in:
olly 2016-10-05 02:40:52 -07:00 committed by Oliver Woodman
parent 85d749d2d5
commit 7c3fe15426
2 changed files with 14 additions and 0 deletions

View file

@ -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.
*

View file

@ -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