Skip to content

Commit

Permalink
Add convenience getPlayer methods to UI components
Browse files Browse the repository at this point in the history
Issue: #1895

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135211179
  • Loading branch information
ojw28 committed Oct 5, 2016
1 parent 85d749d commit 7c3fe15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ public PlaybackControlView(Context context, AttributeSet attrs, int defStyleAttr
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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ public SimpleExoPlayerView(Context context, AttributeSet attrs, int defStyleAttr
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
Expand Down

0 comments on commit 7c3fe15

Please sign in to comment.