From 56899cb0e550af1d78a95d8d8fc184496d5a0260 Mon Sep 17 00:00:00 2001 From: jaewan Date: Thu, 15 Apr 2021 07:24:37 +0100 Subject: [PATCH] Tweak discontinuity reason definitions for remote players Discontinuity reasons may not be precisely obtained for remote player. 'Remote Player' means that playback is owned by another app or device and the same playback can be controller by other clients simultaneously. The MediaController is an example. If the remote playback doesn't provide discontinuity reason, then player cannot differentiate between automatic playback transition and seekTo() from another client. This CL tweaks the discontinuity reason definitions, so reasons can be obtained without remote playback's support. This doesn't effect the local Players, such as SimpleExoPlayer. PiperOrigin-RevId: 368579577 --- .../main/java/com/google/android/exoplayer2/Player.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/library/common/src/main/java/com/google/android/exoplayer2/Player.java b/library/common/src/main/java/com/google/android/exoplayer2/Player.java index 5ced18a108..9a721a9545 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/Player.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/Player.java @@ -946,14 +946,15 @@ public interface Player { }) @interface DiscontinuityReason {} /** - * Automatic playback transition from one period in the timeline to the next. The period index may - * be the same as it was before the discontinuity in case the current period is repeated. + * Automatic playback transition from one period in the timeline to the next without explicit + * interaction by this player. The period index may be the same as it was before the discontinuity + * in case the current period is repeated. * *

This reason also indicates an automatic transition from the content period to an inserted ad * period or vice versa. */ int DISCONTINUITY_REASON_AUTO_TRANSITION = 0; - /** Seek within the current period or to another period. */ + /** Seek within the current period or to another period by this player. */ int DISCONTINUITY_REASON_SEEK = 1; /** * Seek adjustment due to being unable to seek to the requested position or because the seek was @@ -964,7 +965,7 @@ public interface Player { int DISCONTINUITY_REASON_SKIP = 3; /** Discontinuity caused by the removal of the current period from the {@link Timeline}. */ int DISCONTINUITY_REASON_REMOVE = 4; - /** Discontinuity introduced internally by the source. */ + /** Discontinuity introduced internally (e.g. by the source). */ int DISCONTINUITY_REASON_INTERNAL = 5; /**