Releases: androidx/media
Releases · androidx/media
1.9.3
1.10.0-rc01
- Session:
- Fix notification artwork icon scaling on Android Q (#3084).
- UI:
- Hide playback position from the accessibility service to prevent continuous announcement update when
PlayerControlViewis visible.
- Hide playback position from the accessibility service to prevent continuous announcement update when
1.10.0-beta01
- Common library:
- Add
Format.primaryTrackGroupIdto identify the primary group of embeddedFormatinstances (#294).
- Add
- ExoPlayer:
- Track selection:
- Change signature of
DefaultTrackSelector.selectAllTracksto include the output array as a parameter, pre-populated with track overrides. - Fix issue where embedded metadata tracks are selected irrespective of whether the corresponding primary track is selected (#294).
- Stabilize
TrackSelectionParametersoptions forpreferredVideoLanguages,preferredVideoLabels,preferredAudioLabels,preferredTextLabelsandselectTextByDefault.
- Change signature of
- Extractors:
- MP4: Support files with large
uuidboxes before other boxes likemoov(#3046). - MP4: Add support for Versatile Video Coding (VVC) tracks in MP4 containers.
- MP4: Support files with large
- Audio:
- Improve the retry logic of
AudioOutputinitialization inDefaultAudioSink(#2905). - Attempt to match the output layout of the speakers (or Spatializer if applicable) when decoding IAMF, both with the IAMF extension and media codec decoders, supported by new fields and logic in AudioCapabilities and AudioCapabilitiesReceiver.
- Improve the retry logic of
- Metadata:
- Increase default count of metadata renderers to four to cover all potential metadata tracks published by HLS variants and renditions (#3043).
- Session:
- UI:
- Add
PlayerComposable tomedia3-ui-compose-material3which combines aContentFramewith customizable controls aligned to top, center, and bottom.
- Add
- HLS extension:
- DASH extension:
- Decoder extensions (FFmpeg, VP9, AV1, etc.):
- Add MPEG-H UI manager support to the MPEG-H decoder extension (#3066).
- Remove deprecated symbols:
- Remove
androidx.media3.extractor.metadata.flac.VorbisComment. Useandroidx.media3.extractor.metadata.vorbis.VorbisCommentinstead. - Remove
MediaSource.prepareSource(MediaSourceCaller, TransferListener). UseMediaSource.prepareSource(MediaSourceCaller, TransferListener, PlayerId)instead.
- Remove
1.10.0-alpha01
- Common Library:
- Promote
Player.mute()andPlayer.unmute()from UnstableApi to stable. - Promote
Format.pcmEncodingandC.PcmEncodingfrom UnstableApi to stable.
- Promote
- ExoPlayer:
- Add clipping capabilities to
AdsMediaSource. - Add support for dynamic scheduling in
MediaCodecVideoRendererto better align scheduling work and CPU wake-cycles to when video frames can be processed. You can enable this usingexperimentalSetEnableMediaCodecVideoRendererDurationToProgressUs()via theDefaultRenderersFactory. - Allow setting a custom
DataSource.FactoryinDefaultPreloadManager.Builder. - Allow
ExoPlayerto be mocked without Robolectric by moving some default constants toExoPlayer.Builder. Mocking this complex interface is not generally encouraged - only when the usage is minimal/simple/incidental (#2985).- This required moving
DEFAULT_STUCK_PLAYING_DETECTION_TIMEOUT_MSfromExoPlayertoExoPlayer.Builder(without deprecation).
- This required moving
- Fix bug where
ProgressiveMediaSourcepropagates out-of-date timeline info to player and the queued periods unexpectedly get removed (#3016).
- Add clipping capabilities to
- CompositionPlayer:
- Add support for
EditedMediaItem.removeVideo.
- Add support for
- Transformer:
EditedMediaItem.Builder.setFrameRate()can now set a maximum output frame rate for video, which is particularly helpful when increasing media speed withsetSpeed().
- Inspector:
- Breaking change: Removed
FrameExtractor. Users should now depend on the new:media3-inspector-framemodule and update imports toandroidx.media3.inspector.frame.FrameExtractor.
- Breaking change: Removed
- Inspector Frame:
- Introduced a new module for extracting and processing decoded video frames.
- Audio:
- Change underlying decoding library for IAMF decoder extension from
libiamftoiamf_tools. - IAMF decoding supports binaural output either through the decoder (when using the IAMF decoder extension) or through the Android Spatializer.
- Correctly remove support for
AC4Profile22and other legacy profiles when assessing AC-4 decoder support in Automotive scenarios (#2609). - Improve the retry logic of
AudioOutputinitialization inDefaultAudioSink(#2905).
- Change underlying decoding library for IAMF decoder extension from
- Text:
- VobSub: Use
STARTandSTOPSPU control commands to derive cue duration instead of always defaulting to 5s (#2935).
- VobSub: Use
- Effect:
- Moved
LottieOverlayto a new:media3-effect-lottiemodule (which also involved renaming it fromandroidx.media3.effect.LottieOverlaytoandroidx.media3.effect.lottie.LottieOverlay).
- Moved
- Effect Lottie:
- Introduced a new
:media3-effect-lottiemodule which provides functionality for applying lottie effects to video frames.
- Introduced a new
- IMA extension:
- Update the IMA SDK version to 3.39.0 in order to have access to the latest Ad media info API.
- Bug fix: Corrected an issue where the ad MIME type did not match the MIME type provided in the IMA LOADED event. The fix now maps the ad MIME type using the ad media info provided by IMA.
- Added
setEnableCustomTabstoImaAdsLoaderandImaServerSideAdInsertionMediaSource, allowing users to control whether ad click-through URLs are launched using Custom Tabs. - Add the
ImaAdTagUriBuilder, a class that offers an alternative way to construct anadTagUri. It contains thesetPreferredLinearOrientationAPI. This is an API in alpha testing that will allow you to set your preferred orientation for linear ads. If you wish to join the alpha testing group, please reach out to your account partner.
- Session:
- Fix bug where large arrays in
MediaMetadata.artworkDatacan crash the app. - Use type int for
@Player.Commandargument in theActionFactoryinterface (#2933). - Make
MediaSessionServiceandMediaLibraryServiceaLifecycleService, more easily allowing to attach lifecycle-aware operations to the service's lifecycle (#187). - Stop supporting device volume change commands from
MediaControllerandMediaBrowserfor local playbacks. Apps should not change the local device volume, and if required, can useAudioManagerAPIs for this purpose. - Detect stale
Intentinstances that started the service as a foreground service. This prevents aForegroundServiceDidNotStartInTimeExceptionbeing thrown by the system. This is a breaking change on an unstable API for apps implementing a customMediaNotification.Provideras there is a new required method. - Add builders for
PendingIntentinstances to be used with home screen widgets (#2933). - Add static methods for creating
Intentinstances for Compose-based home screen widgets (#2933). - Fix bug where the media item transition wasn't reported to controllers when playback transitioned from a given media item index to another with the same media item for discontinuity reason
AUTOandSEEK(#2997).
- Fix bug where large arrays in
- UI:
- Add
PlaybackSpeedControlComposable tomedia3-ui-composefor displaying and modifying playback speed. - Add
PlaybackSpeedToggleButtonComposable tomedia3-ui-compose-material3for controlling playback speed. - Add
ProgressSliderComposable tomedia3-ui-compose-material3for displaying player progress and performing seeks using dragging and tapping (#2288). - Avoid large offscreen buffer in animating PlayerControlView.
- Add
- HLS extension:
- Cast extension:
- Add
RemoteCastPlayer.Builder#setTrackSelectormethod that enables the implementation of track selection for Cast playbacks.
- Add
- Remove deprecated symbols:
- Removed
ExperimentalFrameExtractor. Useandroidx.media3.inspector.frame.FrameExtractorinstead. - Removed
ChannelMixingMatrix.create(). UseChannelMixingMatrix.createForConstantGain()instead.
- Removed
1.9.2
- ExoPlayer:
- Fix bug where
ProgressiveMediaSourcepropagates out-of-date timeline info to player and the queued periods unexpectedly get removed (#3016).
- Fix bug where
- Session:
- Fix issue where system UI button placement workaround negatively affects other UI surface like Android Auto or manufacturers not needing the workaround (#3041).
- Cast extension:
- Fix bug where transferring from Cast to local playback was broken.
1.9.1
- Common Library:
- Support date-time strings with only hours in the timezone offset (#2929).
- ExoPlayer:
- Allow dynamic scheduling to slow
doSomeWorkinterval only after audio starts to support smoother A/V sync at beginning of playback. - Fix bug in
DefaultLoadErrorHandlingPolicywhereFileNotFoundExceptionand similar exception types were retried multiple times. - Fix bug with dynamic scheduling where the calculated time for the next
doSomeWorkwas mistakenly reduced by the elapsed time of the current iteration ofdoSomeWork. Addressing this hopefully extends CPU idle time and saves power. - Fix issue where some playbacks of Dolby Vision files fail when attempting to use a fallback AVC or HEVC codec.
- Fix bug where loading continues after playback ended when removing the currently playing item from a playlist (#2873).
- Avoid leaking
MediaIteminstances when repeatedly usingExoPlayer.replaceMediaItemon the same item (#2993). - Prevent potential ANRs caused by emergency wake lock releases (#2979).
- Allow dynamic scheduling to slow
- Extractors:
- MP3: Parse LAME ReplayGain data (#2840).
- Audio:
- Correctly remove support for
AC4Profile22and other legacy profiles when assessing AC-4 decoder support in Automotive scenarios (#2609).
- Correctly remove support for
- Video:
- Discard video codecs on devices below API 30 when the content frame rate changes to avoid stuttering playback (#2941).
- Text:
- VobSub: Fix some missing subtitles by correctly handling SPUs that either contain only a single control sequence, or have critical info split across multiple control sequences (#2935).
- IMA extension:
- Bug fix: Corrected an issue where the ad MIME type did not match the MIME type provided in the IMA LOADED event. The fix now maps the ad MIME type using the ad pod index and ad position.
- Add a null check before accessing result of
getAdsManager()andAdEvent.getAd().
- Session:
- Fix bug where stopping a
MediaControllerconnected to a platform session crashed the app if stop happened during ad playback (#2948). - Add additional verifications on
extrasBundleinstances in various classes to guard against malformedBundleinstances sent from other processes. - Fix issue where missing commands for
COMMAND_SEEK_NEXTorCOMMAND_SEEK_BACKcan cause gaps in the system media notification (#2976). - Move bitmap scaling for notification icon off the main thread (#2829).
- Fix bug where author, writer and composer were not used as a fallback when converting from legacy
MediaMetadataCompatandMediaDescriptionCompat(#3018).
- Fix bug where stopping a
- Downloads:
- Fix potential infinite loops when a
PriorityTooLowExceptionis handled bySegmentDownloader(for DASH, HLS and SmoothStreaming). Custom overrides ofSegmentDownloaderusing the protectedexecutemethod need to provide their task wrapped in aSupplierso it can be recreated (#2931).
- Fix potential infinite loops when a
- HLS extension:
- Pass the raw asset list JSON document to
Listener.onAssetListLoadCompletedcallback. This is a breaking change in an unstable API that requires apps that implement this callback to add an additional argument of typeJSONObject(#2950).
- Pass the raw asset list JSON document to
- RTSP extension:
- Correctly handle RTP Packets with timestamps that wrap around (#2930).
- Decoder extensions (FFmpeg, VP9, AV1, etc.):
- Fix potential
NullPointerExceptionthat can occur when seeking prior to processing the first video frame (#2965).
- Fix potential
- Cast extension:
- Fix bug preventing the
RemoteCastPlayertimeline from updating correctly when replacing the playlist.
- Fix bug preventing the
1.9.0
1.9.0 (2025-12-17)
- Common Library:
- Update
minSdkto23in line with other AndroidX libraries. - Add
PlayerTransferState, which facilitates transferring the playback state acrossPlayerinstances. - Add
void mute()andvoid unmute()methods to Player that preserve and consequently restore Player's volume before and after setting it to zero. - Publish utility classes
WakeLockManager,WifiLockManager,AudioFocusManager,AudioBecomingNoisyManagerandStuckPlayerDetectorpreviously used byExoPlayerinternally to allow reuse for other players (#1893). - Fix
ForwardingPlayerlistener handling when the underlying delegate player uses reference equality for comparing listener instances (#2675). - Add a
Player.listenTosuspending extension function in themedia3-common-ktxlibrary that specifies the particularPlayer.Eventsthat should be acted upon. - Fix a crash in
BasePlayer.getBufferedPercentageresulting from integer overflow when the reported buffered position is implausibly much larger than the reported duration (#2750). - Fix auto-detection of
TrackGrouptrack type by not ignoring custom sample MIME type and falling back to using the potentially wrong track type from the container MIME type (#2860).
- Update
- ExoPlayer:
- Add a stuck player detection that triggers a
StuckPlayerExceptionplayer error if the player seems stuck. This happens in the following cases, where each default timeout can be configured inExoPlayer.Builderif required:- After 10 minutes of
STATE_BUFFERINGwhile trying to play and no buffering progress. - After 10 seconds of
STATE_READYwhile trying to play and no playback progress. - After 1 minute of
STATE_READYbeyond the declared duration without reaching the end of the item. - After 10 minutes with a playback suppression reason while trying to play.
- After 10 minutes of
- Enable wake lock handling by default to fix issues with buffering during background playback. This is equivalent to setting
ExoPlayer.Builder.setWakeModetoC.WAKE_MODE_LOCAL. - Add listening logic to automatically update the virtual device ID when a change is reported to the
Contextoriginally passed toExoPlayer.Builder. - Add
ExoPlayer.setVirtualDeviceIdto manually update the virtual device ID obtained from theContextpassed toExoPlayer.Builder. - Ensure renderers don't consume data from the next playlist item more than 10 seconds before the end of the current item.
- Add
setSeekBackIncrementMs,setSeekForwardIncrementMsandsetMaxSeekToPreviousPositionMstoExoPlayerto update these settings after construction (#2736). - Add pre-caching functionality in
DefaultPreloadManager. Apps now can returnDefaultPreloadManager.PreloadStatus.specifiedRangeCached(startPositionMs, durationMs)orDefaultPreloadManager.PreloadStatus.specifiedRangeCached(durationMs)viaTargetPreloadStatusControl.getTargetPreloadStatus(T rankingData)to indicate that a media item needs to be pre-cached. - Use pre-caching functionality of
DefaultPreloadManagerin shortform demo app. - Add
DefaultLoadControl.Buildersetters for local playback and adjust default values ofDefaultLoadControlto work well with a wide range of local files. - Fix bug where setting an empty playlist can leave the player in
STATE_READYorSTATE_BUFFERING. - Enhance the preload manager APIs:
- Add
addMediaItems(List<MediaItem>, List<T>)andaddMediaSources(List<MediaSource>, List<T>)that add the media items or media sources in batch, and automatically callinvalidate()afterwards. - Add
removeMediaItems((List<MediaItem>)andremoveMediaSources(List<MediaSource>)that remove the media items or media sources in batch, and make sure that preload manager does not start to preload or continue preloading any of them after removal. - Allow
DefaultPreloadManager.setCurrentPlayingIndex(int)to invalidate itself automatically. Apps don't need to callinvalidate()explicitly anymore after updating the current playing index.
- Add
- Add capability to skip keyframe reset for forward seeks within the same group of pictures while in scrubbing mode.
- Add
DefaultLoadControl.Builder.setPlayerTargetBufferBytes(String, int)for apps to set a value of target buffer bytes for a player with the specifiedplayerName. TheDefaultLoadControlcan now make decisions of each player separately based on its own allocated bytes and target buffer bytes. - Add
SkipInfoto theAdPlaybackState.AdGroupto carry skip information for each ad in the ad group. - Fix bug where calling
removeMediaItems(List)during playing a post-roll created a crash (#2746). - Fix some stuttering in playlist playback where frames were mistakenly always set as the last sample and rendered.
- Enable retry path if player fails to generate audio session ID (#2382, #2678).
- Add support to control the total buffer bytes for the sources in
DefaultPreloadManagerto avoid total buffer bytes for preloading from growing arbitrarily. To use the default control logic, Apps can set the target buffer bytes for preloading viaDefaultLoadControl.Builder.setPlayerTargetBufferBytes(String, int)for aplayerNameofPlayerId.Preload.name("preload"), and inject the createdDefaultLoadControlviaDefaultPreloadManager.Builder.setLoadControl(LoadControl). - Add
cloneAndSet(int, int)toShuffleOrderwith a default implementation (#2834). - Append content resume offset when skipping ad playback after seek adjustment or auto transition (#2484).
- Add API to set and observe codec parameters for audio and video tracks. This feature is implemented for
MediaCodecbased renderers and requires API 29+.- Use
ExoPlayer.setAudioCodecParameters()andExoPlayer.setVideoCodecParameters()to apply parameters. - Use
ExoPlayer.addAudioCodecParametersChangeListener()andExoPlayer.addVideoCodecParametersChangeListener()to listen for changes. Observing vendor-specific keys requires API 31+.
- Use
- Fix
IllegalStateExceptioncaused by setting an empty media source after seeking to a non-zero position and then preparing the player with a non-empty media source. - Fix bug where seeking into other media items while in scrubbing mode could cause
IllegalStateException. - Fix potential
NullPointerExceptioninDefaultPlaybackSessionManager(#2885). - Enable improvements in seeking performance for eligible videos.
- Re-enable use of asynchronous decryption in MediaCodec on API 36+ where timeout issues with this platform API have been fixed (#1641).
- Change the default value of
MediaCodecVideoRenderer.experimentalSetLateThresholdToDropDecoderInputUsto 15ms and enable more efficient dropping of video frames before decoding for eligible videos. - Add maximum memory limit to the automatic memory calculation in
DefaultLoadControl. This should only take effect if an excessive number of tracks get selected (#2860). - Fix bug where, if playing in a playlist or repeat mode, seeking in scrub mode near the end could cause a seek to the next media item.
- Add a stuck player detection that triggers a
- CompositionPlayer:
- Publish
CompositionPlayerunder a new@ExperimentalApiannotation to indicate it is available for experimentation, but is still under development. Some APIs are likely to change significantly in future releases, and there are known issues and limitations with some use-cases (some undocumented). - Add support for
COMMAND_SET_AUDIO_ATTRIBUTESand audio focus handling inCompositionPlayer. - Add support for speed changing in secondary sequences in
CompositionPlayer. - Add support for
EditedMediaItem.removeVideo.
- Publish
- Transformer:
- Use
InAppMp4Muxeras default muxer. - Add
EditedMediaItem.Builder#setSpeed()and deprecateEffects#createExperimentalSpeedChangingEffects(). - Replace
forceAudioTrackandforceVideoTrackwithtrackTypesinEditedMediaItemSequence.
- Use
- Track Selection:
- Add
TrackSelectionParameters.selectTextByDefaultto prefer the selection of any text track without specifying other more specific preferences. - Add
preferredVideoLabels,preferredAudioLabelsandpreferredTextLabelsinTrackSelectionParametersto specify a preference for tracks with a specific label, for example those read from HLS NAME tags (#1666).
- Add
- Extractors:
- FLAC: Tighten header detection to reduce the chance of finding spurious headers in the encoded FLAC data, resulting in decoding errors (#558).
- MP3: Allow gaps between (and before) ID3 tags at the beginning of MP3 files (#811, #5718).
- MP3: Increase sniffing limit to 128kB to match the existing search limit for a sync byte (#2713).
- MP3: Change
FLAG_ENABLE_INDEX_SEEKINGto prefer seeking informatio...
1.9.0-rc01
- Common Library:
- Fix auto-detection of
TrackGrouptrack type by not ignoring custom sample MIME type and falling back to using the potentially wrong track type from the container MIME type (#2860).
- Fix auto-detection of
- ExoPlayer:
- Add API to set and observe codec parameters for audio and video tracks. This feature is implemented for
MediaCodecbased renderers and requires API 29+.- Use
ExoPlayer.setAudioCodecParameters()andExoPlayer.setVideoCodecParameters()to apply parameters. - Use
ExoPlayer.addAudioCodecParametersChangeListener()andExoPlayer.addVideoCodecParametersChangeListener()to listen for changes. Observing vendor-specific keys requires API 31+.
- Use
- Fix
IllegalStateExceptioncaused by setting an empty media source after seeking to a non-zero position and then preparing the player with a non-empty media source. - Fix bug where seeking into other media items while in scrubbing mode could cause
IllegalStateException. - Fix potential
NullPointerExceptioninDefaultPlaybackSessionManager(#2885). - Enable improvements in seeking performance for eligible videos.
- Re-enable use of asynchronous decryption in MediaCodec on API 36+ where timeout issues with this platform API have been fixed (#1641).
- Change the default value of
MediaCodecVideoRenderer.experimentalSetLateThresholdToDropDecoderInputUsto 15ms and enable more efficient dropping of video frames before decoding for eligible videos. - Add maximum memory limit to the automatic memory calculation in
DefaultLoadControl. This should only take effect if an excessive number of tracks get selected (#2860). - Fix bug where, if playing in a playlist or repeat mode, seeking in scrub mode near the end could cause a seek to the next media item.
- Add API to set and observe codec parameters for audio and video tracks. This feature is implemented for
- Extractors:
- MP3: Change
Mp3Extractorto default to a constant bitrate (CBR) assumption when no seeking metadata (e.g., Xing, VBRI) is found, even whenFLAG_ENABLE_INDEX_SEEKINGis set. This is based on the MP3 specification's history, where CBR was standard and VBR requires explicit headers. This improves immediate seekability for files without metadata at the cost of potential accuracy for VBR files lacking headers. Index seeking is now used as a fallback if the CBR assumption is not seekable (e.g., for streams of unknown length) (#2848).
- MP3: Change
- Inspector:
- Add
androidx.media3.inspector.MediaExtractorCompat, a drop-in replacement for the platform'sandroid.media.MediaExtractorthat provides a way to extract raw, encoded media samples from a media file. The existingandroidx.media3.exoplayer.MediaExtractorCompatis now deprecated in favor of this new class.
- Add
- Session:
- Add backwards-compatibility for
CommandButtoninstances usingPlayer.Commandor non-customSessionCommandto define their action. These are now correctly represented in platform media sessions, for example for System UI or Android Auto. - Fix issue where the same
Bitmapis compressed multiple times when connecting aMediaControllerto a platform media session.
- Add backwards-compatibility for
- HLS extension:
- Properly handle fetching the next chunk for an
HlsMediaPlaylistwith no segments (#2821). - Use the default start position for pre rolls with live streams.
- Properly handle fetching the next chunk for an
- Decoder extensions (FFmpeg, VP9, AV1, etc.):
- FFmpeg extension: Fix an issue that prevented some FLAC files from playing by ensuring the
STREAMINFOblock is correctly parsed and passed to the decoder (#2887).
- FFmpeg extension: Fix an issue that prevented some FLAC files from playing by ensuring the
- Remove deprecated symbols:
- Remove
BitmapFactoryImageDecoder.BitmapDecoder. UseExternallyLoadedImageDecoderinstead. - Remove deprecated
ShadowMediaCodecConfig.forAllSupportedMimeTypes(). UseShadowMediaCodecConfig.withAllDefaultSupportedCodecs()instead. - Remove deprecated
ShadowMediaCodecConfig.withNoDefaultSupportedMimeTypes(). UseShadowMediaCodecConfig.withNoDefaultSupportedCodecs()instead.
- Remove
1.9.0-beta01
- ExoPlayer:
- Extractors:
- MP3: Increase sniffing limit to 128kB to match the existing search limit for a sync byte (#2713).
- Video:
- Re-enable workaround for wrongly reported performance points for secure codecs (#2856).
- Effect:
- Add
Presentation.copyWithUnsetSideRoundedToto round the unset output side whenPresentationis created with a single side length.
- Add
- IMA extension:
- Fix issue where content preparation error for content after an ad would be wrongly reported as an ad playback error (#2656).
- Session:
- Add
CommandButton.executeActionso that controllers can more easily trigger the intended action. Also allow to specify parameters for some player and session commands to define which action to trigger.
- Add
- UI:
- Use
BidiFormatterto correctly display punctuation in RTL text subtitles (#11214). - Add
TimeTextcomposable tomedia3-ui-compose-material3for displaying player progress in a textual form. It can be configured to show the current position, duration, or remaining time.
- Use
- HLS extension:
- Add
HlsInterstitialsAdsLoader.skipCurrentAd()andskipCurrentAdGroup()and corresponding methods to skip ads and ad groups by index. - Add
HlsInterstitialsAdsLoader.Listener.onAdStartedto report the start of an ad period (#2859). - Accept space as a date/time separator in ISO 8601 date-time strings.
- Add
1.9.0-alpha01
- Common Library:
- Update
minSdkto23in line with other AndroidX libraries. - Add
PlayerTransferState, which facilitates transferring the playback state acrossPlayerinstances. - Add
void mute()andvoid unmute()methods to Player that preserve and consequently restore Player's volume before and after setting it to zero. - Publish utility classes
WakeLockManager,WifiLockManager,AudioFocusManager,AudioBecomingNoisyManagerandStuckPlayerDetectorpreviously used byExoPlayerinternally to allow reuse for other players (#1893). - Fix
ForwardingPlayerlistener handling when the underlying delegate player uses reference equality for comparing listener instances (#2675). - Add a
Player.listenTosuspending extension function in themedia3-common-ktxlibrary that specifies the particularPlayer.Eventsthat should be acted upon. - Fix a crash in
BasePlayer.getBufferedPercentageresulting from integer overflow when the reported buffered position is implausibly much larger than the reported duration (#2750).
- Update
- ExoPlayer:
- Add a stuck player detection that triggers a
StuckPlayerExceptionplayer error if the player seems stuck. This happens in the following cases, where each default timeout can be configured inExoPlayer.Builderif required:- After 10 minutes of
STATE_BUFFERINGwhile trying to play and no buffering progress. - After 10 seconds of
STATE_READYwhile trying to play and no playback progress. - After 1 minute of
STATE_READYbeyond the declared duration without reaching the end of the item. - After 10 minutes with a playback suppression reason while trying to play.
- After 10 minutes of
- Enable wake lock handling by default to fix issues with buffering during background playback. This is equivalent to setting
ExoPlayer.Builder.setWakeModetoC.WAKE_MODE_LOCAL. - Add listening logic to automatically update the virtual device ID when a change is reported to the
Contextoriginally passed toExoPlayer.Builder. - Add
ExoPlayer.setVirtualDeviceIdto manually update the virtual device ID obtained from theContextpassed toExoPlayer.Builder. - Ensure renderers don't consume data from the next playlist item more than 10 seconds before the end of the current item.
- Add
setSeekBackIncrementMs,setSeekForwardIncrementMsandsetMaxSeekToPreviousPositionMstoExoPlayerto update these settings after construction (#2736). - Add pre-caching functionality in
DefaultPreloadManager. Apps now can returnDefaultPreloadManager.PreloadStatus.specifiedRangeCached(startPositionMs, durationMs)orDefaultPreloadManager.PreloadStatus.specifiedRangeCached(durationMs)viaTargetPreloadStatusControl.getTargetPreloadStatus(T rankingData)to indicate that a media item needs to be pre-cached. - Use pre-caching functionality of
DefaultPreloadManagerin shortform demo app. - Add
DefaultLoadControl.Buildersetters for local playback and adjust default values ofDefaultLoadControlto work well with a wide range of local files. - Fix bug where setting an empty playlist can leave the player in
STATE_READYorSTATE_BUFFERING. - Enhance the preload manager APIs:
- Add
addMediaItems(List<MediaItem>, List<T>)andaddMediaSources(List<MediaSource>, List<T>)that add the media items or media sources in batch, and automatically callinvalidate()afterwards. - Add
removeMediaItems((List<MediaItem>)andremoveMediaSources(List<MediaSource>)that remove the media items or media sources in batch, and make sure that preload manager does not start to preload or continue preloading any of them after removal. - Allow
DefaultPreloadManager.setCurrentPlayingIndex(int)to invalidate itself automatically. Apps don't need to callinvalidate()explicitly anymore after updating the current playing index.
- Add
- Add capability to skip keyframe reset for forward seeks within the same group of pictures while in scrubbing mode.
- Add
DefaultLoadControl.Builder.setPlayerTargetBufferBytes(String, int)for apps to set a value of target buffer bytes for a player with the specifiedplayerName. TheDefaultLoadControlcan now make decisions of each player separately based on its own allocated bytes and target buffer bytes. - Add
SkipInfoto theAdPlaybackState.AdGroupto carry skip information for each ad in the ad group. - Fix bug where calling
removeMediaItems(List)during playing a post-roll created a crash (#2746). - Fix some stuttering in playlist playback where frames were mistakenly always set as the last sample and rendered.
- Enable retry path if player fails to generate audio session ID (#2382, #2678).
- Add support to control the total buffer bytes for the sources in
DefaultPreloadManagerto avoid total buffer bytes for preloading from growing arbitrarily. To use the default control logic, Apps can set the target buffer bytes for preloading viaDefaultLoadControl.Builder.setPlayerTargetBufferBytes(String, int)for aplayerNameofPlayerId.Preload.name("preload"), and inject the createdDefaultLoadControlviaDefaultPreloadManager.Builder.setLoadControl(LoadControl).
- Add a stuck player detection that triggers a
- CompositionPlayer:
- Publish
CompositionPlayerunder a new@ExperimentalApiannotation to indicate it is available for experimentation, but is still under development. Some APIs are likely to change significantly in future releases, and there are known issues and limitations with some use-cases (some undocumented). - Add support for
COMMAND_SET_AUDIO_ATTRIBUTESand audio focus handling inCompositionPlayer. - Add support for speed changing in secondary sequences in
CompositionPlayer.
- Publish
- Transformer:
- Use
InAppMp4Muxeras default muxer. - Add
EditedMediaItem.Builder#setSpeed()and deprecateEffects#createExperimentalSpeedChangingEffects(). - Replace
forceAudioTrackandforceVideoTrackwithtrackTypesinEditedMediaItemSequence.
- Use
- Track Selection:
- Add
TrackSelectionParameters.selectTextByDefaultto prefer the selection of any text track without specifying other more specific preferences. - Add
preferredVideoLabels,preferredAudioLabelsandpreferredTextLabelsinTrackSelectionParametersto specify a preference for tracks with a specific label, for example those read from HLS NAME tags (#1666).
- Add
- Extractors:
- FLAC: Tighten header detection to reduce the chance of finding spurious headers in the encoded FLAC data, resulting in decoding errors (#558).
- MP3: Allow gaps between (and before) ID3 tags at the beginning of MP3 files (#811, #5718).
- MP4: Disambiguate between
audio/mpeg(MP3),audio/mpeg-L1andaudio/mpeg-L2MIME types by peeking the layer value of the first sample before emitting a track format from the extractor (#2683). - MP4: Improve sniffing efficiency of very large files by assuming a
stblbox larger than 1MB implies the file must be non-fragmented (#2650). - Matroska: Add support for DTS-HD detection (#6225).
- Fix an issue in
MatroskaExtractorwhere seeking could be inaccurate for files with multiple tracks. Cue points are now correctly associated with their respective tracks, leading to more precise seeking. - MP4: Add support for
©mvn(movement name) and©mvi(movement index) metadata, these are now emitted asTextInformationFrameobjects inFormat.metadatawith IDs ofMVNMandMVINrespectively (#2754). - MPEG-TS: Fix
IllegalArgumentExceptionfromReorderingBufferQueuecaused by PES packets with no timestamp (#2764). - MP4: Ignore tracks with missing
stsdbox (instead of failing to parse the whole file). - Add support for extracting HEIC Motion Photos. The
HeifExtractorcan now parse HEIC files containing embedded video and audio tracks. - MP3: Change
FLAG_ENABLE_INDEX_SEEKINGto prefer seeking information from metadata headers (like Xing and VBRI) when available, falling back to index-based seeking if no other seeking information is present. This improves performance for files with seeking metadata (#2839).
- Inspector:
- Introduced a new
:media3-inspectormodule to serve as the dedicated home for media inspection utilities. This module now houses a newandroidx.media3.inspector.MetadataRetriever, which will provide a unified API for both metadata and frame extraction. The existingandroidx.media3.exoplayer.MetadataRetrieveris now deprecated in favor of this new version. - Introduced
androidx.media3.inspector.FrameExtractor, a new public API for frame extraction. ThisAutoCloseableclass provides a way to extract frames with support for HDR video, video effects, and custom decoder selection. It should be created via itsBuilderfor a specificMediaItem. - FrameExtractor: Add
getThumbnail()to extract a representative thumbnail frame from a media file without ...
- Introduced a new