Upgrade Guides

Changes in 5.0.0

Media3 ExoPlayer 1.1.1

Note

ExoPlayer dependencies now use group com.castlabs.media3 instead of com.google.android.exoplayer.

Artifact names are changed as follows:

Previous artifact

New artifact

extension-cast

media3-cast

extension-cronet

media3-datasource-cronet

extension-ima

media3-exoplayer-ima

extension-leanback

media3-ui-leanback

extension-okhttp

media3-datasource-okhttp

extension-rtmp

media3-datasource-rtmp

extension-workmanager

media3-exoplayer-workmanager

library-common

media3-common

library-container

media3-container

library-core

media3-exoplayer

library-dash

media3-exoplayer-dash

library-database

media3-database

library-datasource

media3-datasource

library-decoder

media3-decoder

library-effect

media3-effect

library-extractor

media3-extractor

library-gstreamer

media3-exoplayer-gstreamer

library-hls

media3-exoplayer-hls

library-iptv

media3-exoplayer-iptv

library-muxer

media3-muxer

library-rtp

media3-exoplayer-rtp

library-rtsp

media3-exoplayer-rtsp

library-sdp

media3-exoplayer-sdp

library-smoothstreaming

media3-exoplayer-smoothstreaming

library-transformer

media3-transformer

library-ui

media3-ui

robolectricutils

media3-test-utils-robolectric

testutils

media3-test-utils

Exposed ExoPlayer API types

Some SDK APIs expose ExoPlayer types in public or protected fields, constructors, methods, callbacks, exceptions, base classes, or implemented interfaces. Code that references those API points must replace the old ExoPlayer 2 type with the castLabs Media3 type shown below. The com.castlabs.media3 types are distinct from stock androidx.media3 types and cannot be used interchangeably.

Previous ExoPlayer type

New castLabs Media3 type

com.google.android.exoplayer2.AudioFocusCallback

com.castlabs.media3.exoplayer.AudioFocusCallback

com.google.android.exoplayer2.BaseRenderer

com.castlabs.media3.exoplayer.BaseRenderer

com.google.android.exoplayer2.ExoPlaybackException

com.castlabs.media3.exoplayer.ExoPlaybackException

com.google.android.exoplayer2.ExoPlayer

com.castlabs.media3.exoplayer.ExoPlayer

com.google.android.exoplayer2.Format

com.castlabs.media3.common.Format

com.google.android.exoplayer2.MediaItem

com.castlabs.media3.common.MediaItem

com.google.android.exoplayer2.ParserException

com.castlabs.media3.common.ParserException

com.google.android.exoplayer2.PlaybackException

com.castlabs.media3.common.PlaybackException

com.google.android.exoplayer2.PlaybackParameters

com.castlabs.media3.common.PlaybackParameters

com.google.android.exoplayer2.Renderer

com.castlabs.media3.exoplayer.Renderer

com.google.android.exoplayer2.RendererCapabilities

com.castlabs.media3.exoplayer.RendererCapabilities

com.google.android.exoplayer2.RendererCapabilities.Listener

com.castlabs.media3.exoplayer.RendererCapabilities.Listener

com.google.android.exoplayer2.Timeline

com.castlabs.media3.common.Timeline

com.google.android.exoplayer2.Timeline.Period

com.castlabs.media3.common.Timeline.Period

com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher

com.castlabs.media3.exoplayer.analytics.IptvAnalyticsListener.EventDispatcher

com.google.android.exoplayer2.audio.AudioAttributes

com.castlabs.media3.common.AudioAttributes

com.google.android.exoplayer2.audio.AudioCapabilities

com.castlabs.media3.exoplayer.audio.AudioCapabilities

com.google.android.exoplayer2.audio.AudioCapabilitiesReceiver.Listener

com.castlabs.media3.exoplayer.audio.AudioCapabilitiesReceiver.Listener

com.google.android.exoplayer2.audio.AudioMismatchListener

com.castlabs.media3.exoplayer.audio.AudioMismatchListener

com.google.android.exoplayer2.audio.AudioRendererEventListener

com.castlabs.media3.exoplayer.audio.AudioRendererEventListener

com.google.android.exoplayer2.audio.AudioSink.ConfigurationException

com.castlabs.media3.exoplayer.audio.AudioSink.ConfigurationException

com.google.android.exoplayer2.audio.AudioSink.InitializationException

com.castlabs.media3.exoplayer.audio.AudioSink.InitializationException

com.google.android.exoplayer2.audio.AudioSink.WriteException

com.castlabs.media3.exoplayer.audio.AudioSink.WriteException

com.google.android.exoplayer2.audio.DecoderAudioRenderer

com.castlabs.media3.exoplayer.audio.DecoderAudioRenderer

com.google.android.exoplayer2.decoder.CryptoConfig

com.castlabs.media3.decoder.CryptoConfig

com.google.android.exoplayer2.decoder.Decoder

com.castlabs.media3.decoder.Decoder

com.google.android.exoplayer2.decoder.DecoderCounters

com.castlabs.media3.exoplayer.DecoderCounters

com.google.android.exoplayer2.decoder.DecoderException

com.castlabs.media3.decoder.DecoderException

com.google.android.exoplayer2.decoder.DecoderInputBuffer

com.castlabs.media3.decoder.DecoderInputBuffer

com.google.android.exoplayer2.decoder.DecoderOutputBuffer

com.castlabs.media3.decoder.DecoderOutputBuffer

com.google.android.exoplayer2.decoder.DecoderReuseEvaluation

com.castlabs.media3.exoplayer.DecoderReuseEvaluation

com.google.android.exoplayer2.decoder.SimpleDecoder

com.castlabs.media3.decoder.SimpleDecoder

com.google.android.exoplayer2.decoder.SimpleDecoderOutputBuffer

com.castlabs.media3.decoder.SimpleDecoderOutputBuffer

com.google.android.exoplayer2.decoder.VideoDecoderOutputBuffer

com.castlabs.media3.decoder.VideoDecoderOutputBuffer

com.google.android.exoplayer2.drm.DrmInitData

com.castlabs.media3.common.DrmInitData

com.google.android.exoplayer2.drm.DrmInitData.SchemeData

com.castlabs.media3.common.DrmInitData.SchemeData

com.google.android.exoplayer2.drm.DrmSession

com.castlabs.media3.exoplayer.drm.DrmSession

com.google.android.exoplayer2.drm.DrmSessionManager

com.castlabs.media3.exoplayer.drm.DrmSessionManager

com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest

com.castlabs.media3.exoplayer.drm.ExoMediaDrm.KeyRequest

com.google.android.exoplayer2.drm.ExoMediaDrm.OnEventListener

com.castlabs.media3.exoplayer.drm.ExoMediaDrm.OnEventListener

com.google.android.exoplayer2.drm.ExoMediaDrm.OnKeyStatusChangeListener

com.castlabs.media3.exoplayer.drm.ExoMediaDrm.OnKeyStatusChangeListener

com.google.android.exoplayer2.drm.ExoMediaDrm.ProvisionRequest

com.castlabs.media3.exoplayer.drm.ExoMediaDrm.ProvisionRequest

com.google.android.exoplayer2.drm.FrameworkCryptoConfig

com.castlabs.media3.exoplayer.drm.FrameworkCryptoConfig

com.google.android.exoplayer2.drm.MediaDrmCallback

com.castlabs.media3.exoplayer.drm.MediaDrmCallback

com.google.android.exoplayer2.drm.UnsupportedDrmException

com.castlabs.media3.exoplayer.drm.UnsupportedDrmException

com.google.android.exoplayer2.mediacodec.MediaCodecAdapter

com.castlabs.media3.exoplayer.mediacodec.MediaCodecAdapter

com.google.android.exoplayer2.mediacodec.MediaCodecAdapter.Configuration

com.castlabs.media3.exoplayer.mediacodec.MediaCodecAdapter.Configuration

com.google.android.exoplayer2.mediacodec.MediaCodecAdapter.Factory

com.castlabs.media3.exoplayer.mediacodec.MediaCodecAdapter.Factory

com.google.android.exoplayer2.mediacodec.MediaCodecInfo

com.castlabs.media3.exoplayer.mediacodec.MediaCodecInfo

com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.DecoderInitializationException

com.castlabs.media3.exoplayer.mediacodec.MediaCodecRenderer.DecoderInitializationException

com.google.android.exoplayer2.mediacodec.MediaCodecSelector

com.castlabs.media3.exoplayer.mediacodec.MediaCodecSelector

com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException

com.castlabs.media3.exoplayer.mediacodec.MediaCodecUtil.DecoderQueryException

com.google.android.exoplayer2.metadata.Metadata.Entry

com.castlabs.media3.common.Metadata.Entry

com.google.android.exoplayer2.offline.FilterableManifest

com.castlabs.media3.exoplayer.offline.FilterableManifest

com.google.android.exoplayer2.source.BaseMediaSource

com.castlabs.media3.exoplayer.source.BaseMediaSource

com.google.android.exoplayer2.source.LoadEventInfo

com.castlabs.media3.exoplayer.source.LoadEventInfo

com.google.android.exoplayer2.source.MediaLoadData

com.castlabs.media3.exoplayer.source.MediaLoadData

com.google.android.exoplayer2.source.MediaPeriod

com.castlabs.media3.exoplayer.source.MediaPeriod

com.google.android.exoplayer2.source.MediaSource

com.castlabs.media3.exoplayer.source.MediaSource

com.google.android.exoplayer2.source.MediaSource.Factory

com.castlabs.media3.exoplayer.source.MediaSource.Factory

com.google.android.exoplayer2.source.MediaSource.MediaPeriodId

com.castlabs.media3.exoplayer.source.MediaSource.MediaPeriodId

com.google.android.exoplayer2.source.MediaSource.SourceErrorListener.SourceData

com.castlabs.media3.exoplayer.source.MediaSource.SourceErrorListener.SourceData

com.google.android.exoplayer2.source.MediaSourceEventListener

com.castlabs.media3.exoplayer.source.MediaSourceEventListener

com.google.android.exoplayer2.source.TrackGroup

com.castlabs.media3.common.TrackGroup

com.google.android.exoplayer2.source.TrackGroupArray

com.castlabs.media3.exoplayer.source.TrackGroupArray

com.google.android.exoplayer2.source.chunk.MediaChunk

com.castlabs.media3.exoplayer.source.chunk.MediaChunk

com.google.android.exoplayer2.source.chunk.MediaChunkIterator

com.castlabs.media3.exoplayer.source.chunk.MediaChunkIterator

com.google.android.exoplayer2.source.dash.DashPeriodNotFoundException

com.castlabs.media3.exoplayer.dash.DashPeriodNotFoundException

com.google.android.exoplayer2.source.dash.manifest.AdaptationSet

com.castlabs.media3.exoplayer.dash.manifest.AdaptationSet

com.google.android.exoplayer2.source.dash.manifest.BaseUrl

com.castlabs.media3.exoplayer.dash.manifest.BaseUrl

com.google.android.exoplayer2.source.dash.manifest.DashManifest

com.castlabs.media3.exoplayer.dash.manifest.DashManifest

com.google.android.exoplayer2.source.dash.manifest.DashManifestParser

com.castlabs.media3.exoplayer.dash.manifest.DashManifestParser

com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.PeriodUrlInfo

com.castlabs.media3.exoplayer.dash.manifest.DashManifestParser.PeriodUrlInfo

com.google.android.exoplayer2.source.dash.manifest.InternalSourceSelector.Factory

com.castlabs.media3.exoplayer.dash.manifest.InternalSourceSelector.Factory

com.google.android.exoplayer2.source.dash.manifest.RangedUri

com.castlabs.media3.exoplayer.dash.manifest.RangedUri

com.google.android.exoplayer2.source.dash.manifest.Representation.MultiSegmentRepresentation

com.castlabs.media3.exoplayer.dash.manifest.Representation.MultiSegmentRepresentation

com.google.android.exoplayer2.source.dash.manifest.SegmentBase

com.castlabs.media3.exoplayer.dash.manifest.SegmentBase

com.google.android.exoplayer2.source.dash.manifest.SegmentBase.SegmentTemplate

com.castlabs.media3.exoplayer.dash.manifest.SegmentBase.SegmentTemplate

com.google.android.exoplayer2.source.dash.manifest.SegmentBase.SegmentTimelineElement

com.castlabs.media3.exoplayer.dash.manifest.SegmentBase.SegmentTimelineElement

com.google.android.exoplayer2.source.dash.manifest.UrlTemplate

com.castlabs.media3.exoplayer.dash.manifest.UrlTemplate

com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest

com.castlabs.media3.exoplayer.smoothstreaming.manifest.SsManifest

com.google.android.exoplayer2.text.SubtitleDecoderException

com.castlabs.media3.extractor.text.SubtitleDecoderException

com.google.android.exoplayer2.text.ttml.TtmlDecoder

com.castlabs.media3.extractor.text.ttml.TtmlDecoder

com.google.android.exoplayer2.text.ttml.TtmlDecoder.FrameAndTickRate

com.castlabs.media3.extractor.text.ttml.TtmlDecoder.FrameAndTickRate

com.google.android.exoplayer2.trackselection.BaseTrackSelection

com.castlabs.media3.exoplayer.trackselection.BaseTrackSelection

com.google.android.exoplayer2.trackselection.ExoTrackSelection

com.castlabs.media3.exoplayer.trackselection.ExoTrackSelection

com.google.android.exoplayer2.trackselection.ExoTrackSelection.Definition

com.castlabs.media3.exoplayer.trackselection.ExoTrackSelection.Definition

com.google.android.exoplayer2.trackselection.ExoTrackSelection.Factory

com.castlabs.media3.exoplayer.trackselection.ExoTrackSelection.Factory

com.google.android.exoplayer2.trackselection.TrackSelector

com.castlabs.media3.exoplayer.trackselection.TrackSelector

com.google.android.exoplayer2.trackselection.TrackSelectorResult

com.castlabs.media3.exoplayer.trackselection.TrackSelectorResult

com.google.android.exoplayer2.ui.SubtitleView

com.castlabs.media3.ui.SubtitleView

com.google.android.exoplayer2.upstream.Allocator

com.castlabs.media3.exoplayer.upstream.Allocator

com.google.android.exoplayer2.upstream.BandwidthMeter

com.castlabs.media3.exoplayer.upstream.BandwidthMeter

com.google.android.exoplayer2.upstream.BandwidthMeter.EventListener

com.castlabs.media3.exoplayer.upstream.BandwidthMeter.EventListener

com.google.android.exoplayer2.upstream.CmcdConfiguration

com.castlabs.media3.exoplayer.upstream.CmcdConfiguration

com.google.android.exoplayer2.upstream.DataSource

com.castlabs.media3.datasource.DataSource

com.google.android.exoplayer2.upstream.DataSource.Factory

com.castlabs.media3.datasource.DataSource.Factory

com.google.android.exoplayer2.upstream.DataSpec

com.castlabs.media3.datasource.DataSpec

com.google.android.exoplayer2.upstream.HttpDataSource

com.castlabs.media3.datasource.HttpDataSource

com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException

com.castlabs.media3.datasource.HttpDataSource.HttpDataSourceException

com.google.android.exoplayer2.upstream.HttpDataSource.InvalidResponseCodeException

com.castlabs.media3.datasource.HttpDataSource.InvalidResponseCodeException

com.google.android.exoplayer2.upstream.HttpDataSource.RequestProperties

com.castlabs.media3.datasource.HttpDataSource.RequestProperties

com.google.android.exoplayer2.upstream.HttpRedirectListener

com.castlabs.media3.datasource.HttpRedirectListener

com.google.android.exoplayer2.upstream.RetryCounter

com.castlabs.media3.exoplayer.upstream.RetryCounter

com.google.android.exoplayer2.upstream.TransferListener

com.castlabs.media3.datasource.TransferListener

com.google.android.exoplayer2.util.Clock

com.castlabs.media3.common.util.Clock

com.google.android.exoplayer2.video.DecoderVideoRenderer

com.castlabs.media3.exoplayer.video.DecoderVideoRenderer

com.google.android.exoplayer2.video.MediaCodecVideoRenderer

com.castlabs.media3.exoplayer.video.MediaCodecVideoRenderer

com.google.android.exoplayer2.video.MediaCodecVideoRenderer.CodecMaxValues

com.castlabs.media3.exoplayer.video.MediaCodecVideoRenderer.CodecMaxValues

com.google.android.exoplayer2.video.VideoRendererEventListener

com.castlabs.media3.exoplayer.video.VideoRendererEventListener

com.google.android.exoplayer2.video.VideoSize

com.castlabs.media3.common.VideoSize

Changes in 4.2.4

Note

The OMA plugin has been deprecated and is no longer supported in the SDK as of this release.

This release adds support for 64bit native code to all plugins. That means you no longer need to split APKs when you are using 64bit native libraries.

Changes in 4.2

The transition from version 4.1 to version 4.2 of the PRESTOplay SDK for Android involves some breaking API changes. We will highlight the changes here and describe the required changes that you might need to apply in your Application to upgrade to version 4.2.

StreamingEventListener

The StreamingEventListener was used in version 4.1 to receive events about downloads triggered by the player library. In order to provide more information on these callbacks, we decided to change the method signatures slightly. Please check the API documentation for the StreamingEventListener interface and update your implementations accordingly. All information is still present, but we are exposing the underlying DataSpec as well, which allows you, for instance, to access the target URI of a given request.

Besides the changed order and the new parameter, the only parameter that was removed from the signature was the length. Please use the dataSpec.length property instead.

AbstractStreamEventListener

The AbstractStreamEventListener is removed and AbstractStreamingEventListener shall be used instead.

Downloader

Header and query parameters

The DownloadServiceBinder.getDataSourceFactory() is no longer public and when providing the downloader with the additional header and query parameters, the SdkConsts.INTENT_HEADER_PARAMS_BUNDLE and SdkConsts.INTENT_QUERY_PARAMS_BUNDLE shall be used as keys in the Bundle passed to DownloadServiceBinder.prepareDownload(android.content.Context, android.os.Bundle, com.castlabs.sdk.downloader.Downloader$ModelReadyCallback).

Download size

The Download#getTotalSize() is replaced with Download.getEstimatedSize()

DRM

The Builder.Builder(java.lang.String, java.lang.String, java.lang.String, java.lang.String) should now be created with explicitly set assetId.

KeyStore

The KeyStore interface got promoted to an abstract class in 4.2. This is because some functionality was required to be implemented at this level, and shared across all KeyStore implementations.

The main motivation for this change was to perform serialization of the stored data before and after storing and reading the data.

In order to make transition easier we renamed the old interface methods, and expect the same behaviour from them. These correspond to the *internal named methods.

In addition new methods have been added; getAll, delete, deleteAll and getCount.

KeyStore in PlayerController

The setKeyStore method in the PlayerController has been removed. The static DEFAULT_KEY_STORE field in the PlayerSDK class should be used from now on.

Ads & IMA plugin

The IMA plugin is now based on the Exo Player’s ads interfaces and IMA extension. The change brings mainly performance benefits as all the ads are now played using the same PlayerView and Exo Player’s instance. The following client-facing ads interfaces have being updated as well:

  • AdSessionProvider is renamed to AdProvider and defines interface to create AdLoader. The implementation of this interface can be used for custom-based ads provider implementations.

  • AdController is removed and its APIs became part of AdInterface and AdClientInterface accessible via PlayerController

  • SdkConsts.INTENT_WAIT_FOR_ADS_TO_LOAD was removed

SubtitlesViewComponent

The SubtitlesViewComponent getView() is deprecated and componentView() should be used instead.

StreamingEventListener

Format

The onVideoFormatChange() and onAudioFormatChange() methods have been moved out of the StreamingEventListener interface to the new FormatChangeListener interface.

If you were using any of those methods, you should implement FormatChangeListener. Then you can add and remove the listener to the PlayerController with the addFormatChangeListener() and removeFormatChangeListener() methods respectively.

onLoadError

This new method will receive load error events. Note that retries will also be notified through this callback. Fatal load errors will still by reported by the PlayerListener, but now it won’t receive Warning retry calls anymore.

Retries

Now all the methods in the StreamingEventListener contain two extra params: currentAttempt and maxAttempts. You can use these params for instance in the error callback to check for a fatal error, or to know how many retries were required for successful loading.

Image loader

The following methods are deprecated:

Playback configuration

The following playback configuration options are deprecated:
Next topic: Licensing
Previous topic: Kotlin Extensions