Skip to content

Commit

Permalink
Add convenience Player.isCurrentWindowLive method.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 272005632
  • Loading branch information
tonihei authored and ojw28 committed Oct 2, 2019
1 parent dd4f9bc commit 7d8bee7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ public final boolean isCurrentWindowDynamic() {
return !timeline.isEmpty() && timeline.getWindow(getCurrentWindowIndex(), window).isDynamic;
}

@Override
public final boolean isCurrentWindowLive() {
Timeline timeline = getCurrentTimeline();
return !timeline.isEmpty() && timeline.getWindow(getCurrentWindowIndex(), window).isLive;
}

@Override
public final boolean isCurrentWindowSeekable() {
Timeline timeline = getCurrentTimeline();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,13 @@ public void onTimelineChanged(Timeline timeline, @Nullable Object manifest) {
*/
boolean isCurrentWindowDynamic();

/**
* Returns whether the current window is live, or {@code false} if the {@link Timeline} is empty.
*
* @see Timeline.Window#isLive
*/
boolean isCurrentWindowLive();

/**
* Returns whether the current window is seekable, or {@code false} if the {@link Timeline} is
* empty.
Expand Down

0 comments on commit 7d8bee7

Please sign in to comment.