- Common Library:
- Update
minSdk
to23
in line with other AndroidX libraries. - Add
PlayerTransferState
, which facilitates transferring the playback state acrossPlayer
instances. - 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
,AudioBecomingNoisyManager
andStuckPlayerDetector
previously used byExoPlayer
internally to allow reuse for other players (#1893). - Fix
ForwardingPlayer
listener handling when the underlying delegate player uses reference equality for comparing listener instances (#2675). - Add a
Player.listenTo
suspending extension function in themedia3-common-ktx
library that specifies the particularPlayer.Events
that should be acted upon. - Fix a crash in
BasePlayer.getBufferedPercentage
resulting 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
StuckPlayerException
player error if the player seems stuck. This happens in the following cases, where each default timeout can be configured inExoPlayer.Builder
if required:- After 10 minutes of
STATE_BUFFERING
while trying to play and no buffering progress. - After 10 seconds of
STATE_READY
while trying to play and no playback progress. - After 1 minute of
STATE_READY
beyond 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.setWakeMode
toC.WAKE_MODE_LOCAL
. - Add listening logic to automatically update the virtual device ID when a change is reported to the
Context
originally passed toExoPlayer.Builder
. - Add
ExoPlayer.setVirtualDeviceId
to manually update the virtual device ID obtained from theContext
passed 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
,setSeekForwardIncrementMs
andsetMaxSeekToPreviousPositionMs
toExoPlayer
to 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
DefaultPreloadManager
in shortform demo app. - Add
DefaultLoadControl.Builder
setters for local playback and adjust default values ofDefaultLoadControl
to work well with a wide range of local files. - Fix bug where setting an empty playlist can leave the player in
STATE_READY
orSTATE_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
. TheDefaultLoadControl
can now make decisions of each player separately based on its own allocated bytes and target buffer bytes. - Add
SkipInfo
to theAdPlaybackState.AdGroup
to 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
DefaultPreloadManager
to 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 aplayerName
ofPlayerId.Preload.name
("preload"), and inject the createdDefaultLoadControl
viaDefaultPreloadManager.Builder.setLoadControl(LoadControl)
.
- Add a stuck player detection that triggers a
- CompositionPlayer:
- Publish
CompositionPlayer
under a new@ExperimentalApi
annotation 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_ATTRIBUTES
and audio focus handling inCompositionPlayer
. - Add support for speed changing in secondary sequences in
CompositionPlayer
.
- Publish
- Transformer:
- Use
InAppMp4Muxer
as default muxer. - Add
EditedMediaItem.Builder#setSpeed()
and deprecateEffects#createExperimentalSpeedChangingEffects()
. - Replace
forceAudioTrack
andforceVideoTrack
withtrackTypes
inEditedMediaItemSequence
.
- Use
- Track Selection:
- Add
TrackSelectionParameters.selectTextByDefault
to prefer the selection of any text track without specifying other more specific preferences. - Add
preferredVideoLabels
,preferredAudioLabels
andpreferredTextLabels
inTrackSelectionParameters
to 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-L1
andaudio/mpeg-L2
MIME 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
stbl
box larger than 1MB implies the file must be non-fragmented (#2650). - Matroska: Add support for DTS-HD detection (#6225).
- Fix an issue in
MatroskaExtractor
where 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 asTextInformationFrame
objects inFormat.metadata
with IDs ofMVNM
andMVIN
respectively (#2754). - MPEG-TS: Fix
IllegalArgumentException
fromReorderingBufferQueue
caused by PES packets with no timestamp (#2764). - MP4: Ignore tracks with missing
stsd
box (instead of failing to parse the whole file). - Add support for extracting HEIC Motion Photos. The
HeifExtractor
can now parse HEIC files containing embedded video and audio tracks. - MP3: Change
FLAG_ENABLE_INDEX_SEEKING
to 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-inspector
module 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.MetadataRetriever
is now deprecated in favor of this new version. - Introduced
androidx.media3.inspector.FrameExtractor
, a new public API for frame extraction. ThisAutoCloseable
class provides a way to extract frames with support for HDR video, video effects, and custom decoder selection. It should be created via itsBuilder
for a specificMediaItem
. - FrameExtractor: Add
getThumbnail()
to extract a representative thumbnail frame from a media file without requiring a specific timestamp.
- Introduced a new
- Audio:
- Make
AudioProcessor
instances aware of seeking. - Allow injecting the new
AudioOutputProvider
interface intoDefaultAudioSink.Builder
to support custom audio output paths. The default isAudioTrackAudioOutputProvider
. - Handle seeks in
GainProcessor
. - Utilize AC-4 decoder profile and level capabilities in track format support assessment (#2580).
- Avoid potential delays caused by handling routing change callbacks at the beginning of playback (#2646).
- Allow codec reuse for EAC3, EAC3-JOC and AC-4 formats (#1346).
- Add support for float PCM samples in
Sonic
. - Add support for 16 bit PCM samples in
ToFloatPcmAudioProcessor
.
- Make
- Video:
- Disable codec reuse for Dolby-Vision content with different profiles.
- Text:
- Fix parsing of CEA-6/708 subtitles in Dolby Vision content (#2775).
- Image:
- Fix ScrubbingMode issue where player gets stuck while scrubbing a DASH thumbnail track (#2815).
- DRM:
- Change the return type of
MediaDrmCallback
methods frombyte[]
to a newMediaDrmCallback.Response
type, to allow returning extra optional information. This is a source breaking change, but breakages can be easily resolved by wrapping the previousbyte[]
return value withnew Response
before returning. - Add key request info like URL and latency to
AnalyticsListener.onDrmKeysLoaded
(#1001). - Move provisioning request data from a URL parameter to the POST body.
- Change the return type of
- Muxers:
- Add
MediaMuxerCompat
, a drop-in replacement for frameworkMediaMuxer
. - Add
MuxerUtil.createMotionPhotoFromJpegImageAndBmffVideo()
to allow Motion Photo creation. - Add
WebmMuxer
to allow muxing ofOPUS
,VORBIS
,VP8
andVP9
media streams into awebm
file format.
- Add
- IMA extension:
- Removal of custom proguard rules, so that apps can use those released in IMA android archive instead.
- Add
ImaServerSideAdInsertionUriBuilder.setNetworkCode
, a new API for setting the Google Ad Manager network code for the IMA SDK to handle ads identifiers as specified in Google Ad Manager settings. Network codes are optional but recommended for Full service stream requests. To find the network code, see this article. - Bump IMA dependency to 3.37.0 which requires enabling core library desugaring. This must also be enabled by dependent apps too. See IMA's config notes.
- Support IMA DAI custom UI options in SSAI URI builder. Custom UI options for server side ad insertion include “Skippable” and “About This Ad” rendering support. The feature is currently available for selected publishers behind an allow list. This change also upgrades the IMA SDK version to 3.38.0 (release notes) to access the custom UI options API.
- Session:
- Add new parameter to
MediaSession.Callback.onPlaybackResumption
to indicate if the call happens to gather information only or to start playback (#1764). - Update
MediaSession.ControllerInfo.isTrusted
to also declare controllers from the own app as trusted (#2542). - Add
MediaSessionService.triggerNotificationUpdate
to manually trigger a notification update (#1833). - Add
ProgressListener
to custom command methods. - Change the default value for
MediaLibrarySession.Builder.setLibraryErrorReplicationMode
to non fatal. - Add a
Context
parameter toMediaButtonReceiver.onForegroundServiceStartNotAllowedException
(#2625). - Read the volume control ID from the platform
PlaybackInfo
instead of fetching it via binder. This ensures that playback type and volume control ID are read atomically and do match to each other. - Fix bug where
ACTION_UP
key events were filtered out before passing them to the callback for custom handling. This brings parity with what media1 did and the platform does (#2637). - Fix bug where
getCurrentTimeline()
was called byPlayerWrapper
even when the command isn't available (#2665). - Fix bug where a message was left in the message queue of the main looper which caused a memory leak after the service terminated (#2692).
- When connected to a legacy session app with a
MediaBrowser
, custom commands are sent to the session only if the custom action is advertised as a custom action inPlaybackStateCompat
of the legacy session. All other custom actions are sent to the service. - Implemented
onAudioSessionIdChanged
to notify media controllers when an audio session ID is set by the session (#244). - Fix bug where
KEYCODE_HEADSETHOOK
did not start the player upon and media key eventIntent
arriving inonStartCommand()
. This is fixed by handlingKEYCODE_HEADSETHOOK
just likeKEYCODE_MEDIA_PLAY_PAUSE
(#2816). - Fix a bug where Surface size was not communicated between the session and the controller, resulting in the failure to apply video effects in demo-session. If you are using a controller, this might be a breaking change if your player cannot handle a
setVideoSurfaceHolder
call. - Fix propagation of non-
String
CharSequence
metadata values like span-styled strings (#2853).
- Add new parameter to
- UI:
- Add
ProgressStateWithTickInterval
class and the correspondingrememberProgressStateWithTickInterval
Composable tomedia3-ui-compose
module. This state holder is used indemo-compose
to display the current position and duration in text form. - Add
MuteButtonState
toui-compose
that handles muting of thePlayer
volume. This state holder is used indemo-compose
to display mute/unmute toggle button. - Add
ProgressStateWithTickCount
classes and the correspondingrememberProgressStateWithTickCount
Composable tomedia3-ui-compose
module. This state holder is used indemo-compose
to display progress as a horizontal read-only progress bar. - Add
ContentFrame
Composable tomedia3-ui-compose
which combinesPlayerSurface
management with aspect ratio resizing and covering with a shutter. - Work around a known API 34 platform bug causing stretched/cropped videos when using
SurfaceView
inside a ComposeAndroidView
and hence affectingContentFrame
andPlayerSurface
Composables withSURFACE_TYPE_SURFACE_VIEW
(#1237, #2811). - Create a new
media3-ui-compose-material3
module and add Material3-themed Composables (PlayPauseButton, NextButton, PreviousButton, SeekBackButton, SeekForwardButton, RepeatButton, ShuffleButton, MuteButton) to it. - Add support for placing a media route button in the
PlayerView
.
- Add
- HLS extension:
- Parse HLS interstitial skip attributes.
- Map skip control attributes from the HLS playlist and the asset list document into the
AdPlaybackState
for public access. - Fix bug where the start time of the playlist was dropped when the EXT-X-PROGRAM-START-DATE tag defining the start time was removed from a playlist (#2760).
- Use binary search to find the segment index of a given position in the playlist (#2826.
- DASH extension:
- Fix
UnsupportedOperationException
when playing DASH streams with a non-hierarchicaldata:
URI manifest (#2688). - Reset
LiveConfiguration
to the value provided by theMediaItem
of theDashMediaSource
when released and when the media item is updated by the user (#2606). - Avoid crashes caused by invalid manifest updates that were not reported as player errors (#2805).
- Fix
- RTSP extension:
- Handle error of missing RTP packets when processing fragmented NAL units for H264 and H265 (#2613).
- Decoder extensions (FFmpeg, VP9, AV1, etc.):
- AV1 Extension: The AV1 software decoder now uses the high-performance
dav1d
library, replacing the previouslibgav1
implementation for improved decoding speed.
- AV1 Extension: The AV1 software decoder now uses the high-performance
- Cast extension:
- Add
CastPlayer.Builder
, which enablesCastPlayer
to do both local and Cast playback. To keep the oldCastPlayer
behavior of supporting only Cast playback, you can useRemoteCastPlayer
. The pre-existingCastPlayer
constructors keep their old behavior, but are deprecated in favour of using theCastPlayer
orRemoteCastPlayer
builders instead. - Stop enforcing a non-null mime type in
DefaultMediaItemConverter
. - Use
MediaItem.mediaMetadata.mediaType
to infer the Cast MEDIA_TYPE to use inDefaultCastOptionsProvider#toMediaQueueItem
, when available. - Enable remote to local transfers in
DefaultCastOptionsProvider
. - Add support for Cast in the Session demo.
- Add support for displaying a media route button on a Composable UI.
- Add support for displaying a media route button on an action bar menu.
- Add support for displaying a media route button as a View UI.
- Add
- Test Utilities:
- Add maximum time diff for the auto-advancing behavior of
FakeClock
. It defaults to 1 second, but is configurable viaFakeClock.Builder
. - Add maximum time diff between messages for
RobolectricUtil.runMainLooperUntil
(andrunLooperUntil
). It defaults to 1 second, but is configurable via new overloads of these methods. - Move
CapturingRenderersFactory
fromtest-utils
totest-utils-robolectric
.
- Add maximum time diff for the auto-advancing behavior of
- Remove deprecated symbols:
- Remove deprecated
DefaultPreloadManager
constructor. UseDefaultPreloadManager.Builder
instead. - Removed deprecated
EditedMediaItemSequence
constructors. UseEditedMediaItemSequence.Builder
instead.
- Remove deprecated