# WrappingMediaSource

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/WrappingMediaSource.java+class:androidx.media3.exoplayer.source.WrappingMediaSource)

*** ** * ** ***


```
@UnstableApi
abstract class WrappingMediaSource : CompositeMediaSource<Void!>
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [androidx.media3.exoplayer.source.BaseMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource) |||
|   | ↳ | [androidx.media3.exoplayer.source.CompositeMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource)\<[Void](https://developer.android.com/reference/java/lang/Void.html)!\> ||
|   |   | ↳ | [androidx.media3.exoplayer.source.WrappingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource) |

Known direct subclasses [ClippingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ClippingMediaSource), [FilteringMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/FilteringMediaSource), [LoopingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource), [MaskingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MaskingMediaSource), [PreloadMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/preload/PreloadMediaSource)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ClippingMediaSource` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` that wraps a source and clips its timeline based on specified start/end positions. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/FilteringMediaSource` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` that filters the available `https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource` | **This class is deprecated.** To loop a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` indefinitely, use `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#setRepeatMode(int)` instead of this class. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MaskingMediaSource` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` that masks the `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` with a placeholder until the actual media structure is known. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/preload/PreloadMediaSource` | Preloads a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` and provides a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` that has data loaded before playback. |

*** ** * ** ***

An abstract `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` wrapping a single child `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`.

The implementation may want to override the following methods as needed:

- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getMediaItem()`: Amend the `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` for this media source. This is only used before the child source is prepared. You may also want to override `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#canUpdateMediaItem(androidx.media3.common.MediaItem)` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#updateMediaItem(androidx.media3.common.MediaItem)` to intercept further updates to the `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`.
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#onChildSourceInfoRefreshed(androidx.media3.common.Timeline)`: Called whenever the child source's `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` changed. This `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` can be amended if needed, for example using `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingTimeline`. The `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` for the wrapping source needs to be published with `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#refreshSourceInfo(androidx.media3.common.Timeline)`.
- `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#createPeriod(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.upstream.Allocator,long)`/`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#releasePeriod(androidx.media3.exoplayer.source.MediaPeriod)`: These methods create and release `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` instances. They typically forward to the wrapped media source and optionally wrap the returned `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`.

Other methods like `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#prepareSourceInternal(androidx.media3.datasource.TransferListener)`, `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#enableInternal()`, `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#disableInternal()` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#releaseSourceInternal()` only need to be overwritten if required for resource management.

## Summary

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#WrappingMediaSource(androidx.media3.exoplayer.source.MediaSource)(mediaSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!)` Creates the wrapping `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#canUpdateMediaItem(androidx.media3.common.MediaItem)(mediaItem: https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem!)` Returns whether the for this source can be updated with the provided item. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#createPeriod(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.upstream.Allocator,long)( id: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!, allocator: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Allocator!, startPositionUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Creates the requested `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getInitialTimeline()()` 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. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getMediaItem()()` Returns the whose media is provided by the source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#isSingleWindow()()` Returns true if the media source is guaranteed to never have zero or more than one window. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#releasePeriod(androidx.media3.exoplayer.source.MediaPeriod)(mediaPeriod: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod!)` Releases a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#updateMediaItem(androidx.media3.common.MediaItem)(mediaItem: https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem!)` Updates the for this source. |

| ### Protected functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#disableChildSource()()` Disables the child source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#enableChildSource()()` Enables the child source. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getMediaPeriodIdForChildMediaPeriodId(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)( mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId! )` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` in the wrapping source corresponding to the specified `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` in a child source. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getMediaPeriodIdForChildMediaPeriodId(java.lang.Void,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)( childSourceId: https://developer.android.com/reference/java/lang/Void.html!, mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId! )` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` in the composite source corresponding to the specified `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` in a child source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getMediaTimeForChildMediaTime(long,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)( mediaTimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId? )` Returns the media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the wrapping source corresponding to the specified media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the child source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getMediaTimeForChildMediaTime(java.lang.Void,long,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)( childSourceId: https://developer.android.com/reference/java/lang/Void.html!, mediaTimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId? )` Returns the media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the composite source corresponding to the specified media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the child source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getWindowIndexForChildWindowIndex(int)(windowIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the window index in the wrapping source corresponding to the specified window index in a child source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getWindowIndexForChildWindowIndex(java.lang.Void,int)(childSourceId: https://developer.android.com/reference/java/lang/Void.html!, windowIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the window index in the composite source corresponding to the specified window index in a child source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#onChildSourceInfoRefreshed(androidx.media3.common.Timeline)(newTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!)` Called when the child source info has been refreshed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#onChildSourceInfoRefreshed(java.lang.Void,androidx.media3.exoplayer.source.MediaSource,androidx.media3.common.Timeline)( childSourceId: https://developer.android.com/reference/java/lang/Void.html!, mediaSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!, newTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline! )` Called when the source info of a child source has been refreshed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#prepareChildSource()()` Prepares the wrapped child source. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#prepareSourceInternal()()` Starts source preparation and enables the source, see `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.BandwidthMeter)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#prepareSourceInternal(androidx.media3.datasource.TransferListener)(mediaTransferListener: https://developer.android.com/reference/kotlin/androidx/media3/datasource/TransferListener?)` Starts source preparation and enables the source, see `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.BandwidthMeter)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#releaseChildSource()()` Releases the child source. |

| ### Protected properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#mediaSource()` The wrapped child `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`. |

### Inherited functions

From [androidx.media3.exoplayer.source.BaseMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#addDrmEventListener(android.os.Handler,androidx.media3.exoplayer.drm.DrmSessionEventListener)(
handler: https://developer.android.com/reference/android/os/Handler.html!,
eventListener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener!
)`

Adds a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener` to the list of listeners which are notified of DRM events for this media source.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#addEventListener(android.os.Handler,androidx.media3.exoplayer.source.MediaSourceEventListener)(
handler: https://developer.android.com/reference/android/os/Handler.html!,
eventListener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener!
)`

Adds a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener` to the list of listeners which are notified of media source events.
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener.EventDispatcher!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#createDrmEventDispatcher(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)(mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?)`

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener.EventDispatcher` which dispatches all events to the registered listeners with the specified `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId`
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener.EventDispatcher!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#createDrmEventDispatcher(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)(
windowIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?
)`

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener.EventDispatcher` which dispatches all events to the registered listeners with the specified window index and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId`.
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)(mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?)`

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher` which dispatches all events to the registered listeners with the specified `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId`.
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher!` `[createEventDispatcher](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long))(
mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!,
mediaTimeOffsetMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html
)`

**This function is deprecated.**

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

<br />

`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId)(
windowIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?
)`

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher` which dispatches all events to the registered listeners with the specified window index and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId`.
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher!` `[createEventDispatcher](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#createEventDispatcher(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,long))(
windowIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?,
mediaTimeOffsetMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html
)`

**This function is deprecated.**

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

<br />

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#disable(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)(caller: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller!)`

Disables the source for the creation of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#enable(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)(caller: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller!)`

Enables the source for the creation of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#isEnabled()()`

Returns whether the source is enabled.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.BandwidthMeter)(
caller: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller!,
playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!,
bandwidthMeter: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter!
)`

Registers a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#prepareSourceCalled()()`

Returns whether the source has `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.exoplayer.analytics.PlayerId,androidx.media3.exoplayer.upstream.BandwidthMeter)` called.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#refreshSourceInfo(androidx.media3.common.Timeline)(timeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!)`

Updates timeline and manifest and notifies all listeners of the update.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#releaseSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)(caller: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller!)`

Unregisters a caller, and disables and releases the source if no longer required.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#removeDrmEventListener(androidx.media3.exoplayer.drm.DrmSessionEventListener)(eventListener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener!)`

Removes a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener` from the list of listeners which are notified of DRM events for this media source.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#removeEventListener(androidx.media3.exoplayer.source.MediaSourceEventListener)(eventListener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener!)`

Removes a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener` from the list of listeners which are notified of media source events.
From [androidx.media3.exoplayer.source.CompositeMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#disableChildSource(T)(@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnknownNull id: T!)`

Disables a child source.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#disableInternal()()`

Disables the source, see `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#disable(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#enableChildSource(T)(@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnknownNull id: T!)`

Enables a child source.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#enableInternal()()`

Enables the source, see `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#enable(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)`.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#maybeThrowSourceInfoRefreshError()()`

Throws any pending error encountered while loading or refreshing source information.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#prepareChildSource(T,androidx.media3.exoplayer.source.MediaSource)(@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnknownNull id: T!, mediaSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!)`

Prepares a child source.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#releaseChildSource(T)(@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnknownNull id: T!)`

Releases a child source.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#releaseSourceInternal()()`

Releases the source, see `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#releaseSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller)`.
From [androidx.media3.exoplayer.source.MediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
[prepareSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#prepareSource(androidx.media3.exoplayer.source.MediaSource.MediaSourceCaller,androidx.media3.datasource.TransferListener,androidx.media3.exoplayer.analytics.PlayerId))(
caller: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaSourceCaller!,
mediaTransferListener: https://developer.android.com/reference/kotlin/androidx/media3/datasource/TransferListener?,
playerId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId!
)`

**This function is deprecated.**

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

<br />

### Inherited properties

From [androidx.media3.exoplayer.source.BaseMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource) `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter?` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#bandwidthMeter()` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId?` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#playerId()`

## Protected constructors

### WrappingMediaSource

```
protected WrappingMediaSource(mediaSource: MediaSource!)
```

Creates the wrapping `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`.

| Parameters |
|---|---|
| `mediaSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!` | The wrapped child `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`. |

## Public functions

### canUpdateMediaItem

```
fun canUpdateMediaItem(mediaItem: MediaItem!): Boolean
```

Returns whether the for this source can be updated with the provided item.

Should not be called directly from application code.

This method must be called on the application thread.

This method can be overridden to change whether the `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` of the child source can be updated.

### createPeriod

```
fun createPeriod(
    id: MediaSource.MediaPeriodId!,
    allocator: Allocator!,
    startPositionUs: Long
): MediaPeriod!
```

Creates the requested `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`.

This method typically forwards to the wrapped media source and optionally wraps the returned `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#createPeriod(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.upstream.Allocator,long)` |   |

### getInitialTimeline

```
fun getInitialTimeline(): Timeline?
```

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

```
fun getMediaItem(): MediaItem!
```

Returns the whose media is provided by the source.

Should not be called directly from application code.

This method must be called on the application thread.

This method can be overridden to amend the `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` of the child source. It is only used before the child source is prepared.

### isSingleWindow

```
fun isSingleWindow(): Boolean
```

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 |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the source has exactly one window. |

### releasePeriod

```
fun releasePeriod(mediaPeriod: MediaPeriod!): Unit
```

Releases a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`.

This method typically forwards to the wrapped media source and optionally unwraps the provided `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource#releasePeriod(androidx.media3.exoplayer.source.MediaPeriod)` |   |

### updateMediaItem

```
fun updateMediaItem(mediaItem: MediaItem!): Unit
```

Updates the for this source.

Should not be called directly from application code.

This method must be called on the playback thread and only if #canUpdateMediaItem returns true} for the new .

This method can be overridden to change how the `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem` of the child source is updated.

## Protected functions

### disableChildSource

```
protected fun disableChildSource(): Unit
```

Disables the child source.

### enableChildSource

```
protected fun enableChildSource(): Unit
```

Enables the child source.

### getMediaPeriodIdForChildMediaPeriodId

```
protected fun getMediaPeriodIdForChildMediaPeriodId(
    mediaPeriodId: MediaSource.MediaPeriodId!
): MediaSource.MediaPeriodId?
```

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

| Parameters |
|---|---|
| `mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` of the child source. |

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

### getMediaPeriodIdForChildMediaPeriodId

```
protected fun getMediaPeriodIdForChildMediaPeriodId(
    childSourceId: Void!,
    mediaPeriodId: MediaSource.MediaPeriodId!
): MediaSource.MediaPeriodId?
```

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

| Parameters |
|---|---|
| `childSourceId: https://developer.android.com/reference/java/lang/Void.html!` | The unique id used to prepare the child source. |
| `mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` of the child source. |

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

### getMediaTimeForChildMediaTime

```
protected fun getMediaTimeForChildMediaTime(
    mediaTimeMs: Long,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Long
```

Returns the media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the wrapping source corresponding to the specified media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the child source. The default implementation does not change the media time.

| Parameters |
|---|---|
| `mediaTimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | A media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the child source, in milliseconds. |
| `mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` of the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the child source, or null if the time does not relate to a specific `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The corresponding media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the wrapping source, in milliseconds. |

### getMediaTimeForChildMediaTime

```
protected fun getMediaTimeForChildMediaTime(
    childSourceId: Void!,
    mediaTimeMs: Long,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Long
```

Returns the media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the composite source corresponding to the specified media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the child source. The default implementation does not change the media time.

| Parameters |
|---|---|
| `childSourceId: https://developer.android.com/reference/java/lang/Void.html!` | The unique id used to prepare the child source. |
| `mediaTimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | A media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the child source, in milliseconds. |
| `mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId` of the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the child source, or null if the time does not relate to a specific `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The corresponding media time in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod` of the composite source, in milliseconds. |

### getWindowIndexForChildWindowIndex

```
protected fun getWindowIndexForChildWindowIndex(windowIndex: Int): Int
```

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

| Parameters |
|---|---|
| `windowIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A window index of the child source. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The corresponding window index in the wrapping source. |

### getWindowIndexForChildWindowIndex

```
protected fun getWindowIndexForChildWindowIndex(childSourceId: Void!, windowIndex: Int): Int
```

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 |
|---|---|
| `childSourceId: https://developer.android.com/reference/java/lang/Void.html!` | The unique id used to prepare the child source. |
| `windowIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A window index of the child source. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The corresponding window index in the composite source. |

### onChildSourceInfoRefreshed

```
protected fun onChildSourceInfoRefreshed(newTimeline: Timeline!): Unit
```

Called when the child source info has been refreshed.

This `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` can be amended if needed, for example using `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingTimeline`. The `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` for the wrapping source needs to be published with `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#refreshSourceInfo(androidx.media3.common.Timeline)`.

| Parameters |
|---|---|
| `newTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!` | The timeline of the child source. |

### onChildSourceInfoRefreshed

```
protected fun onChildSourceInfoRefreshed(
    childSourceId: Void!,
    mediaSource: MediaSource!,
    newTimeline: Timeline!
): Unit
```

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

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

### prepareChildSource

```
protected fun prepareChildSource(): Unit
```

Prepares the wrapped child source.

`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#onChildSourceInfoRefreshed(androidx.media3.common.Timeline)` will be called when the child source updates its timeline.

If sources aren't explicitly released with `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#releaseChildSource()` they will be released in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#releaseSourceInternal()`.

### prepareSourceInternal

```
protected fun prepareSourceInternal(): Unit
```

Starts source preparation and enables the source, see `https://developer.android.com/reference/kotlin/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/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#releaseSourceInternal()`.

### prepareSourceInternal

```
protected fun prepareSourceInternal(mediaTransferListener: TransferListener?): Unit
```

Starts source preparation and enables the source, see `https://developer.android.com/reference/kotlin/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/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#releaseSourceInternal()`.

This method is called on the playback thread.

| Parameters |
|---|---|
| `mediaTransferListener: https://developer.android.com/reference/kotlin/androidx/media3/datasource/TransferListener?` | 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. |

### releaseChildSource

```
protected fun releaseChildSource(): Unit
```

Releases the child source.

## Protected properties

### mediaSource

```
protected val mediaSource: MediaSource!
```

The wrapped child `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`.