# LoopingMediaSource

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

*** ** * ** ***


```
@UnstableApi
class LoopingMediaSource : WrappingMediaSource
```

<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) |||
|   |   | ↳ | [androidx.media3.exoplayer.source.WrappingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource) ||
|   |   |   | ↳ | [androidx.media3.exoplayer.source.LoopingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource) |

*** ** * ** ***

> [!CAUTION]
> **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. To add a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` a specific number of times to the playlist, use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#addMediaSource(androidx.media3.exoplayer.source.MediaSource)` in a loop with the same `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`. To combine repeated `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` instances into one `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`, for example to further wrap it in another `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`, use `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ConcatenatingMediaSource2` with the same `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource``https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ConcatenatingMediaSource2.Builder#add(androidx.media3.common.MediaItem)` multiple times.

Loops a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` a specified number of times.

## Summary

| ### Public constructors |
|---|
| `[LoopingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#LoopingMediaSource(androidx.media3.exoplayer.source.MediaSource))(childSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!)` **This function is deprecated.** Deprecated in Java |
| `[LoopingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#LoopingMediaSource(androidx.media3.exoplayer.source.MediaSource,int))(childSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!, loopCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod!` | `[createPeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#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 )` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline?` | `[getInitialTimeline](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#getInitialTimeline())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[isSingleWindow](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#isSingleWindow())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[releasePeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#releasePeriod(androidx.media3.exoplayer.source.MediaPeriod))(mediaPeriod: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaPeriod!)` **This function is deprecated.** Deprecated in Java |

| ### Protected functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?` | `[getMediaPeriodIdForChildMediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#getMediaPeriodIdForChildMediaPeriodId(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))( mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId! )` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[onChildSourceInfoRefreshed](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#onChildSourceInfoRefreshed(androidx.media3.common.Timeline))(newTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!)` **This function is deprecated.** Deprecated in Java |

### 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
[addDrmEventListener](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!
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
[addEventListener](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!
)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener.EventDispatcher!` `[createDrmEventDispatcher](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?)`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener.EventDispatcher!` `[createDrmEventDispatcher](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?
)`

**This function is deprecated.** Deprecated in Java
`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))(mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?)`

**This function is deprecated.** Deprecated in Java
`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!` `[createEventDispatcher](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?
)`

**This function is deprecated.** Deprecated in Java
`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
[disable](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
[enable](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isEnabled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#isEnabled())()`

**This function is deprecated.** Deprecated in Java
`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/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!
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[prepareSourceCalled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#prepareSourceCalled())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[refreshSourceInfo](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
[releaseSource](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
[removeDrmEventListener](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
[removeEventListener](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!)`

**This function is deprecated.** Deprecated in Java
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` `[disableChildSource](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
[disableInternal](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#disableInternal())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[enableChildSource](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
[enableInternal](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#enableInternal())()`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?` `[getMediaPeriodIdForChildMediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#getMediaPeriodIdForChildMediaPeriodId(T,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(
@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnknownNull childSourceId: T!,
mediaPeriodId: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId!
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `[getMediaTimeForChildMediaTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#getMediaTimeForChildMediaTime(T,long,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(
@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnknownNull childSourceId: T!,
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?
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[getWindowIndexForChildWindowIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#getWindowIndexForChildWindowIndex(T,int))(
@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnknownNull childSourceId: T!,
windowIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
[maybeThrowSourceInfoRefreshError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#maybeThrowSourceInfoRefreshError())()`

**This function is deprecated.** Deprecated in Java
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onChildSourceInfoRefreshed](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#onChildSourceInfoRefreshed(T,androidx.media3.exoplayer.source.MediaSource,androidx.media3.common.Timeline))(
@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnknownNull childSourceId: T!,
mediaSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!,
newTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[prepareChildSource](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[releaseChildSource](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper
[releaseSourceInternal](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/CompositeMediaSource#releaseSourceInternal())()`

**This function is deprecated.** Deprecated in Java
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 />

From [androidx.media3.exoplayer.source.WrappingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[canUpdateMediaItem](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!)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[disableChildSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#disableChildSource())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[enableChildSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#enableChildSource())()`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem!` `[getMediaItem](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#getMediaItem())()`

**This function is deprecated.** Deprecated in Java
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId?` `[getMediaPeriodIdForChildMediaPeriodId](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!
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `[getMediaTimeForChildMediaTime](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?
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `[getMediaTimeForChildMediaTime](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?
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[getWindowIndexForChildWindowIndex](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)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[getWindowIndexForChildWindowIndex](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)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onChildSourceInfoRefreshed](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!
)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[prepareChildSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#prepareChildSource())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[prepareSourceInternal](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#prepareSourceInternal())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[prepareSourceInternal](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?)`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[releaseChildSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#releaseChildSource())()`

**This function is deprecated.** Deprecated in Java
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[updateMediaItem](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!)`

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

### 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()`

**This property is deprecated.** Deprecated in Java
`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlayerId?` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/BaseMediaSource#playerId()`

**This property is deprecated.** Deprecated in Java
From [androidx.media3.exoplayer.source.WrappingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource) `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/WrappingMediaSource#mediaSource()`

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

## Public constructors

### LoopingMediaSource

```
[LoopingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#LoopingMediaSource(androidx.media3.exoplayer.source.MediaSource))(childSource: MediaSource!)
```

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

Loops the provided source indefinitely. Note that it is usually better to use `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#setRepeatMode(int)`.

| Parameters |
|---|---|
| `childSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` to loop. |

### LoopingMediaSource

```
[LoopingMediaSource](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#LoopingMediaSource(androidx.media3.exoplayer.source.MediaSource,int))(childSource: MediaSource!, loopCount: Int)
```

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

Loops the provided source a specified number of times.

| Parameters |
|---|---|
| `childSource: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` to loop. |
| `loopCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The desired number of loops. Must be strictly positive. |

## Public functions

### createPeriod

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

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

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](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#getInitialTimeline())(): Timeline?
```

> [!CAUTION]
> **This function 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.

### isSingleWindow

```
fun [isSingleWindow](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#isSingleWindow())(): Boolean
```

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

### releasePeriod

```
fun [releasePeriod](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#releasePeriod(androidx.media3.exoplayer.source.MediaPeriod))(mediaPeriod: MediaPeriod!): Unit
```

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

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)` |   |

## Protected functions

### getMediaPeriodIdForChildMediaPeriodId

```
protected fun [getMediaPeriodIdForChildMediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#getMediaPeriodIdForChildMediaPeriodId(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))(
    mediaPeriodId: MediaSource.MediaPeriodId!
): MediaSource.MediaPeriodId?
```

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

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. |

### onChildSourceInfoRefreshed

```
protected fun [onChildSourceInfoRefreshed](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoopingMediaSource#onChildSourceInfoRefreshed(androidx.media3.common.Timeline))(newTimeline: Timeline!): Unit
```

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

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. |