# ConcatenatingMediaSource

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/source/ConcatenatingMediaSource.java+class:androidx.media3.exoplayer.source.ConcatenatingMediaSource)

*** ** * ** ***


```
@UnstableApi
public final class ConcatenatingMediaSource extends CompositeMediaSource<ConcatenatingMediaSource.MediaSourceHolder>
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.media3.exoplayer.source.BaseMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource) |||
|   | ↳ | [androidx.media3.exoplayer.source.CompositeMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeMediaSource)\<[ConcatenatingMediaSource.MediaSourceHolder](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource.MediaSourceHolder)\> ||
|   |   | ↳ | [androidx.media3.exoplayer.source.ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource) |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use playlist modification methods like `https://developer.android.com/reference/androidx/media3/common/Player#addMediaItem(androidx.media3.common.MediaItem)` instead. To combine multiple sources together as one item or for further wrapping in other `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` instances, use `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource2` instead.

Concatenates multiple `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` instances. The list of `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` instances can be modified during playback. It is valid for the same `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` instance to be present more than once in the concatenation. Access to this class is thread-safe.

## Summary

| ### Nested types |
|---|
| `protected final class https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource.MediaSourceHolder` **This class is deprecated.** Deprecated in Java |

| ### Public constructors |
|---|
| `[ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#ConcatenatingMediaSource(androidx.media3.exoplayer.source.MediaSource...))(MediaSource[] mediaSources)` **This method is deprecated.** Deprecated in Java |
| `[ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#ConcatenatingMediaSource(boolean,androidx.media3.exoplayer.source.MediaSource...))(boolean isAtomic, MediaSource[] mediaSources)` **This method is deprecated.** Deprecated in Java |
| `[ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#ConcatenatingMediaSource(boolean,androidx.media3.exoplayer.source.ShuffleOrder,androidx.media3.exoplayer.source.MediaSource...))( boolean isAtomic, https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder, MediaSource[] mediaSources )` **This method is deprecated.** Deprecated in Java |
| `[ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#ConcatenatingMediaSource(boolean,boolean,androidx.media3.exoplayer.source.ShuffleOrder,androidx.media3.exoplayer.source.MediaSource...))( boolean isAtomic, boolean useLazyPreparation, https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder, MediaSource[] mediaSources )` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `synchronized void` | `[addMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSource(androidx.media3.exoplayer.source.MediaSource))(https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource)` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[addMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSource(int,androidx.media3.exoplayer.source.MediaSource))(int index, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource)` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[addMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSource(androidx.media3.exoplayer.source.MediaSource,android.os.Handler,java.lang.Runnable))( https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource, https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction )` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[addMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSource(int,androidx.media3.exoplayer.source.MediaSource,android.os.Handler,java.lang.Runnable))( int index, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource, https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction )` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[addMediaSources](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSources(java.util.Collection<androidx.media3.exoplayer.source.MediaSource>))(https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource> mediaSources)` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[addMediaSources](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSources(int,java.util.Collection<androidx.media3.exoplayer.source.MediaSource>))(int index, https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource> mediaSources)` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[addMediaSources](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSources(java.util.Collection<androidx.media3.exoplayer.source.MediaSource>,android.os.Handler,java.lang.Runnable))( https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource> mediaSources, https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction )` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[addMediaSources](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSources(int,java.util.Collection<androidx.media3.exoplayer.source.MediaSource>,android.os.Handler,java.lang.Runnable))( int index, https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource> mediaSources, https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction )` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[clear](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#clear())()` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[clear](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#clear(android.os.Handler,java.lang.Runnable))(https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction)` **This method is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` | `[createPeriod](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#createPeriod(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.upstream.Allocator,long))( https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId id, https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocator allocator, long startPositionUs )` **This method is deprecated.** Deprecated in Java |
| `synchronized https://developer.android.com/reference/androidx/media3/common/Timeline` | `[getInitialTimeline](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getInitialTimeline())()` **This method is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/androidx/media3/common/MediaItem` | `[getMediaItem](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getMediaItem())()` **This method is deprecated.** Deprecated in Java |
| `synchronized https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` | `[getMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getMediaSource(int))(int index)` **This method is deprecated.** Deprecated in Java |
| `synchronized int` | `[getSize](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize())()` **This method is deprecated.** Deprecated in Java |
| `boolean` | `[isSingleWindow](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#isSingleWindow())()` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[moveMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#moveMediaSource(int,int))(int currentIndex, int newIndex)` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[moveMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#moveMediaSource(int,int,android.os.Handler,java.lang.Runnable))( int currentIndex, int newIndex, https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction )` **This method is deprecated.** Deprecated in Java |
| `void` | `[releasePeriod](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#releasePeriod(androidx.media3.exoplayer.source.MediaPeriod))(https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod mediaPeriod)` **This method is deprecated.** Deprecated in Java |
| `synchronized https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` | `[removeMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSource(int))(int index)` **This method is deprecated.** Deprecated in Java |
| `synchronized https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` | `[removeMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSource(int,android.os.Handler,java.lang.Runnable))( int index, https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction )` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[removeMediaSourceRange](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSourceRange(int,int))(int fromIndex, int toIndex)` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[removeMediaSourceRange](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSourceRange(int,int,android.os.Handler,java.lang.Runnable))( int fromIndex, int toIndex, https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction )` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[setShuffleOrder](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#setShuffleOrder(androidx.media3.exoplayer.source.ShuffleOrder))(https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder)` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[setShuffleOrder](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#setShuffleOrder(androidx.media3.exoplayer.source.ShuffleOrder,android.os.Handler,java.lang.Runnable))( https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder, https://developer.android.com/reference/android/os/Handler.html handler, https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction )` **This method is deprecated.** Deprecated in Java |

| ### Protected methods |
|---|---|
| `void` | `[disableInternal](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#disableInternal())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[enableInternal](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#enableInternal())()` **This method is deprecated.** Deprecated in Java |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` | `[getMediaPeriodIdForChildMediaPeriodId](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getMediaPeriodIdForChildMediaPeriodId(androidx.media3.exoplayer.source.ConcatenatingMediaSource.MediaSourceHolder,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))( https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource.MediaSourceHolder childSourceId, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId )` **This method is deprecated.** Deprecated in Java |
| `int` | `[getWindowIndexForChildWindowIndex](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getWindowIndexForChildWindowIndex(androidx.media3.exoplayer.source.ConcatenatingMediaSource.MediaSourceHolder,int))( https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource.MediaSourceHolder childSourceId, int windowIndex )` **This method is deprecated.** Deprecated in Java |
| `void` | `[onChildSourceInfoRefreshed](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#onChildSourceInfoRefreshed(androidx.media3.exoplayer.source.ConcatenatingMediaSource.MediaSourceHolder,androidx.media3.exoplayer.source.MediaSource,androidx.media3.common.Timeline))( https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource.MediaSourceHolder childSourceId, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource, https://developer.android.com/reference/androidx/media3/common/Timeline newTimeline )` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[prepareSourceInternal](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#prepareSourceInternal(androidx.media3.datasource.TransferListener))(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/TransferListener mediaTransferListener)` **This method is deprecated.** Deprecated in Java |
| `synchronized void` | `[releaseSourceInternal](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#releaseSourceInternal())()` **This method is deprecated.** Deprecated in Java |

### Inherited fields

From [androidx.media3.exoplayer.source.BaseMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource) `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/upstream/BandwidthMeter` `https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#bandwidthMeter()`

**This field is deprecated.** Deprecated in Java
`@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId` `https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#playerId()`

**This field is deprecated.** Deprecated in Java

### Inherited methods

From [androidx.media3.exoplayer.source.BaseMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource) `final void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[addDrmEventListener](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#addDrmEventListener(android.os.Handler,androidx.media3.exoplayer.drm.DrmSessionEventListener))(
https://developer.android.com/reference/android/os/Handler.html handler,
https://developer.android.com/reference/androidx/media3/exoplayer/drm/DrmSessionEventListener eventListener
)`

**This method is deprecated.** Deprecated in Java
`final void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[addEventListener](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#addEventListener(android.os.Handler,androidx.media3.exoplayer.source.MediaSourceEventListener))(
https://developer.android.com/reference/android/os/Handler.html handler,
https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSourceEventListener eventListener
)`

**This method is deprecated.** Deprecated in Java
`final https://developer.android.com/reference/androidx/media3/exoplayer/drm/DrmSessionEventListener.EventDispatcher` `[createDrmEventDispatcher](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#createDrmEventDispatcher(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(
@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId
)`

**This method is deprecated.** Deprecated in Java
`final https://developer.android.com/reference/androidx/media3/exoplayer/drm/DrmSessionEventListener.EventDispatcher` `[createDrmEventDispatcher](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#createDrmEventDispatcher(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(
int windowIndex,
@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId
)`

**This method is deprecated.** Deprecated in Java
`final https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher` `[createEventDispatcher](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId)`

**This method is deprecated.** Deprecated in Java
`final https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher` `[createEventDispatcher](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long))(
https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId,
long mediaTimeOffsetMs
)`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)` instead.

<br />

`final https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher` `[createEventDispatcher](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(
int windowIndex,
@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId
)`

**This method is deprecated.** Deprecated in Java
`final https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher` `[createEventDispatcher](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long))(
int windowIndex,
@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId,
long mediaTimeOffsetMs
)`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)` instead.

<br />

`final void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[disable](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#disable(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller))(https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller caller)`

**This method is deprecated.** Deprecated in Java
`final void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[enable](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#enable(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller))(https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller caller)`

**This method is deprecated.** Deprecated in Java
`final https://developer.android.com/reference/androidx/media3/exoplayer/upstream/BandwidthMeter` `[getBandwidthMeter](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#getBandwidthMeter())()`

**This method is deprecated.** Deprecated in Java
`final https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId` `[getPlayerId](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#getPlayerId())()`

**This method is deprecated.** Deprecated in Java
`final boolean` `[isEnabled](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#isEnabled())()`

**This method is deprecated.** Deprecated in Java
`final void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[prepareSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.BandwidthMeter))(
https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller caller,
https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId,
https://developer.android.com/reference/androidx/media3/exoplayer/upstream/BandwidthMeter bandwidthMeter
)`

**This method is deprecated.** Deprecated in Java
`final boolean` `[prepareSourceCalled](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#prepareSourceCalled())()`

**This method is deprecated.** Deprecated in Java
`final void` `[refreshSourceInfo](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#refreshSourceInfo(androidx.media3.common.Timeline))(https://developer.android.com/reference/androidx/media3/common/Timeline timeline)`

**This method is deprecated.** Deprecated in Java
`final void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[releaseSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#releaseSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller))(https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller caller)`

**This method is deprecated.** Deprecated in Java
`final void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[removeDrmEventListener](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#removeDrmEventListener(androidx.media3.exoplayer.drm.DrmSessionEventListener))(https://developer.android.com/reference/androidx/media3/exoplayer/drm/DrmSessionEventListener eventListener)`

**This method is deprecated.** Deprecated in Java
`final void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[removeEventListener](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#removeEventListener(androidx.media3.exoplayer.source.MediaSourceEventListener))(https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSourceEventListener eventListener)`

**This method is deprecated.** Deprecated in Java
`final void` `[setBandwidthMeter](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#setBandwidthMeter(androidx.media3.exoplayer.upstream.BandwidthMeter))(https://developer.android.com/reference/androidx/media3/exoplayer/upstream/BandwidthMeter bandwidthMeter)`

**This method is deprecated.** Deprecated in Java
`final void` `[setPlayerId](https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#setPlayerId(androidx.media3.exoplayer.analytics.PlayerId))(https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId)`

**This method is deprecated.** Deprecated in Java
From [androidx.media3.exoplayer.source.CompositeMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeMediaSource) `final void` `[disableChildSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeMediaSource#disableChildSource(T))(@https://developer.android.com/reference/androidx/media3/common/util/UnknownNull T id)`

**This method is deprecated.** Deprecated in Java
`final void` `[enableChildSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeMediaSource#enableChildSource(T))(@https://developer.android.com/reference/androidx/media3/common/util/UnknownNull T id)`

**This method is deprecated.** Deprecated in Java
`long` `[getMediaTimeForChildMediaTime](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeMediaSource#getMediaTimeForChildMediaTime(T,long,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(
@https://developer.android.com/reference/androidx/media3/common/util/UnknownNull T childSourceId,
long mediaTimeMs,
@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId
)`

**This method is deprecated.** Deprecated in Java
`void` `@https://developer.android.com/reference/androidx/annotation/CallSuper
[maybeThrowSourceInfoRefreshError](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeMediaSource#maybeThrowSourceInfoRefreshError())()`

**This method is deprecated.** Deprecated in Java
`final void` `[prepareChildSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeMediaSource#prepareChildSource(T,androidx.media3.exoplayer.source.MediaSource))(@https://developer.android.com/reference/androidx/media3/common/util/UnknownNull T id, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource)`

**This method is deprecated.** Deprecated in Java
`final void` `[releaseChildSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/CompositeMediaSource#releaseChildSource(T))(@https://developer.android.com/reference/androidx/media3/common/util/UnknownNull T id)`

**This method is deprecated.** Deprecated in Java
From [androidx.media3.exoplayer.source.MediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource) `boolean` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[canUpdateMediaItem](https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#canUpdateMediaItem(androidx.media3.common.MediaItem))(https://developer.android.com/reference/androidx/media3/common/MediaItem mediaItem)`

**This method is deprecated.** Deprecated in Java
`void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[prepareSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.datasource.TransferListener,androidx.media3.exoplayer.analytics.PlayerId))(
https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller caller,
@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/TransferListener mediaTransferListener,
https://developer.android.com/reference/androidx/media3/exoplayer/analytics/PlayerId playerId
)`

**This method is deprecated.**

Use `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.BandwidthMeter)` instead.

<br />

`void` `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi
[updateMediaItem](https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#updateMediaItem(androidx.media3.common.MediaItem))(https://developer.android.com/reference/androidx/media3/common/MediaItem mediaItem)`

**This method is deprecated.** Deprecated in Java

## Public constructors

### ConcatenatingMediaSource

```
public [ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#ConcatenatingMediaSource(androidx.media3.exoplayer.source.MediaSource...))(MediaSource[] mediaSources)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

| Parameters |
|---|---|
| `MediaSource[] mediaSources` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to concatenate. It is valid for the same `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` instance to be present more than once in the array. |

### ConcatenatingMediaSource

```
public [ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#ConcatenatingMediaSource(boolean,androidx.media3.exoplayer.source.MediaSource...))(boolean isAtomic, MediaSource[] mediaSources)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

| Parameters |
|---|---|
| `boolean isAtomic` | Whether the concatenating media source will be treated as atomic, i.e., treated as a single item for repeating and shuffling. |
| `MediaSource[] mediaSources` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to concatenate. It is valid for the same `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` instance to be present more than once in the array. |

### ConcatenatingMediaSource

```
public [ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#ConcatenatingMediaSource(boolean,androidx.media3.exoplayer.source.ShuffleOrder,androidx.media3.exoplayer.source.MediaSource...))(
    boolean isAtomic,
    ShuffleOrder shuffleOrder,
    MediaSource[] mediaSources
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

| Parameters |
|---|---|
| `boolean isAtomic` | Whether the concatenating media source will be treated as atomic, i.e., treated as a single item for repeating and shuffling. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder` to use when shuffling the child media sources. |
| `MediaSource[] mediaSources` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to concatenate. It is valid for the same `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` instance to be present more than once in the array. |

### ConcatenatingMediaSource

```
public [ConcatenatingMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#ConcatenatingMediaSource(boolean,boolean,androidx.media3.exoplayer.source.ShuffleOrder,androidx.media3.exoplayer.source.MediaSource...))(
    boolean isAtomic,
    boolean useLazyPreparation,
    ShuffleOrder shuffleOrder,
    MediaSource[] mediaSources
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

| Parameters |
|---|---|
| `boolean isAtomic` | Whether the concatenating media source will be treated as atomic, i.e., treated as a single item for repeating and shuffling. |
| `boolean useLazyPreparation` | Whether playlist items are prepared lazily. If false, all manifest loads and other initial preparation steps happen immediately. If true, these initial preparations are triggered only when the player starts buffering the media. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder` to use when shuffling the child media sources. |
| `MediaSource[] mediaSources` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to concatenate. It is valid for the same `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` instance to be present more than once in the array. |

## Public methods

### addMediaSource

```
synchronized public void [addMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSource(androidx.media3.exoplayer.source.MediaSource))(MediaSource mediaSource)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Appends a `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` to the playlist.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` to be added to the list. |

### addMediaSource

```
synchronized public void [addMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSource(int,androidx.media3.exoplayer.source.MediaSource))(int index, MediaSource mediaSource)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Adds a `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` to the playlist.

| Parameters |
|---|---|
| `int index` | The index at which the new `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` will be inserted. This index must be in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` to be added to the list. |

### addMediaSource

```
synchronized public void [addMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSource(androidx.media3.exoplayer.source.MediaSource,android.os.Handler,java.lang.Runnable))(
    MediaSource mediaSource,
    Handler handler,
    Runnable onCompletionAction
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Appends a `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` to the playlist and executes a custom action on completion.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` to be added to the list. |
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the media source has been added to the playlist. |

### addMediaSource

```
synchronized public void [addMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSource(int,androidx.media3.exoplayer.source.MediaSource,android.os.Handler,java.lang.Runnable))(
    int index,
    MediaSource mediaSource,
    Handler handler,
    Runnable onCompletionAction
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Adds a `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` to the playlist and executes a custom action on completion.

| Parameters |
|---|---|
| `int index` | The index at which the new `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` will be inserted. This index must be in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` to be added to the list. |
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the media source has been added to the playlist. |

### addMediaSources

```
synchronized public void [addMediaSources](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSources(java.util.Collection<androidx.media3.exoplayer.source.MediaSource>))(Collection<MediaSource> mediaSources)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Appends multiple `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to the playlist.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource> mediaSources` | A collection of `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to be added to the list. The media sources are added in the order in which they appear in this collection. |

### addMediaSources

```
synchronized public void [addMediaSources](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSources(int,java.util.Collection<androidx.media3.exoplayer.source.MediaSource>))(int index, Collection<MediaSource> mediaSources)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Adds multiple `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to the playlist.

| Parameters |
|---|---|
| `int index` | The index at which the new `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s will be inserted. This index must be in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource> mediaSources` | A collection of `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to be added to the list. The media sources are added in the order in which they appear in this collection. |

### addMediaSources

```
synchronized public void [addMediaSources](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSources(java.util.Collection<androidx.media3.exoplayer.source.MediaSource>,android.os.Handler,java.lang.Runnable))(
    Collection<MediaSource> mediaSources,
    Handler handler,
    Runnable onCompletionAction
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Appends multiple `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to the playlist and executes a custom action on completion.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource> mediaSources` | A collection of `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to be added to the list. The media sources are added in the order in which they appear in this collection. |
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the media sources have been added to the playlist. |

### addMediaSources

```
synchronized public void [addMediaSources](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#addMediaSources(int,java.util.Collection<androidx.media3.exoplayer.source.MediaSource>,android.os.Handler,java.lang.Runnable))(
    int index,
    Collection<MediaSource> mediaSources,
    Handler handler,
    Runnable onCompletionAction
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Adds multiple `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to the playlist and executes a custom action on completion.

| Parameters |
|---|---|
| `int index` | The index at which the new `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s will be inserted. This index must be in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource> mediaSources` | A collection of `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to be added to the list. The media sources are added in the order in which they appear in this collection. |
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the media sources have been added to the playlist. |

### clear

```
synchronized public void [clear](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#clear())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Clears the playlist.

### clear

```
synchronized public void [clear](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#clear(android.os.Handler,java.lang.Runnable))(Handler handler, Runnable onCompletionAction)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Clears the playlist and executes a custom action on completion.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the playlist has been cleared. |

### createPeriod

```
public MediaPeriod [createPeriod](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#createPeriod(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.upstream.Allocator,long))(
    MediaSource.MediaPeriodId id,
    Allocator allocator,
    long startPositionUs
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns a new `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` identified by `periodId`.

Should not be called directly from application code.

This method must be called on the playback thread and only if the source is enabled.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId id` | The identifier of the period. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocator allocator` | An `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocator` from which to obtain media buffer allocations. |
| `long startPositionUs` | The expected start position, in microseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod` | A new `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod`. |

### getInitialTimeline

```
synchronized public Timeline [getInitialTimeline](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getInitialTimeline())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the initial placeholder timeline that is returned immediately when the real timeline is not yet known, or null to let the player create an initial timeline.

Should not be called directly from application code.

The initial timeline must use the same uids for windows and periods that the real timeline will use. It also must provide windows which are marked as dynamic to indicate that the window is expected to change when the real timeline arrives.

Any media source which has multiple windows should typically provide such an initial timeline to make sure the player reports the correct number of windows immediately.

This method must be called on the application thread.

### getMediaItem

```
public MediaItem [getMediaItem](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getMediaItem())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the `https://developer.android.com/reference/androidx/media3/common/MediaItem` whose media is provided by the source.

Should not be called directly from application code.

This method must be called on the application thread.

### getMediaSource

```
synchronized public MediaSource [getMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getMediaSource(int))(int index)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` at a specified index.

| Parameters |
|---|---|
| `int index` | An index in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` at this index. |

### getSize

```
synchronized public int [getSize](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the number of media sources in the playlist.

### isSingleWindow

```
public boolean [isSingleWindow](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#isSingleWindow())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns true if the media source is guaranteed to never have zero or more than one window.

Should not be called directly from application code.

The default implementation returns `true`.

This method must be called on the application thread.

| Returns |
|---|---|
| `boolean` | true if the source has exactly one window. |

### moveMediaSource

```
synchronized public void [moveMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#moveMediaSource(int,int))(int currentIndex, int newIndex)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Moves an existing `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` within the playlist.

| Parameters |
|---|---|
| `int currentIndex` | The current index of the media source in the playlist. This index must be in the range of 0 \<= index \<`https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `int newIndex` | The target index of the media source in the playlist. This index must be in the range of 0 \<= index \<`https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |

### moveMediaSource

```
synchronized public void [moveMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#moveMediaSource(int,int,android.os.Handler,java.lang.Runnable))(
    int currentIndex,
    int newIndex,
    Handler handler,
    Runnable onCompletionAction
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Moves an existing `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` within the playlist and executes a custom action on completion.

| Parameters |
|---|---|
| `int currentIndex` | The current index of the media source in the playlist. This index must be in the range of 0 \<= index \<`https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `int newIndex` | The target index of the media source in the playlist. This index must be in the range of 0 \<= index \<`https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the media source has been moved. |

### releasePeriod

```
public void [releasePeriod](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#releasePeriod(androidx.media3.exoplayer.source.MediaPeriod))(MediaPeriod mediaPeriod)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Releases the period.

Should not be called directly from application code.

This method must be called on the playback thread.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaPeriod mediaPeriod` | The period to release. |

### removeMediaSource

```
synchronized public MediaSource [removeMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSource(int))(int index)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Removes a `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` from the playlist.

Note: If you want to move the instance, it's preferable to use `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#moveMediaSource(int,int)` instead.

Note: If you want to remove a set of contiguous sources, it's preferable to use `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSourceRange(int,int)` instead.

| Parameters |
|---|---|
| `int index` | The index at which the media source will be removed. This index must be in the range of 0 \<= index \<`https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` | The removed `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`. |

### removeMediaSource

```
synchronized public MediaSource [removeMediaSource](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSource(int,android.os.Handler,java.lang.Runnable))(
    int index,
    Handler handler,
    Runnable onCompletionAction
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Removes a `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` from the playlist and executes a custom action on completion.

Note: If you want to move the instance, it's preferable to use `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#moveMediaSource(int,int,android.os.Handler,java.lang.Runnable)` instead.

Note: If you want to remove a set of contiguous sources, it's preferable to use `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSourceRange(int,int,android.os.Handler,java.lang.Runnable)` instead.

| Parameters |
|---|---|
| `int index` | The index at which the media source will be removed. This index must be in the range of 0 \<= index \<`https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the media source has been removed from the playlist. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource` | The removed `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`. |

### removeMediaSourceRange

```
synchronized public void [removeMediaSourceRange](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSourceRange(int,int))(int fromIndex, int toIndex)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Removes a range of `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s from the playlist, by specifying an initial index (included) and a final index (excluded).

Note: when specified range is empty, no actual media source is removed and no exception is thrown.

| Parameters |
|---|---|
| `int fromIndex` | The initial range index, pointing to the first media source that will be removed. This index must be in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `int toIndex` | The final range index, pointing to the first media source that will be left untouched. This index must be in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException.html` | When the range is malformed, i.e. `fromIndex`\<0, `toIndex`\>`https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`, `fromIndex`\>`toIndex` |

### removeMediaSourceRange

```
synchronized public void [removeMediaSourceRange](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#removeMediaSourceRange(int,int,android.os.Handler,java.lang.Runnable))(
    int fromIndex,
    int toIndex,
    Handler handler,
    Runnable onCompletionAction
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Removes a range of `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s from the playlist, by specifying an initial index (included) and a final index (excluded), and executes a custom action on completion.

Note: when specified range is empty, no actual media source is removed and no exception is thrown.

| Parameters |
|---|---|
| `int fromIndex` | The initial range index, pointing to the first media source that will be removed. This index must be in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `int toIndex` | The final range index, pointing to the first media source that will be left untouched. This index must be in the range of 0 \<= index \<= `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`. |
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the media source range has been removed from the playlist. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | When the range is malformed, i.e. `fromIndex`\<0, `toIndex`\>`https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getSize()`, `fromIndex`\>`toIndex` |

### setShuffleOrder

```
synchronized public void [setShuffleOrder](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#setShuffleOrder(androidx.media3.exoplayer.source.ShuffleOrder))(ShuffleOrder shuffleOrder)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets a new shuffle order to use when shuffling the child media sources.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder` | A `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder`. |

### setShuffleOrder

```
synchronized public void [setShuffleOrder](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#setShuffleOrder(androidx.media3.exoplayer.source.ShuffleOrder,android.os.Handler,java.lang.Runnable))(
    ShuffleOrder shuffleOrder,
    Handler handler,
    Runnable onCompletionAction
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Sets a new shuffle order to use when shuffling the child media sources.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder shuffleOrder` | A `https://developer.android.com/reference/androidx/media3/exoplayer/source/ShuffleOrder`. |
| `https://developer.android.com/reference/android/os/Handler.html handler` | The `https://developer.android.com/reference/android/os/Handler.html` to run `onCompletionAction`. |
| `https://developer.android.com/reference/java/lang/Runnable.html onCompletionAction` | A `https://developer.android.com/reference/java/lang/Runnable.html` which is executed immediately after the shuffle order has been changed. |

## Protected methods

### disableInternal

```
protected void [disableInternal](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#disableInternal())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Disables the source, see `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#disable(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)`.

### enableInternal

```
protected void [enableInternal](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#enableInternal())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Enables the source, see `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#enable(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)`.

### getMediaPeriodIdForChildMediaPeriodId

```
protected @Nullable MediaSource.MediaPeriodId [getMediaPeriodIdForChildMediaPeriodId](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getMediaPeriodIdForChildMediaPeriodId(androidx.media3.exoplayer.source.ConcatenatingMediaSource.MediaSourceHolder,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(
    ConcatenatingMediaSource.MediaSourceHolder childSourceId,
    MediaSource.MediaPeriodId mediaPeriodId
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` in the composite source corresponding to the specified `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` in a child source. The default implementation does not change the media period id.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource.MediaSourceHolder childSourceId` | The unique id used to prepare the child source. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId mediaPeriodId` | A `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` of the child source. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` | The corresponding `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` in the composite source. Null if no corresponding media period id can be determined. |

### getWindowIndexForChildWindowIndex

```
protected int [getWindowIndexForChildWindowIndex](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#getWindowIndexForChildWindowIndex(androidx.media3.exoplayer.source.ConcatenatingMediaSource.MediaSourceHolder,int))(
    ConcatenatingMediaSource.MediaSourceHolder childSourceId,
    int windowIndex
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Returns the window index in the composite source corresponding to the specified window index in a child source. The default implementation does not change the window index.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource.MediaSourceHolder childSourceId` | The unique id used to prepare the child source. |
| `int windowIndex` | A window index of the child source. |

| Returns |
|---|---|
| `int` | The corresponding window index in the composite source. |

### onChildSourceInfoRefreshed

```
protected void [onChildSourceInfoRefreshed](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#onChildSourceInfoRefreshed(androidx.media3.exoplayer.source.ConcatenatingMediaSource.MediaSourceHolder,androidx.media3.exoplayer.source.MediaSource,androidx.media3.common.Timeline))(
    ConcatenatingMediaSource.MediaSourceHolder childSourceId,
    MediaSource mediaSource,
    Timeline newTimeline
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called when the source info of a child source has been refreshed.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource.MediaSourceHolder childSourceId` | The unique id used to prepare the child source. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource mediaSource` | The child source whose source info has been refreshed. |
| `https://developer.android.com/reference/androidx/media3/common/Timeline newTimeline` | The timeline of the child source. |

### prepareSourceInternal

```
synchronized protected void [prepareSourceInternal](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#prepareSourceInternal(androidx.media3.datasource.TransferListener))(@Nullable TransferListener mediaTransferListener)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Starts source preparation and enables the source, see `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.BandwidthMeter)`. This method is called at most once until the next call to `https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#releaseSourceInternal()`.

This method is called on the playback thread.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/TransferListener mediaTransferListener` | The transfer listener which should be informed of any media data transfers. May be null if no listener is available. Note that this listener should usually be only informed of transfers related to the media loads and not of auxiliary loads for manifests and other data. |

### releaseSourceInternal

```
synchronized protected void [releaseSourceInternal](https://developer.android.com/reference/androidx/media3/exoplayer/source/ConcatenatingMediaSource#releaseSourceInternal())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Releases the source, see `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource#releaseSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)`. This method is called exactly once after each call to `https://developer.android.com/reference/androidx/media3/exoplayer/source/BaseMediaSource#prepareSourceInternal(androidx.media3.datasource.TransferListener)`.

This method is called on the playback thread.