- Core Library:
- Move
Player
components toExoPlayer
. For examplePlayer.VideoComponent
is nowExoPlayer.VideoComponent
. - The most used methods of
Player
's audio, video, text and metadata components have been added directly toPlayer
. - Add
Player.getAvailableCommands
,Player.isCommandAvailable
andListener.onAvailableCommandsChanged
to query which commands that can be executed on the player. - Add a
Player.Listener
interface to receive all player events. Component listeners andEventListener
have been deprecated. - Add
Player.getMediaMetadata
, which returns a combined and structuredMediaMetadata
object. Changes to metadata are reported toListener.onMediaMetadataChanged
. Player.setPlaybackParameters
no longer accepts null, usePlaybackParameters.DEFAULT
instead.- Report information about the old and the new playback positions to
Listener.onPositionDiscontinuity
. AddDISCONTINUITY_REASON_SKIP
andDISCONTINUITY_REASON_REMOVE
as discontinuity reasons, and renameDISCONTINUITY_REASON_PERIOD_TRANSITION
toDISCONTINUITY_REASON_AUTO_TRANSITION
. RemoveDISCONTINUITY_REASON_AD_INSERTION
, for whichDISCONTINUITY_REASON_AUTO_TRANSITION
is used instead (#6163, #4768). - Deprecate
ExoPlayer.Builder
. UseSimpleExoPlayer.Builder
instead. - Move
Player.getRendererCount
andPlayer.getRendererType
toExoPlayer
. - Use an empty string instead of the URI if the media ID is not explicitly set with
MediaItem.Builder.setMediaId(String)
. - Remove
MediaCodecRenderer.configureCodec()
and addMediaCodecRenderer.getMediaCodecConfiguration()
. The new method is called just before theMediaCodec
is created and returns the parameters needed to create and configure theMediaCodec
instance. Applications can overrideMediaCodecRenderer.onCodecInitialized()
to be notified after aMediaCodec
is initialized, or they can inject a customMediaCodecAdapter.Factory
if they want to control how theMediaCodec
is configured. - Promote
AdaptiveTrackSelection.AdaptationCheckpoint
topublic
visibility to allow Kotlin subclasses ofAdaptiveTrackSelection.Factory
(#8830). - Fix bug when transitions from content to ad periods called
onMediaItemTransition
by mistake. AdsLoader.AdViewProvider
andAdsLoader.OverlayInfo
have been renamedcom.google.android.exoplayer2.ui.AdViewProvider
andcom.google.android.exoplayer2.ui.AdOverlayInfo
respectively.CaptionStyleCompat
has been moved to thecom.google.android.exoplayer2.ui
package.DebugTextViewHelper
has been moved from theui
package to theutil
package.
- Move
- RTSP:
- Initial support for RTSP playbacks (#55).
- Downloads and caching:
- Fix
CacheWriter
to correctly handle cases where the requestDataSpec
extends beyond the end of the underlying resource. Caching will now succeed in this case, with data up to the end of the resource being cached. This behaviour is enabled by default, and so theallowShortContent
parameter has been removed (#7326). - Fix
CacheWriter
to correctly handleDataSource.close
failures, for which it cannot be assumed that data was successfully written to the cache.
- Fix
- DRM:
- Prepare DRM sessions (and fetch keys) ahead of the playback position (#4133).
- Only dispatch DRM session acquire and release events once per period when playing content that uses the same encryption keys for both audio & video tracks. Previously, separate acquire and release events were dispatched for each track in each period.
- Include the session state in DRM session-acquired listener methods.
- UI:
- Add
PlayerNotificationManager.Builder
, with the ability to specify which group the notification should belong to. - Remove
setUseSensorRotation
fromPlayerView
andStyledPlayerView
. Instead, cast the view returned bygetVideoSurfaceView
toSphericalGLSurfaceView
, and then callsetUseSensorRotation
on theSphericalGLSurfaceView
directly.
- Add
- Analytics:
- Add
onAudioCodecError
andonVideoCodecError
toAnalyticsListener
.
- Add
- Video:
- Add
Player.getVideoSize()
to retrieve the current size of the video stream. AddListener.onVideoSizeChanged(VideoSize)
and deprecateListener.onVideoSizeChanged(int, int, int, float)
.
- Add
- Audio:
- Report unexpected audio discontinuities to
AnalyticsListener.onAudioSinkError
(#6384). - Allow forcing offload for gapless content even if gapless playback is not supported.
- Allow fall back from DTS-HD to DTS when playing via passthrough.
- Report unexpected audio discontinuities to
- Text:
- Fix overlapping lines when using
SubtitleView.VIEW_TYPE_WEB
. - Parse SSA/ASS underline & strikethrough info in
Style:
lines (#8435). - Ensure TTML
tts:textAlign
is correctly propagated from<p>
nodes to child nodes. - Support TTML
ebutts:multiRowAlign
attributes.
- Fix overlapping lines when using
- Allow the use of Android platform extractors through MediaParser:
- Supported on API 30+:
- You can use platform extractors for progressive media by passing
MediaParserExtractorAdapter.FACTORY
when creating aProgressiveMediaSource.Factory
. - You can use platform extractors for HLS by passing
MediaParserHlsMediaChunkExtractor.FACTORY
when creating aHlsMediaSource.Factory
. - You can use platform extractors for DASH by passing a
DefaultDashChunkSource
that usesMediaParserChunkExtractor.FACTORY
when creating aDashMediaSource.Factory
.
- Cast extension:
- Trigger
onMediaItemTransition
event for all reasons exceptMEDIA_ITEM_TRANSITION_REASON_REPEAT
.
- Trigger
- MediaSession extension:
- Remove dependency on
exoplayer-core
, relying onlyexoplayer-common
instead. To achieve this,TimelineQueueEditor
uses a newMediaDescriptionConverter
interface, and no longer relies onConcatenatingMediaSource
.
- Remove dependency on
- Remove deprecated symbols:
- Remove
ExoPlayerFactory
. UseSimpleExoPlayer.Builder
instead. - Remove
Player.DefaultEventListener
. UsePlayer.Listener
instead. - Remove
ExtractorMediaSource
. UseProgressiveMediaSource
instead. - Remove
DefaultMediaSourceEventListener
. UseMediaSourceEventListener
instead. - Remove
DashManifest
constructor. Use the remaining constructor withprogramInformation
andserviceDescription
set tonull
instead. - Remove
CryptoInfo.getFrameworkCryptoInfoV16
. UseCryptoInfo.getFrameworkCryptoInfo
instead. - Remove
NotificationUtil.createNotificationChannel(Context, String, int, int)
. UsecreateNotificationChannel(Context, String, int, int, int)
instead. - Remove
PlayerNotificationManager.setNotificationListener
. UsePlayerNotificationManager.Builder.setNotificationListener
instead. - Remove
PlayerNotificationManager.NotificationListener
onNotificationStarted(int, Notification)
andonNotificationCancelled(int)
. UseonNotificationPosted(int, Notification, boolean)
andonNotificationCancelled(int, boolean)
instead. - Remove
DownloadNotificationUtil
. UseDownloadNotificationHelper
instead. - Remove
extension-jobdispatcher
module. Use theextension-workmanager
module instead.
- Remove