Stay organized with collections
Save and categorize content based on your preferences.
Annotations
Interfaces
Classes
Exceptions
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# androidx.media3.exoplayer.source.ads\n====================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/androidx/media3/exoplayer/source/ads/package-summary \"View this page in Kotlin\") \\|Java\n\nAnnotations\n-----------\n\n|----------------------------------------------------------------------------------------------------------------------------|------------------------------|\n| [AdsMediaSource.AdLoadException.Type](/reference/androidx/media3/exoplayer/source/ads/AdsMediaSource.AdLoadException.Type) | Types of ad load exceptions. |\n\nInterfaces\n----------\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [AdsLoader](/reference/androidx/media3/exoplayer/source/ads/AdsLoader) | Interface for loaders of ads, which can be used with [AdsMediaSource](/reference/androidx/media3/exoplayer/source/ads/AdsMediaSource). |\n| [AdsLoader.EventListener](/reference/androidx/media3/exoplayer/source/ads/AdsLoader.EventListener) | Listener for ads loader events. |\n| [AdsLoader.Provider](/reference/androidx/media3/exoplayer/source/ads/AdsLoader.Provider) | Provides [AdsLoader](/reference/androidx/media3/exoplayer/source/ads/AdsLoader) instances for media items that have [ad tag URIs](/reference/androidx/media3/common/MediaItem.LocalConfiguration#adsConfiguration()). |\n| [ServerSideAdInsertionMediaSource.AdPlaybackStateUpdater](/reference/androidx/media3/exoplayer/source/ads/ServerSideAdInsertionMediaSource.AdPlaybackStateUpdater) | Receives ad playback state update requests when the [Timeline](/reference/androidx/media3/common/Timeline) of the content media source has changed. |\n\nClasses\n-------\n\n|----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [AdsMediaSource](/reference/androidx/media3/exoplayer/source/ads/AdsMediaSource) | A [MediaSource](/reference/androidx/media3/exoplayer/source/MediaSource) that inserts ads linearly into a provided content media source. |\n| [ServerSideAdInsertionMediaSource](/reference/androidx/media3/exoplayer/source/ads/ServerSideAdInsertionMediaSource) | A [MediaSource](/reference/androidx/media3/exoplayer/source/MediaSource) for server-side inserted ad breaks. |\n| [ServerSideAdInsertionUtil](/reference/androidx/media3/exoplayer/source/ads/ServerSideAdInsertionUtil) | A static utility class with methods to work with server-side inserted ads. |\n| [SinglePeriodAdTimeline](/reference/androidx/media3/exoplayer/source/ads/SinglePeriodAdTimeline) | A [Timeline](/reference/androidx/media3/common/Timeline) for sources that have ads. |\n\nExceptions\n----------\n\n|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [AdsMediaSource.AdLoadException](/reference/androidx/media3/exoplayer/source/ads/AdsMediaSource.AdLoadException) | Wrapper for exceptions that occur while loading ads, which are notified via [onLoadError](/reference/androidx/media3/exoplayer/source/MediaSourceEventListener#onLoadError(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.source.MediaLoadData,java.io.IOException,boolean)). |"]]