diff --git a/extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java b/extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java index afe0312c28..252ab7251d 100644 --- a/extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java +++ b/extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java @@ -111,8 +111,6 @@ public final class CastPlayer extends BasePlayer { private static final long PROGRESS_REPORT_PERIOD_MS = 1000; private static final long[] EMPTY_TRACK_ID_ARRAY = new long[0]; - private static final CueGroup EMPTY_CUE_GROUP = - new CueGroup(ImmutableList.of(), /* presentationTimeUs= */ 0); private final CastContext castContext; private final MediaItemConverter mediaItemConverter; @@ -726,7 +724,7 @@ public final class CastPlayer extends BasePlayer { /** This method is not supported and returns an empty {@link CueGroup}. */ @Override public CueGroup getCurrentCues() { - return EMPTY_CUE_GROUP; + return CueGroup.EMPTY_TIME_ZERO; } /** This method is not supported and always returns {@link DeviceInfo#UNKNOWN}. */ diff --git a/library/common/src/main/java/com/google/android/exoplayer2/text/CueGroup.java b/library/common/src/main/java/com/google/android/exoplayer2/text/CueGroup.java index 93d260e673..a45d55aff3 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/text/CueGroup.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/text/CueGroup.java @@ -34,6 +34,11 @@ import java.util.List; /** Class to represent the state of active {@link Cue Cues} at a particular time. */ public final class CueGroup implements Bundleable { + + /** An empty group with no {@link Cue Cues} and presentation time of zero. */ + public static final CueGroup EMPTY_TIME_ZERO = + new CueGroup(ImmutableList.of(), /* presentationTimeUs= */ 0); + /** * The cues in this group. * diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index bfda921a0b..8709003c01 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -345,7 +345,7 @@ import java.util.concurrent.TimeoutException; } else { audioSessionId = Util.generateAudioSessionIdV21(applicationContext); } - currentCueGroup = new CueGroup(ImmutableList.of(), /* presentationTimeUs= */ 0); + currentCueGroup = CueGroup.EMPTY_TIME_ZERO; throwsWhenUsingWrongThread = true; addListener(analyticsCollector); @@ -990,7 +990,7 @@ import java.util.concurrent.TimeoutException; checkNotNull(priorityTaskManager).remove(C.PRIORITY_PLAYBACK); isPriorityTaskManagerRegistered = false; } - currentCueGroup = new CueGroup(ImmutableList.of(), /* presentationTimeUs= */ 0); + currentCueGroup = CueGroup.EMPTY_TIME_ZERO; playerReleased = true; }