Releases: androidx/media
Releases · androidx/media
1.6.0
This release includes the following changes since the
1.5.1 release:
- Common Library:
- Add
AudioManagerCompatandAudioFocusRequestCompatto replace the equivalent classes inandroidx.media. - Upgrade Kotlin from 1.9.20 to 2.0.20 and use Compose Compiler Gradle plugin. Upgrade KotlinX Coroutines library from 1.8.1 to 1.9.0.
- Remove
Format.toBundle(boolean excludeMetadata)method, useFormat.toBundle()instead. - Fix bug in
SimpleBasePlayerwhere setting a newcurrentMediaItemIndexinStateaftersetPlaylistwithnullMediaMetadatadoes not reevaluate the metadata (#1940). - Change
SimpleBasePlayer.Stateaccess from protected to public to make it easier to handle updates in other classes(#2128).
- Add
- ExoPlayer:
- Add
MediaExtractorCompat, a new class that provides equivalent features to platformMediaExtractor. - Add experimental 'ExoPlayer' pre-warming support for playback using
MediaCodecVideoRenderer. You can configureDefaultRenderersFactorythroughexperimentalSetEnableMediaCodecVideoRendererPrewarmingto provide a secondaryMediaCodecVideoRenderertoExoPlayer. If enabled,ExoPlayerpre-processes the video of consecutive media items during playback to reduce media item transition latency. - Reduce default values for
bufferForPlaybackMsandbufferForPlaybackAfterRebufferMsinDefaultLoadControlto 1000 and 2000 ms respectively. - Initialize
DeviceInfoand device volume asynchronously (if enabled usingsetDeviceVolumeControlEnabled). These values aren't available instantly afterExoPlayer.Builder.build(), andPlayer.Listenernotifies changes throughonDeviceInfoChangedandonDeviceVolumeChanged. - Initial audio session id is no longer immediately available after creating the player. You can use
AnalyticsListener.onAudioSessionIdChangedto listen to the initial update if required. - Consider language when selecting a video track. By default, select a 'main' video track that matches the language of the selected audio track, if available. Explicit video language preferences can be expressed with
TrackSelectionParameters.Builder.setPreferredVideoLanguage(s). - Add
selectedAudioLanguageparameter toDefaultTrackSelector.selectVideoTrack()method. - Add
retryCountparameter toMediaSourceEventListener.onLoadStartedand correspondingMediaSourceEventListener.EventDispatchermethods. - Fix bug where playlist items or periods in multi-period DASH streams with durations that don't match the actual content could cause frame freezes at the end of the item (#1698).
- Move
BasePreloadManager.Listenerto a top-levelPreloadManagerListener. RenderersFactory.createSecondaryRenderercan be implemented to provide secondary renderers for pre-warming. Pre-warming enables quicker media item transitions during playback.- Enable sending
CmcdDatafor manifest requests in adaptive streaming formats DASH, HLS, and SmoothStreaming (#1951). - Provide
MediaCodecInfoof the codec that will be initialized inMediaCodecRenderer.onReadyToInitializeCodec(#1963). - Change
AdsMediaSourceto allow theAdPlaybackStatesto grow by appending ad groups. Invalid modifications are detected and throw an exception. - Fix issue where additional decode-only frames may be displayed in quick succession when transitioning to content media after a mid-roll ad.
- Make
DefaultRenderersFactoryadd twoMetadataRendererinstances to enable apps to receive two different schemes of metadata by default. - Reevaluate whether the ongoing load of a chunk should be cancelled when playback is paused (#1785).
- Add option to
ClippingMediaSourceto allow clipping in unseekable media. - Fix bug where seeking with pre-warming could block following media item transition.
- Fix a bug where
ExoPlayer.isLoading()remainstruewhile it has transitioned toSTATE_IDLEorSTATE_ENDED(#2133). - Add
lastRebufferRealtimeMstoLoadControl.Parameter(#2113).
- Add
- Transformer:
- Add support for transmuxing into alternative backward compatible formats.
- Add support for transcoding and transmuxing Dolby Vision (profile 8) format.
- Update parameters of
VideoFrameProcessor.registerInputStreamandVideoFrameProcessor.Listener.onInputStreamRegisteredto useFormat. - Generate HDR static metadata when using
DefaultEncoderFactory. - Enable support for Android platform diagnostics using
MediaMetricsManager. Transformer forwards editing events and performance data to the platform, which helps to provide system performance and debugging information on the device. This data may also be collected by Google if sharing usage and diagnostics data is enabled by the user of the device. Apps can opt-out of contributing to platform diagnostics for Transformer withTransformer.Builder.setUsePlatformDiagnostics(false). - Split
InAppMuxerintoInAppMp4MuxerandInAppFragmentedMp4Muxer. You useInAppMp4Muxerto produce a non-fragmented MP4 file, whileInAppFragmentedMp4Muxeris for producing a fragmented MP4 file. - Move
Muxerinterface frommedia3-muxertomedia3-transformer. - Add
MediaProjectionAssetLoader, which provides media from aMediaProjectionfor screen recording, and add support for screen recording to the Transformer demo app. - Add
#getInputFormat()toCodecinterface. - Shift the responsibility to release the
GlObjectsProvideronto the caller inDefaultVideoFrameProcessorandDefaultVideoCompositorwhen possible.
- Extractors:
- AVI: Fix handling of files with constant bitrate compressed audio where the stream header stores the number of bytes instead of the number of chunks.
- Fix handling of NAL units with lengths expressed in 1 or 2 bytes (rather than 4).
- Fix
ArrayIndexOutOfBoundsExceptionin MP4 edit lists when the edit list starts at a non-sync frame with no preceding sync frame (#2062). - Fix issue where TS streams can get stuck on some devices (#2069).
- FLAC: Add support for 32-bit FLAC files. Previously these would fail to play with
IllegalStateException: Playback stuck buffering and not loading(#2197).
- Audio:
- Fix
onAudioPositionAdvancingto be called when playback resumes (previously it was called when playback was paused). - Don't bypass
SonicAudioProcessorwhenSpeedChangingAudioProcessoris configured with default parameters. - Fix underflow in
Sonic#getOutputSize()that could causeDefaultAudioSinkto stall. - Fix
MediaCodecAudioRenderer.getDurationToProgressUs()andDecoderAudioRenderer.getDurationToProgressUs()so that seeks correctly reset the provided durations. - Make
androidx.media3.common.audio.SonicAudioProcessorfinal. - Add support for float PCM to
ChannelMappingAudioProcessorandTrimmingAudioProcessor.
- Fix
- Video:
- Change
MediaCodecVideoRenderer.shouldUsePlaceholderSurfaceto protected so that applications can override to block usage of placeholder surfaces (#1905). - Add experimental
ExoPlayerAV1 sample dependency parsing to speed up seeking. Enable it with the newDefaultRenderersFactory.experimentalSetParseAv1SampleDependenciesAPI. - Add experimental
ExoPlayerAPI to drop lateMediaCodecVideoRendererdecoder input buffers that are not depended on. Enable it withDefaultRenderersFactory.experimentalSetLateThresholdToDropDecoderInputUs. - Fix issue where a player without a surface was ready immediately and very slow decoding any pending frames (#1973).
- Exclude Xiaomi and OPPO devices from detached surface mode to avoid screen flickering (#2059).
- Change
- Text:
- Add support for VobSub subtitles (#8260).
- Stop eagerly loading all subtitle files configured with
MediaItem.Builder.setSubtitleConfigurations, and instead only load one if it is selected by track selection (#1721). - TTML: Add support for referencing
tts:originandtts:extentusingstyle(#2953). - Restrict WebVTT and SubRip timestamps to exactly 3 decimal places. Previously we incorrectly parsed any number of decimal places but always assumed the value was in milliseconds, leading to incorrect timestamp (#1997).
- Fix playback hanging when a playlist contains clipped items with CEA-608 or CEA-708 captions.
- Fix
IllegalStateExceptionwhen an SSA file contains a cue with zero duration (...
1.6.0-rc02
This release includes the following changes since 1.6.0-rc01 release:
- Extractors:
- FLAC: Add support for 32-bit FLAC files. Previously these would fail to play with
IllegalStateException: Playback stuck buffering and not loading(#2197).
- FLAC: Add support for 32-bit FLAC files. Previously these would fail to play with
- Audio:
- Add support for float PCM to
ChannelMappingAudioProcessor. - Add support for float PCM to
TrimmingAudioProcessor.
- Add support for float PCM to
- Video:
- Session:
- Fix bug where a stale notification stays visible when the playlist is cleared (#2211).
- UI:
- Add
PlaybackSpeedStateclass and the correspondingrememberPlaybackSpeedStateComposable tomedia3-ui-composemodule.
- Add
- DASH extension:
- Fix issue where adaptation sets marked with
adaptation-set-switchingbut different languages or role flags are merged together (#2222).
- Fix issue where adaptation sets marked with
- HLS extension:
- Loosen the condition for seeking to sync positions in an HLS stream (#2209).
1.6.0-rc01
- Common Library:
- Change
SimpleBasePlayer.Stateaccess from protected to public to make it easier to handle updates in other classes (#2128).
- Change
- ExoPlayer:
- Extractors:
- Fix issue where TS streams can get stuck on some devices (#2069).
- Text:
- Fix handling of multi-byte UTF-8 characters in WebVTT files using CR line endings (#2167).
- DRM:
- Fix
MediaCodec$CryptoException: Operation not supported in this configurationerror when playing ClearKey content on API < 27 devices (#1732).
- Fix
- Muxers:
- Fix a bug in
FragmentedMp4Muxerthat creates a lot of fragments when only audio track is written.
- Fix a bug in
- Downloads:
- Fix bug in
CacheWriterthat leaves data sources open and cache areas locked in case the data source throws anExceptionother thanIOException(#9760).
- Fix bug in
- MIDI extension:
- Plumb custom
AudioSinkandAudioRendererEventListenerinstances intoMidiRenderer.
- Plumb custom
- Cast extension:
- Bump the
play-services-cast-frameworkdependency to 21.5.0 to fix aFLAG_MUTABLEcrash in apps targeting API 34+ on devices with Google Play services installed but disabled (#2178).
- Bump the
1.6.0-beta01
- Common Library:
- Upgrade Kotlin from 1.9.20 to 2.0.20 and use Compose Compiler Gradle
plugin. Upgrade KotlinX Coroutines library from 1.8.1 to 1.9.0.
- Upgrade Kotlin from 1.9.20 to 2.0.20 and use Compose Compiler Gradle
- ExoPlayer:
- Initial audio session id is no longer immediately available after
creating the player. You can use
AnalyticsListener.onAudioSessionIdChangedto listen to the initial
update if required.
- Initial audio session id is no longer immediately available after
- Transformer:
- Add
MediaProjectionAssetLoader, which provides media from a
MediaProjectionfor screen recording, and add support for screen
recording to the Transformer demo app. - Add
#getInputFormat()toCodecinterface. - Shift the responsibility to release the
GlObjectsProvideronto the
caller inDefaultVideoFrameProcessorandDefaultVideoCompositorwhen
possible.
- Add
- Video:
- Add experimental
ExoPlayerAPI to drop lateMediaCodecVideoRenderer
decoder input buffers that are not depended on. Enable it with
DefaultRenderersFactory.experimentalSetLateThresholdToDropDecoderInputUs.
- Add experimental
- Session:
- Keep foreground service state for an additional 10 minutes when playback
pauses, stops or fails. This allows users to resume playback within this
timeout without risking foreground service restrictions on various
devices. Note that simply callingplayer.pause()can no longer be used
to stop the foreground service beforestopSelf()when overriding
onTaskRemoved, useMediaSessionService.pauseAllPlayersAndStopSelf()
instead. - Make
MediaSession.setSessionActivity(PendingIntent)accept null
(#2109). - Keep notification visible when playback enters an error or stopped
state. The notification is only removed if the playlist is cleared or
the player is released. - Improve handling of Android platform MediaSession actions ACTION_PLAY
and ACTION_PAUSE to only set one of them according to the available
commands and also accept if only one of them is set.
- Keep foreground service state for an additional 10 minutes when playback
- Remove deprecated symbols:
- Removed the following deprecated
DownloadHelpermethods:- Constructor
DownloadHelper(MediaItem, @Nullable MediaSource, TrackSelectionParameters, RendererCapabilities[]), use
DownloadHelper(MediaItem, @Nullable MediaSource, TrackSelectionParameters, RendererCapabilitiesList)instead. getRendererCapabilities(RenderersFactory), equivalent
functionality can be achieved by creating a
DefaultRendererCapabilitiesListwith aRenderersFactory, and
callingDefaultRendererCapabilitiesList.getRendererCapabilities().
- Constructor
- Removed
PlayerNotificationManager.setMediaSessionToken(MediaSessionCompat)
method. Use
PlayerNotificationManager.setMediaSessionToken(MediaSession.Token)and
pass in(MediaSession.Token) compatToken.getToken()instead.
- Removed the following deprecated
1.6.0-alpha03
- ExoPlayer:
- Add option to
ClippingMediaSourceto allow clipping in unseekable media. - Fix bug where seeking with pre-warming could block following media item transition.
- Add option to
- Audio:
- Make
androidx.media3.common.audio.SonicAudioProcessorfinal.
- Make
- Video:
- Change
MediaCodecVideoRenderer.shouldUsePlaceholderSurfaceto protected so that applications can override to block usage of placeholder surfaces (#1905). - Add experimental
ExoPlayerAV1 sample dependency parsing to speed up seeking. Enable it with the newDefaultRenderersFactory.experimentalSetParseAv1SampleDependenciesAPI.
- Change
- Muxers:
- Disable
Mp4Muxersample batching and copying by default.
- Disable
- Remove deprecated symbols:
- Removed
androidx.media3.exoplayer.audio.SonicAudioProcessor.
- Removed
1.6.0-alpha02
- Common Library:
- Fix bug in
SimpleBasePlayerwhere setting a newcurrentMediaItemIndexinStateaftersetPlaylistwithnullMediaMetadatadoes not reevaluate the metadata (#1940).
- Fix bug in
- ExoPlayer:
- Add experimental 'ExoPlayer' pre-warming support for playback using
MediaCodecVideoRenderer. You can configureDefaultRenderersFactorythroughexperimentalSetEnableMediaCodecVideoRendererPrewarmingto provide a secondaryMediaCodecVideoRenderertoExoPlayer. If enabled,ExoPlayerpre-processes the video of consecutive media items during playback to reduce media item transition latency. - Fix issue where additional decode-only frames may be displayed in quick succession when transitioning to content media after a mid-roll ad.
- Make
DefaultRenderersFactoryadd twoMetadataRendererinstances to enable apps to receive two different schemes of metadata by default. - Initialize
DeviceInfoand device volume asynchronously (if enabled usingsetDeviceVolumeControlEnabled). These values aren't available instantly afterExoPlayer.Builder.build(), andPlayer.Listenernotifies changes throughonDeviceInfoChangedandonDeviceVolumeChanged. - Reevaluate whether the ongoing load of a chunk should be cancelled when playback is paused (#1785).
- Add experimental 'ExoPlayer' pre-warming support for playback using
- Transformer:
- Enable support for Android platform diagnostics using
MediaMetricsManager. Transformer forwards editing events and performance data to the platform, which helps to provide system performance and debugging information on the device. This data may also be collected by Google if sharing usage and diagnostics data is enabled by the user of the device. Apps can opt-out of contributing to platform diagnostics for Transformer withTransformer.Builder.setUsePlatformDiagnostics(false). - Split
InAppMuxerintoInAppMp4MuxerandInAppFragmentedMp4Muxer. You useInAppMp4Muxerto produce a non-fragmented MP4 file, whileInAppFragmentedMp4Muxeris for producing a fragmented MP4 file. - Move
Muxerinterface frommedia3-muxertomedia3-transformer. - Add support for transcoding and transmuxing Dolby Vision (profile 8) format.
- Enable support for Android platform diagnostics using
- Extractors:
- Fix handling of NAL units with lengths expressed in 1 or 2 bytes (rather than 4).
- Fix
ArrayIndexOutOfBoundsExceptionin MP4 edit lists when the edit list starts at a non-sync frame with no preceding sync frame (#2062).
- Audio:
- Don't bypass
SonicAudioProcessorwhenSpeedChangingAudioProcessoris configured with default parameters. - Fix underflow in
Sonic#getOutputSize()that could causeDefaultAudioSinkto stall. - Fix
MediaCodecAudioRenderer.getDurationToProgressUs()andDecoderAudioRenderer.getDurationToProgressUs()so that seeks correctly reset the provided durations.
- Don't bypass
- Text:
- TTML: Add support for referencing
tts:originandtts:extentusingstyle(#2953). - Restrict WebVTT and SubRip timestamps to exactly 3 decimal places. Previously we incorrectly parsed any number of decimal places but always assumed the value was in milliseconds, leading to incorrect timestamps (#1997).
- Add support for VobSub subtitles (#8260).
- Fix playback hanging when a playlist contains clipped items with CEA-608 or CEA-708 captions.
- Fix
IllegalStateExceptionwhen an SSA file contains a cue with zero duration (start and end time equal) (#2052). - Suppress (and log) subtitle parsing errors when subtitles are muxed into the same container as audio and video (#2052).
- TTML: Add support for referencing
- Muxers:
- Renamed
setSampleCopyEnabled()method tosetSampleCopyingEnabled()in bothMp4Muxer.BuilderandFragmentedMp4Muxer.Builder. Mp4Muxer.addTrack()andFragmentedMp4Muxer.addTrack()now return aninttrack ID instead of aTrackToken.Mp4MuxerandFragmentedMp4Muxerno longer implementMuxerinterface.
- Renamed
- Session:
- Fix bug where calling a
Playermethod on aMediaControllerconnected to a legacy session dropped changes from a pending update.
- Fix bug where calling a
- UI:
- Add
PresentationStatestate holder class and the correspondingrememberPresentationStateComposable tomedia3-ui-compose.
- Add
- HLS Extension:
- Parse
SUPPLEMENTAL-CODECStag from HLS playlist to detect Dolby Vision formats (#1785).
- Parse
- DASH Extension:
- Fix issue when calculating the update interval for ad insertion in multi-period live streams (#1698).
- Parse
scte214:supplementalCodecsattribute from DASH manifest to detect Dolby Vision formats (#1785). - Improve handling of period transitions in live streams where the period contains media samples beyond the declared period duration (#1698).
- Demo app:
- Use
PresentationStateto control the aspect ratio ofPlayerSurfaceComposable. This depends on the ContentScale type and covers it with a shutter-overlay before the first frame is rendered.
- Use
- Remove deprecated symbols:
- Removed
ExoPlayer.VideoComponent,ExoPlayer.AudioComponent,ExoPlayer.TextComponentandExoPlayer.DeviceComponent.
- Removed
1.6.0-alpha01
This release includes the following changes since the 1.5.1 release:
- Common Library:
- Remove
Format.toBundle(boolean excludeMetadata)method, useFormat.toBundle()instead. - Add
AudioManagerCompatandAudioFocusRequestCompatto replace the equivalent classes inandroidx.media.
- Remove
- ExoPlayer:
- Consider language when selecting a video track. By default select a 'main' video track that matches the language of the selected audio track, if available. Explicit video language preferences can be expressed with
TrackSelectionParameters.Builder.setPreferredVideoLanguage(s). - Add
selectedAudioLanguageparameter toDefaultTrackSelector.selectVideoTrack()method. - Add
retryCountparameter toMediaSourceEventListener.onLoadStartedand correspondingMediaSourceEventListener.EventDispatchermethods. - Fix bug where playlist items or periods in multi-period DASH streams with durations that don't match the actual content could cause frame freezes at the end of the item (#1698).
- Reduce default values for
bufferForPlaybackMsandbufferForPlaybackAfterRebufferMsinDefaultLoadControlto 1000 and 2000 ms respectively. - Add
MediaExtractorCompat, a new class that provides equivalent functionality to platformMediaExtractor. - Move
BasePreloadManager.Listenerto a top levelPreloadManagerListener. RenderersFactory.createSecondaryRenderercan be implemented to provide secondary renderers for pre-warming. Pre-warming enables quicker media item transitions during playback.- Enable sending
CmcdDatafor manifest requests in adaptive streaming formats DASH, HLS, and SmoothStreaming (#1951). - Provide
MediaCodecInfoof the codec that will be initialized inMediaCodecRenderer.onReadyToInitializeCodec(#1963). - Change
AdsMediaSourceto allow theAdPlaybackStatesto grow by appending ad groups. Invalid modifications are detected and throw an exception.
- Consider language when selecting a video track. By default select a 'main' video track that matches the language of the selected audio track, if available. Explicit video language preferences can be expressed with
- Transformer:
- Update parameters of
VideoFrameProcessor.registerInputStreamandVideoFrameProcessor.Listener.onInputStreamRegisteredto useFormat. - Add support for transmuxing into alternative backwards compatible formats.
- Generate HDR static metadata when using
DefaultEncoderFactory.
- Update parameters of
- Extractors:
- AVI: Fix handling of files with constant bitrate compressed audio where the stream header stores the number of bytes instead of the number of chunks.
- Audio:
- Fix
onAudioPositionAdvancingto be called when playback resumes (previously it was called when playback was paused).
- Fix
- Video:
- Fix
MediaCodecVideoRenderersuch that when without aSurface, the renderer will skip just-early frames only if theVideoFrameReleaseControl.getFrameReleaseActionis notFRAME_RELEASE_TRY_AGAIN_LATER.
- Fix
- Text:
- Stop eagerly loading all subtitle files configured with
MediaItem.Builder.setSubtitleConfigurations, and instead only load one if it is selected by track selection (#1721).
- Stop eagerly loading all subtitle files configured with
- Effect:
- Moved the functionality of
OverlaySettingsintoStaticOverlaySettings.OverlaySettingscan be subclassed to allow dynamic overlay settings.
- Moved the functionality of
- Muxers:
- Moved
MuxerExceptionout ofMuxerinterface to avoid a very long fully qualified name.
- Moved
- Session:
- Add
Contextas a parameter toMediaButtonReceiver.shouldStartForegroundService(#1887).
- Add
- UI:
- Add
PlayerSurfaceComposable tomedia3-ui-composemodule. - Add
PlayPauseButtonState,NextButtonState,PreviousButtonState,RepeatButtonState,ShuffleButtonStateclasses and the correspondingrememberPlayPauseButtonState,rememberNextButtonState,rememberPreviousButtonState,rememberRepeatButtonState,rememberShuffleButtonStateComposables tomedia3-ui-composemodule.
- Add
- HLS Extension:
- Add a first version of
HlsInterstitialsAdsLoader. The ads loader reads the HLS interstitials of an HLS media playlist and maps them to theAdPlaybackStatethat is passed to theAdsMediaSource. This initial version only supports HLS VOD streams withX-ASSET-URIattributes. - Add
HlsInterstitialsAdsLoader.AdsMediaSourceFactory. Apps can use it to createAdsMediaSourceinstances that use anHlsInterstitialsAdsLoaderin a convenient and safe way.
- Add a first version of
- DASH Extension:
- Add AC-4 Level-4 format support for DASH (#1898).
- Decoder Extensions (FFmpeg, VP9, AV1, etc.):
- Add the MPEG-H decoder module which uses the native MPEG-H decoder module to decode MPEG-H audio (#1826).
- Demo app:
- Add
MinimalControls(PlayPauseButton,NextButton,PreviousButton) andExtraControls(RepeatButton,ShuffleButton) Composable UI elements todemo-composeutilizingPlayPauseButtonState,NextButtonState,PreviousButtonState,RepeatButtonState,ShuffleButtonState.
- Add
- Remove deprecated symbols:
- Remove deprecated
AudioMixer.create()method. UseDefaultAudioMixer.Factory().create()instead. - Remove the following deprecated
Transformer.Buildermethods:setTransformationRequest(), usesetAudioMimeType(),setVideoMimeType(), andsetHdrMode()instead.setAudioProcessors(), set the audio processor in anEditedMediaItem.Builder.setEffects(), and pass it toTransformer.start()instead.setVideoEffects(), set video effect in anEditedMediaItem.Builder.setEffects(), and pass it toTransformer.start()instead.setRemoveAudio(), useEditedMediaItem.Builder.setRemoveAudio()to remove the audio from theEditedMediaItempassed toTransformer.start()instead.setRemoveVideo(), useEditedMediaItem.Builder.setRemoveVideo()to remove the video from theEditedMediaItempassed toTransformer.start()instead.setFlattenForSlowMotion(), useEditedMediaItem.Builder.setFlattenForSlowMotion()to flatten theEditedMediaItempassed toTransformer.start()instead.setListener(), useaddListener(),removeListener()orremoveAllListeners()instead.
- Remove the following deprecated
Transformer.Listenermethods:onTransformationCompleted(MediaItem), useonCompleted(Composition, ExportResult)instead.onTransformationCompleted(MediaItem, TransformationResult), useonCompleted(Composition, ExportResult)instead.onTransformationError(MediaItem, Exception), useonError(Composition, ExportResult, ExportException)instead.onTransformationError(MediaItem, TransformationException), useonError(Composition, ExportResult, ExportException)instead.onTransformationError(MediaItem, TransformationResult, TransformationException), useonError(Composition, ExportResult, ExportException)instead.onFallbackApplied(MediaItem, TransformationRequest, TransformationRequest), useonFallbackApplied(Composition, TransformationRequest, TransformationRequest)instead.
- Remove deprecated
TransformationResultclass. UseExportResultinstead. - Remove deprecated
TransformationExceptionclass. UseExportExceptioninstead. - Remove deprecated
Transformer.PROGRESS_STATE_NO_TRANSFORMATION. UseTransformer.PROGRESS_STATE_NOT_STARTEDinstead. - Remove deprecated
Transformer.setListener(). UseTransformer.addListener(),Transformer.removeListener()orTransformer.removeAllListeners()instead. - Remove deprecated
Transformer.startTransformation(). UseTransformer.start(MediaItem, String)instead. - Remove deprecated
SingleFrameGlShaderProgram. UseBaseGlShaderPrograminstead. - Remove
Transformer.flattenForSlowMotion. UseEditedMediaItem.flattenForSlowMotioninstead.
- Remove deprecated
1.5.1
This release includes the following changes since the 1.5.0 release:
- ExoPlayer:
- Disable use of asynchronous decryption in MediaCodec to avoid reported codec timeout issues with this platform API (#1641).
- Extractors:
- MP3: Don't stop playback early when a
VBRIframe's table of contents doesn't cover all the MP3 data in a file (#1904).
- MP3: Don't stop playback early when a
- Video:
- Rollback of using
MediaCodecAdaptersupplied pixel aspect ratio values when provided while processingonOutputFormatChanged(#1371).
- Rollback of using
- Text:
- Fix bug in
ReplacingCuesResolver.discardCuesBeforeTimeUswhere the cue active attimeUs(started before but not yet ended) was incorrectly discarded (#1939).
- Fix bug in
- Metadata:
- Extract disc/track numbering and genre from Vorbis comments into
MediaMetadata(#1958).
- Extract disc/track numbering and genre from Vorbis comments into
1.5.0
This release includes the following changes since the 1.4.1 release:
- Common Library:
- Add
ForwardingSimpleBasePlayerthat allows forwarding to another player with small adjustments while ensuring full consistency and listener handling (#1183). - Replace
SimpleBasePlayer.State.playlistbygetPlaylist()method. - Add override for
SimpleBasePlayer.State.Builder.setPlaylist()to directly specify aTimelineand currentTracksandMetadatainstead of building a playlist structure. - Increase
minSdkto 21 (Android Lollipop). This is aligned with all other AndroidX libraries. - Add
androidx.media3:media3-common-ktxartifact which provides Kotlin-specific functionality built on top of the Common library - Add
Player.listensuspending extension function to spin a coroutine to listen toPlayer.Eventsto themedia3-common-ktxlibrary. - Remove
@DoNotInlineannotations from manually out-of-lined inner classes designed to avoid runtime class verification failures. Recent versions of R8 now automatically out-of-line calls like these to avoid the runtime failures (so the manual out-of-lining is no longer required). All Gradle users of the library must already be a using a version of the Android Gradle Plugin that uses a version of R8 which does this, due tocompileSdk = 35. Users of the library with non-Gradle build systems will need to ensure their R8-equivalent shrinking/obfuscating step does a similar automatic out-of-lining process in order to avoid runtime class verification failures. This change has already been done in other AndroidX libraries.
- Add
- ExoPlayer:
MediaCodecRenderer.onProcessedStreamChange()can now be called for every media item. Previously it was not called for the first one. UseMediaCodecRenderer.experimentalEnableProcessedStreamChangedAtStart()to enable this.- Add
PreloadMediaSource.PreloadControl.onPreloadErrorto allowPreloadMediaSource.PreloadControlimplementations to take actions when error occurs. - Add
BasePreloadManager.Listenerto propagate preload events to apps. - Allow changing SNTP client timeout and retry alternative addresses on timeout (#1540).
- Remove
MediaCodecAdapter.Configuration.flagsas the field was always zero. - Allow the user to select the built-in speaker for playback on Wear OS API 35+ (where the device advertises support for this).
- Defer the blocking call to
Context.getSystemService(Context.AUDIO_SERVICE)until audio focus handling is enabled. This ensures the blocking call isn't done if audio focus handling is not enabled (#1616). - Allow playback regardless of buffered duration when loading fails (#1571).
- Add
AnalyticsListener.onRendererReadyChanged()to signal when individual renderers allow playback to be ready. - Fix
MediaCodec.CryptoExceptionsometimes being reported as an "unexpected runtime error" whenMediaCodecis operated in asynchronous mode (default behaviour on API 31+). - Pass
bufferedDurationUsinstead ofbufferedPositionUswithPreloadMediaSource.PreloadControl.onContinueLoadingRequested(). Also changesDefaultPreloadManager.Status.STAGE_LOADED_TO_POSITION_MStoDefaultPreloadManager.Status.STAGE_LOADED_FOR_DURATION_MS, apps then need to pass a value representing a specific duration from the default start position for which the corresponding media source has to be preloaded with this IntDef, instead of a position. - Add
ForwardingRendererimplementation that forwards all method calls to another renderer (1703). - Add playlist preloading for the next item in the playlist. Apps can enable preloading by calling
ExoPlayer.setPreloadConfiguration(PreloadConfiguration)accordingly. By default preloading is disabled. When opted-in and to not interfere with playback,DefaultLoadControlrestricts preloading to start and continue only when the player is not loading for playback. Apps can change this behaviour by implementingLoadControl.shouldContinuePreloading()accordingly (like when overriding this method inDefaultLoadControl). The default implementation ofLoadControldisables preloading in case an app is using a custom implementation ofLoadControl. - Add method
MediaSourceEventListener.EventDispatcher.dispatchEvent()to allow invoking events of subclass listeners (1736). - Add
DefaultPreloadManager.Builderthat builds theDefaultPreloadManagerandExoPlayerinstances with consistently shared configurations. - Remove
Renderer[]parameter fromLoadControl.onTracksSelected()asDefaultLoadControlimplementation can retrieve the stream types fromExoTrackSelection[]. - Deprecated
DefaultLoadControl.calculateTargetBufferBytes(Renderer[], ExoTrackSelection[])and marked method as final to prevent overrides. The newDefaultLoadControl.calculateTargetBufferBytes(ExoTrackSelection[])should be used instead. - Report
MediaSourceEventListenerevents from secondary sources inMergingMediaSource. This will result in load start/error/cancelled/completed events being reported for sideloaded subtitles (those added withMediaItem.LocalConfiguration.subtitleConfigurations), which may appear as duplicate load events emitted fromAnalyticsListener. - Prevent subtitle & metadata errors from completely stopping playback. Instead the problematic track is disabled and playback of the remaining tracks continues (#1722).
- In new subtitle handling (during extraction), associated parse (e.g. invalid subtitle data) and load errors (e.g. HTTP 404) are emitted via
onLoadErrorcallbacks. - In legacy subtitle handling (during rendering), only associated load errors are emitted via
onLoadErrorcallbacks while parse errors are silently ignored (this is pre-existing behaviour).
- In new subtitle handling (during extraction), associated parse (e.g. invalid subtitle data) and load errors (e.g. HTTP 404) are emitted via
- Fix bug where playlist items or periods in multi-period DASH streams with durations that don't match the actual content could cause frame freezes at the end of the item (#1698).
- Add a setter to
SntpClientto set the max elapsed time since the last update after which the client is re-initialized (#1794).
- Transformer:
- Add
SurfaceAssetLoader, which supports queueing video data to Transformer via aSurface. ImageAssetLoaderreports unsupported input viaAssetLoader.onErrorinstead of throwing anIllegalStateException.- Make setting the image duration using
MediaItem.Builder.setImageDurationMsmandatory for image export. - Add export support for gaps in sequences of audio EditedMediaItems.
- Add
- Track Selection:
DefaultTrackSelector: Prefer object-based audio over channel-based audio when other factors are equal.
- Extractors:
- Allow
Mp4ExtractorandFragmentedMp4Extractorto identify H264 samples that are not used as reference by subsequent samples. - Add option to enable index-based seeking in
AmrExtractor. - Treat MP3 files with more than 128kB between valid frames as truncated (instead of invalid). This means files with non-MP3 data at the end, with no other metadata to indicate the length of the MP3 bytes, now stop playback at the end of the MP3 data instead of failing with
ParserException: Searched too many bytes.{contentIsMalformed=true, dataType=1}(#1563). - Fix preroll sample handling for non-keyframe media start positions when processing edit lists in MP4 files (#1659).
- Improved frame rate calculation by using media duration from the
mdhdbox inMp4ExtractorandFragmentedMp4Extractor(#1531). - Fix incorrect scaling of
media_timein MP4 edit lists. Whilesegment_durationwas already correctly scaled using the movie timescale,media_timeis now properly scaled using the track timescale, as specified by the MP4 format standard (#1792). - Handle out-of-order frames in
endIndicescalculation for MP4 with edit list (#1797). - Fix media duration parsing in
mdhdbox of MP4 files to handle-1values (#1819). - Add support for identifying
h263box in MP4 files for H.263 video (#1821). - Add AC-4 Level-4 ISO base media file format support (#1265).
- Allow
- DataSource:
- Update
HttpEngineDataSourceto allow use starting at version S extension 7 instead of API level 34 (#1262). DataSourceContractTest: Assert thatDataSource.getUri()returns the resolved URI (as documented). Where this is different to the requested URI, tests can indicate this using the newDataSourceContractTest.TestResource.Builder.setResolvedUri()method.DataSourceContractTest: Assert thatDataSource.getUri()andgetResponseHeaders()return their 'open' value after a failed call toopen()(due to a...
- Update
1.5.0-rc02
This release includes the following changes since the
1.5.0-rc01 release: