This release includes the following changes since the 1.1.1 release:
- Common Library:
- Add a
@Nullable Throwableparameter to the methods in theLog.Loggerinterface. Themessageparameter to these methods no longer contains any information about theThrowablepassed to theLog.{d,i,w,e}()methods, so implementations will need to manually append this information if desired (possibly usingLogger.appendThrowableString(String, Throwable)). - Fix Kotlin compatibility issue where nullable generic type parameters and nullable array element types are not detected as nullable. Examples are
TrackSelectorResultandSimpleDecodermethod parameters (#6792). - Change default UI and notification behavior in
Util.shouldShowPlayButtonto show a "play" button while playback is temporarily suppressed (e.g. due to transient audio focus loss). The legacy behavior can be maintained by usingPlayerView.setShowPlayButtonIfPlaybackIsSuppressed(false)orMediaSession.Builder.setShowPlayButtonIfPlaybackIsSuppressed(false)(#11213). - Upgrade
androidx.annotation:annotation-experimentalto1.3.1to fix https://issuetracker.google.com/251172715. - Move
ExoPlayer.setAudioAttributesto thePlayerinterface.
- Add a
- ExoPlayer:
- Fix seeking issues in AC4 streams caused by not identifying decode-only samples correctly (#11000).
- Add suppression of playback on unsuitable audio output devices (e.g. the built-in speaker on Wear OS devices) when this feature is enabled via
ExoPlayer.Builder.setSuppressPlaybackOnUnsuitableOutput. The playback suppression reason will be updated asPlayer.PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUTif playback is attempted when no suitable audio outputs are available, or if all suitable outputs are disconnected during playback. The suppression reason will be removed when a suitable output is connected. - Add
MediaSource.canUpdateMediaItemandMediaSource.updateMediaItemto acceptMediaItemupdates after creation viaPlayer.replaceMediaItem(s). - Allow
MediaItemupdates for allMediaSourceclasses provided by the library viaPlayer.replaceMediaItem(s)(#33, #9978). - Rename
MimeTypes.TEXT_EXOPLAYER_CUEStoMimeTypes.APPLICATION_MEDIA3_CUES. - Add
PngExtractorthat sends and reads a whole PNG file into theTrackOutputas one sample. - Enhance
SequenceableLoader.continueLoading(long)method in theSequenceableLoaderinterface toSequenceableLoader.continueLoading(LoadingInfo loadingInfo).LoadingInfocontains additional parameters, includingplaybackSpeedandlastRebufferRealtimeMsin addition to the existingplaybackPositionUs. - Enhance
ChunkSource.getNextChunk(long, long, List, ChunkHolder)method in theChunkSourceinterface toChunkSource.getNextChunk(LoadingInfo, long, List, ChunkHolder). - Add additional fields to Common Media Client Data (CMCD) logging: buffer starvation (
bs), deadline (dl), playback rate (pr) and startup (su) (#8699). - Add luma and chroma bitdepth to
ColorInfo(#491). - Add additional fields to Common Media Client Data (CMCD) logging: next object request (
nor) and next range request (nrr) (#8699). - Add functionality to transmit Common Media Client Data (CMCD) data using query parameters (#553).
- Fix
ConcurrentModificationExceptioninExperimentalBandwidthMeter(#612). - Add
MediaPeriodIdparameter toCompositeMediaSource.getMediaTimeForChildMediaTime. - Support
ClippingMediaSource(and other sources with period/window time offsets) inConcatenatingMediaSource2(#11226). - Change
BaseRenderer.onStreamChanged()to also receive aMediaPeriodIdargument.
- Transformer:
- Parse EXIF rotation data for image inputs.
- Remove
TransformationRequest.HdrModeannotation type and its associated constants. UseComposition.HdrModeand its associated constants instead. - Simplify the
OverlaySettingsto fix rotation issues. - Changed
frameRateanddurationUsparameters ofSampleConsumer.queueInputBitmaptoTimestampIterator.
- Track Selection:
- Add
DefaultTrackSelector.Parameters.allowAudioNonSeamlessAdaptivenessto explicitly allow or disallow non-seamless adaptation. The default stays at its current behavior oftrue.
- Add
- Extractors:
- MPEG-TS: Ensure the last frame is rendered by passing the last access unit of a stream to the sample queue (#7909).
- Fix typo when determining
rotationDegrees. ChangedprojectionPosePitchtoprojectionPoseRoll(#461). - Remove the assumption that
Extractorinstances can be directly inspected withinstanceof. If you want runtime access to the implementation details of anExtractoryou must first callExtractor.getUnderlyingInstance. - Add
BmpExtractor. - Add
WebpExtractor. - Add
HeifExtractor. - Add QuickTime classic support to
Mp4Extractor.
- Audio:
- Add support for 24/32-bit big-endian PCM in MP4 and Matroska, and parse PCM encoding for
lpcmin MP4. - Add support for extracting Vorbis audio in MP4.
- Add
AudioSink.getFormatOffloadSupport(Format)that retrieves level of offload support the sink can provide for the format through aDefaultAudioOffloadSupportProvider. It returns the newAudioOffloadSupportthat containsisFormatSupported,isGaplessSupported, andisSpeedChangeSupported. - Add
AudioSink.setOffloadMode()through which the offload configuration on the audio sink is configured. Default isAudioSink.OFFLOAD_MODE_DISABLED. - Offload can be enabled through
setAudioOffloadPreferenceinTrackSelectionParameters. If the set preference is to enable, the device supports offload for the format, and the track selection is a single audio track, then audio offload will be enabled. - If
audioOffloadModePreferenceis set toAUDIO_OFFLOAD_MODE_PREFERENCE_REQUIRED, then theDefaultTrackSelectorwill only select an audio track and only if that track's format is supported in offload. If no audio track is supported in offload, then no track will be selected. - Disabling gapless support for offload when pre-API level 33 due to playback position issue after track transition.
- Remove parameter
enableOffloadfromDefaultRenderersFactory.buildAudioSinkmethod signature. - Remove method
DefaultAudioSink.Builder.setOffloadMode. - Remove intdef value
DefaultAudioSink.OffloadMode.OFFLOAD_MODE_ENABLED_GAPLESS_DISABLED. - Add support for Opus gapless metadata during offload playback.
- Allow renderer recovery by disabling offload if failed at first write (#627).
- Enable Offload Scheduling by default for audio-only offloaded playback.
- Delete
ExoPlayer.experimentalSetOffloadSchedulingEnabledandAudioOffloadListener.onExperimentalOffloadSchedulingEnabledChanged. - Renamed
onExperimentalSleepingForOffloadChangedasonSleepingForOffloadChangedandonExperimentalOffloadedPlaybackasonOffloadedPlayback. - Move audio offload mode related
TrackSelectionParametersinterfaces and definitions to an innerAudioOffloadPreferencesclass. - Add
onAudioTrackInitializedandonAudioTrackReleasedcallbacks toAnalyticsListener,AudioRendererEventListenerandAudioSink.Listener. - Fix DTS Express audio buffer underflow issue (#650).
- Fix bug where the capabilities check for E-AC3-JOC throws an
IllegalArgumentException(#677).
- Add support for 24/32-bit big-endian PCM in MP4 and Matroska, and parse PCM encoding for
- Video:
- Allow
MediaCodecVideoRendererto use a customVideoFrameProcessor.Factory. - Fix bug where the first frame couldn't be rendered if the audio stream starts with negative timestamps (#291).
- Allow
- Text:
- Remove
ExoplayerCuesDecoder. Text tracks withsampleMimeType = application/x-media3-cuesare now directly handled byTextRendererwithout needing aSubtitleDecoderinstance.
- Remove
- Metadata:
MetadataDecoder.decodewill no longer be called for "decode-only" samples as the implementation must return null anyway.
- Effect:
- Add
VideoFrameProcessor.queueInputBitmap(Bitmap, Iterator<Long>)queuing bitmap input by timestamp. - Change
VideoFrameProcessor.registerInputStream()to be non-blocking. Apps must implementVideoFrameProcessor.Listener#onInputStreamRegistered(). - Changed
frameRateanddurationUsparameters ofVideoFrameProcessor.queueInputBitmaptoTimestampIterator.
- Add
- IMA extension:
- Fix bug where a multi-period DASH live stream that is not the first item in a playlist can throw an exception (#571).
- Release StreamManager before calling
AdsLoader.destroy() - Bump IMA SDK version to 3.31.0.
- Session:
- Set the notifications foreground service behavior to
FOREGROUND_SERVICE_IMMEDIATEinDefaultMediaNotificationProvider(#167). - Use only
android.media.session.MediaSession.setMediaButtonBroadcastReceiver()above API 31 to avoid problems with deprecated API on Samsung devices (#167). - Use the media notification controller as proxy to set available commands and custom layout used to populate the notification and the platform session.
- Convert media button events that are received by
MediaSessionService.onStartCommand()within Media3 instead of routing them to the platform session and back to Media3. With this, the caller controller is always the media notification controller and apps can easily recognize calls coming from the notification in the same way on all supported API levels. - Fix bug where
MediaController.getCurrentPosition()is not advancing when connected to a legacyMediaSessionCompat. - Add
MediaLibrarySession.getSubscribedControllers(mediaId)for convenience. - Override
MediaLibrarySession.Callback.onSubscribe()to assert the availability of the parent ID for which the controller subscribes. If successful, the subscription is accepted andnotifyChildrenChanged()is called immediately to inform the browser (#561). - Add session demo module for Automotive OS and enable session demo for Android Auto.
- Do not set the queue of the framework session when
COMMAND_GET_TIMELINEis not available for the media notification controller. With Android Auto as the client controller reading from the framework session, this has the effect that thequeuebutton in the UI of Android Auto is not displayed (#339). - Use
DataSourceBitmapLoaderby default instead ofSimpleBitmapLoader(#271, #327). - Add
MediaSession.Callback.onMediaButtonEvent(Intent)that allows apps to override the default media button event handling.
- Set the notifications foreground service behavior to
- UI:
- Add a
Player.Listenerimplementation for Wear OS devices that handles playback suppression due toPlayer.PLAYBACK_SUPPRESSION_REASON_UNSUITABLE_AUDIO_OUTPUTby launching a system dialog to allow a user to connect a suitable audio output (e.g. bluetooth headphones). The listener will auto-resume playback if a suitable device is connected within a configurable timeout (default is 5 minutes).
- Add a
- Downloads:
- Declare "data sync" foreground service type for
DownloadServicefor Android 14 compatibility. When using this service, the app also needs to adddataSyncasforegroundServiceTypein the manifest and add theFOREGROUND_SERVICE_DATA_SYNCpermission (#11239).
- Declare "data sync" foreground service type for
- HLS Extension:
- Refresh the HLS live playlist with an interval calculated from the last load start time rather than the last load completed time (#663).
- DASH Extension:
- Allow multiple of the same DASH identifier in segment template url.
- Add experimental support for parsing subtitles during extraction. This has better support for merging overlapping subtitles, including resolving flickering when transitioning between subtitle segments. You can enable this using
DashMediaSource.Factory.experimentalParseSubtitlesDuringExtraction()(#288).
- RTSP Extension:
- Fix a race condition that could lead to
IndexOutOfBoundsExceptionwhen falling back to TCP, or playback hanging in some situations. - Check state in RTSP setup when returning loading state of
RtspMediaPeriod(#577). - Ignore custom Rtsp request methods in Options response public header (#613).
- Use RTSP Setup Response timeout value in time interval of sending keep-alive RTSP Options requests (#662).
- Fix a race condition that could lead to
- Decoder Extensions (FFmpeg, VP9, AV1, MIDI, etc.):
- Release the MIDI decoder module, which provides support for playback of standard MIDI files using the Jsyn library to synthesize audio.
- Add
DecoderOutputBuffer.shouldBeSkippedto directly mark output buffers that don't need to be presented. This is preferred overC.BUFFER_FLAG_DECODE_ONLYthat will be deprecated. - Add
Decoder.setOutputStartTimeUsandSimpleDecoder.isAtLeastOutputStartTimeUsto allow decoders to drop decode-only samples before the start time. This should be preferred toBuffer.isDecodeOnlythat will be deprecated. - Fix bug publishing MIDI decoder artifact to Maven repository. The artifact is renamed to
media3-exoplayer-midi(#734).
- Leanback extension:
- Fix bug where disabling a surface can cause an
ArithmeticExceptionin Leanback code (#617).
- Fix bug where disabling a surface can cause an
- Test Utilities:
- Make
TestExoPlayerBuilderandFakeClockcompatible with Espresso UI tests and Compose UI tests. This fixes a bug where playback advances non-deterministically during Espresso or Compose view interactions.
- Make
- Remove deprecated symbols:
- Remove
TransformationRequest.Builder.setEnableRequestSdrToneMapping(boolean)andTransformationRequest.Builder.experimental_setEnableHdrEditing(boolean). UseComposition.Builder.setHdrMode(int)and pass theCompositiontoTransformer.start(Composition, String)instead. - Remove deprecated
DownloadNotificationHelper.buildProgressNotificationmethod, use a non deprecated method that takes anotMetRequirementsparameter instead.
- Remove