Commit 7d8bee79 by tonihei Committed by Oliver Woodman

Add convenience Player.isCurrentWindowLive method.

PiperOrigin-RevId: 272005632
parent dd4f9bca
......@@ -128,6 +128,12 @@ public abstract class BasePlayer implements Player {
}
@Override
public final boolean isCurrentWindowLive() {
Timeline timeline = getCurrentTimeline();
return !timeline.isEmpty() && timeline.getWindow(getCurrentWindowIndex(), window).isLive;
}
@Override
public final boolean isCurrentWindowSeekable() {
Timeline timeline = getCurrentTimeline();
return !timeline.isEmpty() && timeline.getWindow(getCurrentWindowIndex(), window).isSeekable;
......
......@@ -962,6 +962,13 @@ public interface Player {
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.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment