r2.18.0
This release corresponds to the AndroidX media3 1.0.0-beta01 release.
- Core library:
- Enable support for Android platform diagnostics via
MediaMetricsManager. ExoPlayer will forward playback 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 ExoPlayer withExoPlayer.Builder.setUsePlatformDiagnostics(false). - Fix bug that tracks are reset too often when using
MergingMediaSource, for example when side-loading subtitles and changing the selected subtitle mid-playback (#10248). - Stop detecting 5G-NSA network type on API 29 and 30. These playbacks will assume a 4G network.
- Disallow passing
nulltoMediaSource.Factory.setDrmSessionManagerProviderandMediaSource.Factory.setLoadErrorHandlingPolicy. Instances ofDefaultDrmSessionManagerProviderandDefaultLoadErrorHandlingPolicycan be passed explicitly if required. - Add
MediaItem.RequestMetadatato represent metadata needed to play media when the exactLocalConfigurationis not known. Also removeMediaMetadata.mediaUrlas this is now included inRequestMetadata. - Add
Player.Command.COMMAND_SET_MEDIA_ITEMto enable players to allow setting a single item.
- Enable support for Android platform diagnostics via
- Track selection:
- Flatten
TrackSelectionOverridesclass intoTrackSelectionParameters, and promoteTrackSelectionOverrideto a top level class. - Rename
TracksInfotoTracksandTracksInfo.TrackGroupInfotoTracks.Group.Player.getCurrentTracksInfoandPlayer.Listener.onTracksInfoChangedhave also been renamed toPlayer.getCurrentTracksandPlayer.Listener.onTracksChanged. This includes 'un-deprecating' thePlayer.Listener.onTracksChangedmethod name, but with different parameter types. - Change
DefaultTrackSelector.buildUponParametersandDefaultTrackSelector.Parameters.buildUponto returnDefaultTrackSelector.Parameters.Builderinstead of the deprecatedDefaultTrackSelector.ParametersBuilder. - Add
DefaultTrackSelector.Parameters.constrainAudioChannelCountToDeviceCapabilitieswhich is enabled by default. When enabled, theDefaultTrackSelectorwill prefer audio tracks whose channel count does not exceed the device output capabilities. On handheld devices, theDefaultTrackSelectorwill prefer stereo/mono over multichannel audio formats, unless the multichannel format can be Spatialized (Android 12L+) or is a Dolby surround sound format. In addition, on devices that support audio spatialization, theDefaultTrackSelectorwill monitor for changes in the Spatializer properties and trigger a new track selection upon these. Devices with atelevisionUI mode are excluded from these constraints and the format with the highest channel count will be preferred. To enable this feature, theDefaultTrackSelectorinstance must be constructed with aContext.
- Flatten
- Video:
- Rename
DummySurfacetoPlaceholderSurface. - Add AV1 support to the
MediaCodecVideoRenderer.getCodecMaxInputSize.
- Rename
- Audio:
- Use LG AC3 audio decoder advertising non-standard MIME type.
- Change the return type of
AudioAttributes.getAudioAttributesV21()fromandroid.media.AudioAttributesto a newAudioAttributesV21wrapper class, to prevent slow ART verification on API < 21. - Query the platform (API 29+) or assume the audio encoding channel count for audio passthrough when the format audio channel count is unset, which occurs with HLS chunkless preparation (10204).
- Configure
AudioTrackwith channel maskAudioFormat.CHANNEL_OUT_7POINT1POINT4if the decoder outputs 12 channel PCM audio (#10322.
- DRM
- Ensure the DRM session is always correctly updated when seeking immediately after a format change (10274).
- Text:
- Change
Player.getCurrentCues()to returnCueGroupinstead ofList<Cue>. - SSA: Support
OutlineColourstyle setting whenBorderStyle == 3(i.e.OutlineColoursets the background of the cue) (#8435). - CEA-708: Parse data into multiple service blocks and ignore blocks not associated with the currently selected service number.
- Remove
RawCcExtractor, which was only used to handle a Google-internal subtitle format.
- Change
- Extractors:
- Matroska: Parse
DiscardPaddingfor Opus tracks. - MP4: Parse bitrates from
esdsboxes. - Ogg: Allow duplicate Opus ID and comment headers (#10038).
- Matroska: Parse
- UI:
- Fix delivery of events to
OnClickListeners set onStyledPlayerViewandPlayerView, in the case thatuseController=false(#9605). Also fix delivery of events toOnLongClickListenerfor all view configurations. - Fix incorrectly treating a sequence of touch events that exit the bounds of
StyledPlayerViewandPlayerViewbeforeACTION_UPas a click (#9861). - Fix
PlayerViewaccessibility issue where tapping might toggle playback rather than hiding the controls (#8627). - Rewrite
TrackSelectionViewandTrackSelectionDialogBuilderto work with thePlayerinterface rather thanExoPlayer. This allows the views to be used with otherPlayerimplementations, and removes the dependency from the UI module to the ExoPlayer module. This is a breaking change. - Don't show forced text tracks in the
PlayerViewtrack selector, and keep a suitable forced text track selected if "None" is selected (#9432).
- Fix delivery of events to
- DASH:
- Parse channel count from DTS
AudioChannelConfigurationelements. This re-enables audio passthrough for DTS streams (#10159). - Disallow passing
nulltoDashMediaSource.Factory.setCompositeSequenceableLoaderFactory. Instances ofDefaultCompositeSequenceableLoaderFactorycan be passed explicitly if required.
- Parse channel count from DTS
- HLS:
- Fallback to chunkful preparation if the playlist CODECS attribute does not contain the audio codec (#10065).
- Disallow passing
nulltoHlsMediaSource.Factory.setCompositeSequenceableLoaderFactory,HlsMediaSource.Factory.setPlaylistParserFactory, andHlsMediaSource.Factory.setPlaylistTrackerFactory. Instances ofDefaultCompositeSequenceableLoaderFactory,DefaultHlsPlaylistParserFactory, or a reference toDefaultHlsPlaylistTracker.FACTORYcan be passed explicitly if required.
- Smooth Streaming:
- Disallow passing
nulltoSsMediaSource.Factory.setCompositeSequenceableLoaderFactory. Instances ofDefaultCompositeSequenceableLoaderFactorycan be passed explicitly if required.
- Disallow passing
- RTSP:
- Add RTP reader for MPEG4 (#35).
- Add RTP reader for HEVC (#36).
- Add RTP reader for AMR. Currently only mono-channel, non-interleaved AMR streams are supported. Compound AMR RTP payload is not supported. (#46)
- Add RTP reader for VP8 (#47).
- Add RTP reader for WAV (#56).
- Fix RTSP basic authorization header. (#9544).
- Stop checking mandatory SDP fields as ExoPlayer doesn't need them (#10049).
- Throw checked exception when parsing RTSP timing (#10165).
- Add RTP reader for VP9 (#47).
- Add RTP reader for OPUS (#53).
- Data sources:
- Rename
DummyDataSourcetoPlaceholderDataSource. - Workaround OkHttp interrupt handling.
- Rename
- Ad playback / IMA:
- Decrease ad polling rate from every 100ms to every 200ms, to line up with Media Rating Council (MRC) recommendations.
- FFmpeg extension:
- Update CMake version to
3.21.0+to avoid a CMake bug causing AndroidStudio's gradle sync to fail (#9933).
- Update CMake version to
- Remove deprecated symbols:
- Remove
Player.Listener.onTracksChanged(TrackGroupArray, TrackSelectionArray). UsePlayer.Listener.onTracksChanged(Tracks)instead. - Remove
Player.getCurrentTrackGroupsandPlayer.getCurrentTrackSelections. UsePlayer.getCurrentTracksinstead. You can also continue to useExoPlayer.getCurrentTrackGroupsandExoPlayer.getCurrentTrackSelections, although these methods remain deprecated. - Remove
DownloadHelperDEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_VIEWPORTandDEFAULT_TRACK_SELECTOR_PARAMETERSconstants. UsegetDefaultTrackSelectorParameters(Context)instead when possible, andDEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXTotherwise. - Remove constructor
DefaultTrackSelector(ExoTrackSelection.Factory). UseDefaultTrackSelector(Context, ExoTrackSelection.Factory)instead. - Remove
Transformer.Builder.setContext. TheContextshould be passed to theTransformer.Builderconstructor instead.
- Remove