diff --git a/README.md b/README.md index c67fb09d73..aff473c488 100644 --- a/README.md +++ b/README.md @@ -71,12 +71,12 @@ individually. In addition to library modules, ExoPlayer has multiple extension modules that depend on external libraries to provide additional functionality. Some extensions are available from JCenter, whereas others must be built manaully. -Browse the [extensions directory] and their individual READMEs for details. +Browse the [extensions directory][] and their individual READMEs for details. More information on the library and extension modules that are available from JCenter can be found on [Bintray][]. -[extensions directory][]: https://github.com/google/ExoPlayer/tree/release-v2/extensions/ +[extensions directory]: https://github.com/google/ExoPlayer/tree/release-v2/extensions/ [Bintray]: https://bintray.com/google/exoplayer ### Locally ### diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java index b096b5ae12..915a083657 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java @@ -211,12 +211,18 @@ public interface ExoPlayer extends Player { /** * Prepares the player to play the provided {@link MediaSource}. Equivalent to * {@code prepare(mediaSource, true, true)}. + *

+ * Note: {@link MediaSource} instances are not designed to be re-used. If you want to prepare a + * player more than once with the same piece of media, use a new instance each time. */ void prepare(MediaSource mediaSource); /** * Prepares the player to play the provided {@link MediaSource}, optionally resetting the playback * position the default position in the first {@link Timeline.Window}. + *

+ * Note: {@link MediaSource} instances are not designed to be re-used. If you want to prepare a + * player more than once with the same piece of media, use a new instance each time. * * @param mediaSource The {@link MediaSource} to play. * @param resetPosition Whether the playback position should be reset to the default position in diff --git a/library/core/src/main/java/com/google/android/exoplayer2/source/DynamicConcatenatingMediaSource.java b/library/core/src/main/java/com/google/android/exoplayer2/source/DynamicConcatenatingMediaSource.java index 3d0df7dcb3..9c1e7ec1ba 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/source/DynamicConcatenatingMediaSource.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/source/DynamicConcatenatingMediaSource.java @@ -87,6 +87,9 @@ public final class DynamicConcatenatingMediaSource implements MediaSource, ExoPl /** * Appends a {@link MediaSource} to the playlist. + *

+ * Note: {@link MediaSource} instances are not designed to be re-used. If you want to add the same + * piece of media multiple times, use a new instance each time. * * @param mediaSource The {@link MediaSource} to be added to the list. */ @@ -96,6 +99,9 @@ public final class DynamicConcatenatingMediaSource implements MediaSource, ExoPl /** * Adds a {@link MediaSource} to the playlist. + *

+ * Note: {@link MediaSource} instances are not designed to be re-used. If you want to add the same + * piece of media multiple times, use a new instance each time. * * @param index The index at which the new {@link MediaSource} will be inserted. This index must * be in the range of 0 <= index <= {@link #getSize()}. @@ -112,6 +118,9 @@ public final class DynamicConcatenatingMediaSource implements MediaSource, ExoPl /** * Appends multiple {@link MediaSource}s to the playlist. + *

+ * Note: {@link MediaSource} instances are not designed to be re-used. If you want to add the same + * piece of media multiple times, use a new instance each time. * * @param mediaSources A collection of {@link MediaSource}s to be added to the list. The media * sources are added in the order in which they appear in this collection. @@ -122,6 +131,9 @@ public final class DynamicConcatenatingMediaSource implements MediaSource, ExoPl /** * Adds multiple {@link MediaSource}s to the playlist. + *

+ * Note: {@link MediaSource} instances are not designed to be re-used. If you want to add the same + * piece of media multiple times, use a new instance each time. * * @param index The index at which the new {@link MediaSource}s will be inserted. This index must * be in the range of 0 <= index <= {@link #getSize()}. @@ -142,6 +154,10 @@ public final class DynamicConcatenatingMediaSource implements MediaSource, ExoPl /** * Removes a {@link MediaSource} from the playlist. + *

+ * Note: {@link MediaSource} instances are not designed to be re-used, and so the instance being + * removed should not be re-added. If you want to move the instance use + * {@link #moveMediaSource(int, int)} instead. * * @param index The index at which the media source will be removed. This index must be in the * range of 0 <= index < {@link #getSize()}.