From f6be4bc5263672216a52404b2fad8448b8c8f804 Mon Sep 17 00:00:00 2001 From: tonihei Date: Fri, 1 Sep 2023 03:42:13 -0700 Subject: [PATCH] Document C.TIME_UNSET on Player.setMediaItem(.., startPositonMs) This wasn't properly documented yet (unlike the longer setMediaItems method that already includes this documentation). Issue: androidx/media#607 PiperOrigin-RevId: 561910073 --- .../src/main/java/androidx/media3/common/Player.java | 3 ++- .../main/java/androidx/media3/exoplayer/ExoPlayer.java | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libraries/common/src/main/java/androidx/media3/common/Player.java b/libraries/common/src/main/java/androidx/media3/common/Player.java index d2da7763f6..c5dc72fff3 100644 --- a/libraries/common/src/main/java/androidx/media3/common/Player.java +++ b/libraries/common/src/main/java/androidx/media3/common/Player.java @@ -2146,7 +2146,8 @@ public interface Player { * #getAvailableCommands() available}. * * @param mediaItem The new {@link MediaItem}. - * @param startPositionMs The position in milliseconds to start playback from. + * @param startPositionMs The position in milliseconds to start playback from. If {@link + * C#TIME_UNSET} is passed, the default position of the given {@link MediaItem} is used. */ void setMediaItem(MediaItem mediaItem, long startPositionMs); diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayer.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayer.java index e109982ec2..7449444118 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayer.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayer.java @@ -1423,9 +1423,9 @@ public interface ExoPlayer extends Player { * @param startMediaItemIndex The media item index to start playback from. If {@link * C#INDEX_UNSET} is passed, the current position is not reset. * @param startPositionMs The position in milliseconds to start playback from. If {@link - * C#TIME_UNSET} is passed, the default position of the given media item is used. In any case, - * if {@code startMediaItemIndex} is set to {@link C#INDEX_UNSET}, this parameter is ignored - * and the position is not reset at all. + * C#TIME_UNSET} is passed, the default position of the given media source is used. In any + * case, if {@code startMediaItemIndex} is set to {@link C#INDEX_UNSET}, this parameter is + * ignored and the position is not reset at all. */ @UnstableApi void setMediaSources( @@ -1444,7 +1444,8 @@ public interface ExoPlayer extends Player { * Clears the playlist and adds the specified {@link MediaSource}. * * @param mediaSource The new {@link MediaSource}. - * @param startPositionMs The position in milliseconds to start playback from. + * @param startPositionMs The position in milliseconds to start playback from. If {@link + * C#TIME_UNSET} is passed, the default position of the given media source is used. */ @UnstableApi void setMediaSource(MediaSource mediaSource, long startPositionMs);