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.
- 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.
- Transformer:
- Add
SurfaceAssetLoader, which supports queueing video data to Transformer via aSurface. ImageAssetLoaderreports unsupported input viaAssetLoader.onErrorinstead of throwing anIllegalStateException.
- Add
- 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).
- Allow
- DataSource:
- Update
HttpEngineDataSourceto allow use starting at version S extension 7 instead of API level 34 (#1262).
- Update
- Audio:
- Automatically configure CTA-2075 loudness metadata on the codec if present in the media.
- Ensure smooth volume ramp down when seeking.
- Video:
MediaCodecVideoRendereravoids decoding samples that are neither rendered nor used as reference by other samples.- On API 35 and above,
MediaCodecAdaptermay now receive anullSurfaceinconfigureand calls to a new methoddetachOutputSurfaceto remove a previously setSurfaceif the codec supports this (MediaCodecInfo.detachedSurfaceSupported). - Use
MediaCodecAdaptersupplied pixel aspect ratio values if provided when processingonOutputFormatChanged(#1371).
- Text:
- Add a custom
VoiceSpanand populate it for WebVTT voice spans (#1632).
- Add a custom
- Image:
- Add
ExternallyLoadedImageDecoderfor simplified integration with external image loading libraries like Glide or Coil.
- Add
- DataSource:
- Add
FileDescriptorDataSource, a newDataSourcethat can be used to read from aFileDescriptor(#3757).
- Add
- Effect:
- Add
DefaultVideoFrameProcessorworkaround for minorSurfaceTexturescaling.SurfaceTexturemay include a small scaling that cuts off a 1-texel border around the edge of a cropped buffer. This is now handled such that output is closer to expected. - Speed up
DefaultVideoFrameProcessor.queueInputBitmap(). As a result, exporting images to videos withTransformeris faster.
- Add
- IMA extension:
- Fix bug where clearing the playlist may cause an
ArrayIndexOutOfBoundsExceptioninImaServerSideAdInsertionMediaSource.
- Fix bug where clearing the playlist may cause an
- Session:
- Add
MediaButtonReceiver.shouldStartForegroundService(Intent)to allow apps to suppress a play command coming in for playback resumption by overriding this method. By default, the service is always started and playback can't be suppressed without the system crashing the service with aForegroundServiceDidNotStartInTimeException(#1528).
- Add
- DASH Extension:
- Add support for periods starting in the middle of a segment (#1440).
- Decoder Extensions (FFmpeg, VP9, AV1, etc.):
- Add the IAMF decoder module, which provides support for playback of MP4 files containing IAMF tracks using the libiamf native library to synthesize audio.
- Playback is enabled with a stereo layout as well as 5.1 with spatialization together with optional head tracking enabled, but binaural playback support is currently not available.
- Add the IAMF decoder module, which provides support for playback of MP4 files containing IAMF tracks using the libiamf native library to synthesize audio.
- Cast Extension:
- Stop clearning the timeline after the CastSession disconnects, which enables the sender app to resume playback locally after a disconnection.
- Populate CastPlayer's
DeviceInfowhen aContextis provided. This enables linking theMediaSessionto aRoutingSession, which is necessary for integrating Output Switcher (#1056).
- Test Utilities:
DataSourceContractTestnow includes tests to verify:- Input stream
read positionis updated. - Output buffer
offsetis applied correctly.
- Input stream
- Remove deprecated symbols:
- Remove deprecated
Player.hasPrevious,Player.hasPreviousWindow(). UsePlayer.hasPreviousMediaItem()instead. - Remove deprecated
Player.previous()method. UsePlayer.seekToPreviousMediaItem()instead. - Remove deprecated
DrmSessionEventListener.onDrmSessionAcquiredmethod.
- Remove deprecated